JohnBWatson wrote:That can be done easily enough. Anything you'd like me to focus on?
Well.... since you asked.
Commence rambling thoughts.
Very basic stuff. Using BlueLight.xml as an example.
Within <AdventureDesc
startingShipCriteria=
It looks like any ship with an attribute of D0110000_Playership will work here. Is this the only option? Can it be a UNID instead. Can this adventure look at the 3 standard starter ships in the base game?
startingSystem=
"SE" is a nodeID (as per ExtSystemMap.xml) Can it be anything else? Can you start in the middle of a topology?
startingPos=
What is "Start"? What other options are there?
<Text id="description" which I think means it will print this text in the upper right of the screen. Can anything else be put on the screen?
I'm not sure why you need (cat here given that it is only one lot of text.
And what does the {/rtf do?
What is <GetGlobalAchievements> and what does intGetGlobalAchievements do?
Etc, etc.
In the code itself things like gamSetCrawlImage and gamSetCrawlText are fairly obvious but what is /n/n, %name%, and aEpitaph and how are they used?
Why do you need plyComposeString in <OnGameEnd> and not <OnGameStart>?
What makes aBestEnemiesDestroyed different from aEnemiesDestroyed? And what does 0x04 and 0x02 do?
Like I said, VERY basic stuff.
I use the xelerus functionlist a lot and it is very helpful but it tends to be a description of the function by someone who already understands it. What I think is needed is an explanation of how to use it for someone who doesn't understand it.
What would be really good is a step by step description of the switch function you use in <OnGameEnd>. Although switch is a fairly easy to comprehend function the practice of it when it starts to include or, eq, if, etc tends to get a bit confusing.
I don't think it really is possible to be too detailed here. Using my favourite bit of code from Corp Trading Post in CorporateHierarchy.xml as an example (Thanks, George).
Code: Select all
<Action name="Place Order" default="1" key="P">
(block (transport)
; Create a transport at the nearest gate and put the item on it
(setq transport (sysCreateShip &scEI100; (objGetNearestStargate gSource) &svCorporate;))
(objAddItem transport gItem)
; Order the transport to dock with the station and then gate out
(shpOrderDock transport gSource)
(shpOrderWait transport (random 5 10))
(shpOrderGate transport)
; Register the transport so we know if it got destroyed
(objRegisterForEvents gSource transport)
; Remember the item and the transport
(objSetData gSource "Order" gItem)
(objSetObjRefData gSource "Transport" transport)
; Set the mission status
(objSetData gSource "MissionStatus" "intransit")
; Charge the player
(plyCharge gPlayer gCost)
(plyRecordBuyItem gPlayer gItem gCost)
(objIncData gSource "OrderCount" 1)
(scrShowPane gScreen "ThankYou")
)
</Action>
I can actually understand half of this (although I can't write it yet) and would suggest that for a tutorial mod even more comments could be added.
Something like:
;When you press "P" this block of code creates a ship at the nearest stargate, puts the item(s) on it, pilots it to the Trading Post, docks, transfers the item(s) to the Trading Post, waits for a random length of time, pilots the ship back to the stargate and gates it out of the system. It also lets the computer know what to do if the ship gets destroyed, lets the computer know that the item(s) are on the way but not yet at the Trading Post, takes the money from the player and says "Thanks".
;setq means we are going to create or define something. In this case we will be creating a ship at a certain point and putting things inside it
;transport is the name given to this ship, it could have been called freighterthatdeliversitems or shipthatdropsoffitems but transport is shorter.
;sysCreateShip, as it says, creates a ship. In this case an EI100 freighter but any ship can be used. Just insert the desired ship class. Or possibly a random ship can be generated. Other will know how.
;objGetNearestStargate gSource is part of the sysCreateShip function. It tells the computer to create the ship at the nearest stargate (GetNearestStargate) to the gSource (in this case gSource is the Trading Post where the action is happening) Alternatively a ship can maybe be created at a set of coordinates or at a certain distance.
;SVCorporate is the sovereign. I don't know if this needs to be here or why.
And more info like this for every section of code.
It may seem too simple for modders with lots of experience, and it is very time consuming, but I feel this is the level of explanation that is needed to make it easier for people to mod.
It's certainly different from this:
Code: Select all
<Action name="Place Order" default="1" key="P">
(block (transport)
(setq transport (sysCreateShip &scEI100; (objGetNearestStargate gSource) &svCorporate;))
(objAddItem transport gItem)
(shpOrderDock transport gSource)
(shpOrderWait transport (random 5 10))
(shpOrderGate transport)
(objRegisterForEvents gSource transport)
(objSetData gSource "Order" gItem)
(objSetObjRefData gSource "Transport" transport)
(objSetData gSource "MissionStatus" "intransit")
(plyCharge gPlayer gCost)
(plyRecordBuyItem gPlayer gItem gCost)
(objIncData gSource "OrderCount" 1)
(scrShowPane gScreen "ThankYou")
)
</Action>
which would have me bashing my head on the keyboard quite a lot.
The Trading Post code is only a very rough example and I've probably got a lot of it wrong. What I'm trying to convey is that you can't write code until you understand it, and you can't understand it until it has been explained with actual code examples. Preferably a lot of different examples. Repetition and redundancy are good things here.
That's my thoughts. Thanks for the mod. I learn something new every time I look at it.
Edited: thanks. Much nicer.
Stupid code. Do what I want, not what I typed in!