And the Gatling howitzer is great fun! Probably better as omni or swivel on a large heavy ship though, but it makes getting away easy. Ship speed from recoil quickly gets up to maxSpeed for gunships.
And I like the particle turret. Very inventive. It seems to target the system center if there are no enemies around.
Um, that's modding! That's all I do until I can't work something out no matter how hard I try. Then start a new topic saying "How does this work" and problem solved.Derakon wrote: I'm inferring based on snippets of code I find lying around.
digdug has an <Events> text that is very useful https://forums.kronosaur.com/viewtopic.php?f=8&t=7324.
The changelog and AE-FunctionHelp are mentioned below.
You can use fncHelp in the debug screen (er, deprecated; it has been replaced by 'help', see the function list for examples).
And the xelerus function explanations are probably the best resource around for modders IMO. shanejfilomena has a rar file of all these. See the Living Minutes Mod Announcement topic for a link to access this.
The wiki is there, the info is excellent and being updated but IMO navigation is too difficult.
To output text there are a number of functions.
I've seen some of these in your mod but listed here for everyone else.
printTo
plyMessage
objSendMessage
If you set the variable 'variableName' to '7' then the following code
Code: Select all
(printTo 'log variableName)
Code: Select all
(printTo 'console variableName)
Note: this code can either be placed in the mod code or entered into the debug screen.
If you've got a line of code working in the debug screen and want to transfer it to an xml file, wrap the code in double quotes. This is really easy thanks to gc's 'Home' and 'End' key compatibility in the debug screen (ty).
Code: Select all
(printTo 'log "(setq variableName 7)")
Of particular use is 'plyMessage'. These are the messages that appears at the bottom of the screen and fade after a few seconds.
Example code (not necessarily working or generating errors, just as an example).
Code: Select all
(setq currentNodeListPos (find stationNodeList (sysGetNode)))
(plyMessage gPlayer "Current node pos found")
(setq nextNodeListPos (add currentNodeListPos 1))
(plyMessage gPlayer "Next node pos found")
(setq nextStationNode (@ stationNodeList nextNodeListPos))
(plyMessage gPlayer "Next node found")
(if (eq nextStationNode Nil)
(block Nil
(scrEnableAction gScreen 'actionFreight Nil)
(scrSetActionDesc gScreen 'actionFreight (scrTranslate gScreen "actionFreight:LastStation"))
You can also use 'objSendMessage' to send similar messages from other objects so you know they are responding as you want. So if you shoot at a ship that ship can '(objSendMessage gPlayer theOtherShip "Ship hit")' so you know it is taking damage.
One last one; 'join'
Using this in the form (join list "\n") will give you a vertical list with one entry on every line, rather than the "absolutely horrific wall of text" that is generated by the game. Try it with (typFind 's) then (join (typFind 's) "\n") in the debug screen for an example. Not really necessary for such a simple list but of great assistance with more complex lists This is particularly useful for printing to the debug log so you can cut and paste the list for reference. Note it needs to be in rtf format (so Wordpad) rather than Notepad (txt format) so the \n formatting works.
And AP's mod AE-FunctionHelp on the Multiverse is 'a wee ripper' (this translates as 'really good'). It enables you to get a function list for a particular game version. (Particularly useful if there is some tardiness involved in the forum updating (drums fingers on desk impatiently) ) So use it in 1.8b1 for a list of all the functions available in that version. Or in 1.7 to get available functions for that version. Although I'm not sure about backwards compatibility, there were a couple of game changes affecting the mod recently.
Also digdug maintains a changelog (https://forums.kronosaur.com/viewtopic.php?f=8&t=7316) which is excellent. You can search it for API numbers or function names, etc to work out how to use the functions or find when they were introduced to the game.
Finally, gc also introduced function shortcuts to the debug screen. You don't need to type 'printTo' in it's entirety. Just typ in '(pr' then press the 'Tab' button, then 'T', then 'Tab' again. End result: '(printTo'. This is even better with longer function names and works for variables as well.
I'd never used dbgLog and dbgOutput before. I did some quick testing and they appear to work exactly the same as printTo 'log and 'console but (according to the function list) only if the game runs in debug mode. The only thing I can think of is the code wasn't running so you never got any output. Or possibly, did you have the dbgOutput code inside the variables brackets? If so, maybe this was affecting it. Dunno.Derakon wrote: Also, how do I output text? The dbgOutput function I saw on the wiki doesn't seem to do anything
Try putting two options for dbgOutput in an 'if' section of code.
Code: Select all
(if (eq 1 1)
(dbgOutput "Yes, equal")
(dbgOutput "No, unequal")
)
Or, as AP says, use 'printTo'.
I'd really like some info on this as well. I generate hundreds of new games when modding, and although the '0' Delete & Quit debug option is really helpful here the loading time (esp for Part 2) really chews up time.Derakon wrote: Also, when are mods loaded? Do I need to restart Transcendence each time I want to tweak my XML? For that matter, do I need to create a new pilot when editing a weapon, or will old pilots that already have an item with the weapon's UNID pick up changes when I make them?