Hi all,
At iocrymdestroyer's suggestion I'm making a mine-layer auton. I know the password part, which is code I haven't added yet. My Q is, how do change the <OnOrdersCompleted> part to something that can be triggered by Deploy mines? Also, how do I set MinePos to the auton's current position?
Can I set MinePos to something I've targeted? And, big nagging question, what does the gSender 13 / 15 / 14 do? Thanks much...
<ItemType UNID="itMineLayerAutonNAMI;"
name= "NAMI mine layer prototype"
level= "7"
value= "41000"
mass= "5000"
frequency= "rare"
unknownType= "&itUnknownAuton2;"
modifiers= "Auton; Military; MinorItem"
description= "NAMI project 520.1.2. Parhelia test prototype. Munitions split 70,30. Aftermarket resupply disabled. R1 shield, ICX, standard coated armor. High destruct yield."
>
<Image imageID="&rsItems1;" imageX="96" imageY="288" imageWidth="96" imageHeight="96"/>
<Invoke key="A">
(block (auton)
; Create the auton
(setq auton
(sysCreateShip
&scMineLayerAutonNAMI;
(objGetPos gSource)
&svFriendlyAuton;
"auton"
)
)
; Escort ship
(shpOrderEscort auton gSource)
; Identify the item
(itmSetKnown gItem)
; Welcome message
(objSendMessage gSource Nil "520.1.2 online. Password required to deploy munitions.")
; Remove the item from the player's list
(objRemoveItem gSource gItem 1)
)
</Invoke>
</ItemType>
<ShipClass UNID="&scMineLayerAutonNAMI;"
manufacturer= "NAMI"
class= "Parhelia"
type= "mine layer"
score= "280"
techOrder= "mech"
attributes= "auton"
mass= "5"
cargoSpace= "57"
thrust= "30"
maneuver= "10"
maxSpeed= "25"
explosionType= "&vtThermoExplosion2;"
leavesWreck= "0"
>
<Armor>
<ArmorSection start="315" span="90" armorID="&itStealthPlate;" areaSet="0,2" />
<ArmorSection start="225" span="90" armorID="&itStealthPlate;" areaSet="3,4" />
<ArmorSection start="135" span="90" armorID="&itStealthPlate;" areaSet="1,6" />
<ArmorSection start="45" span="90" armorID="&itStealthPlate;" areaSet="7,13" />
</Armor>
<Devices>
<Device deviceID="&itNAMIMineLauncher;" enhancement="20"/>
<Device deviceID="&itR1Deflector;"/>
<Device deviceID="&itMissileDefense;"/>
</Devices>
<Items>
<Table>
<Item chance="70" count="10d20+20" item="&itStaticMine;"/>
<Item chance="30" count="10d20+20" item="&itTrackingMine;"/>
</Table>
</Items>
<Image imageID="&rsMediumShips1;" imageX="672" imageY="0" imageWidth="48" imageHeight="48"/>
<Communications>
<Message name="Deploy mines" key="D">
(if (objGetTarget gSender)
(block Nil
(objCommunicate gSource gSender 1 (objGetTarget gSender))
(objSendMessage gSender gSource "Auton order acknowledged")
)
(objSendMessage gSender gSource "Unable to comply")
)
</Message>
<Message name="Form up" key="F">
<OnShow>
(objCommunicate gSource gSender 15)
</OnShow>
<Code>
(block Nil
(objCommunicate gSource gSender 13)
(objSendMessage gSender gSource "Auton order acknowledged")
)
</Code>
</Message>
<Message name="Wait there" key="W">
<OnShow>
(not (objCommunicate gSource gSender 15))
</OnShow>
<Code>
(block Nil
(objCommunicate gSource gSender 14)
(objSendMessage gSender gSource "Auton order acknowledged")
)
</Code>
</Message>
<Message name="Cancel deployment" key="X">
<OnShow>
(and (objGetTarget gSource) (not (objCommunicate gSource gSender 15)))
</OnShow>
<Code>
(block Nil
(objCommunicate gSource gSender 13)
(objSendMessage gSender gSource "Auton order acknowledged")
)
</Code>
</Message>
</Communications>
<Events>
<OnOrdersCompleted>
; GLOBALS
; "MinePos" are the coordinates of the center of the area to mine
;
; "DropMine" is True if the ship should drop a mine at next point
; "Target" is the marker for the next destination
(block (minePos mineItem)
(setq minePos (objGetData gSource "MinePos"))
(setq mineItem (itmCreate &itStaticMine; 1))
; We only do something if we've got mines and a place to go
(if (and minePos (objHasItem gSource mineItem))
(block (destPos)
; Drop a mine if we are ready
(if (objGetData gSource "DropMine")
(block Nil
(sysCreateWeaponFire &itStaticMine; gSource (objGetPos gSource) 0 0 Nil)
(objRemoveItem gSource mineItem)
)
)
; Delete the marker, if it exists
(if (objGetObjRefData gSource "Target")
(objDestroy (objGetObjRefData gSource "Target"))
)
; Pick a position to go to
(setq destPos (sysCreateMarker
""
(sysVectorPolarOffset minePos (random 0 359) (random 1 4))
(objGetSovereign gSource)
))
(objSetObjRefData gSource "Target" destPos)
(shpOrderGoto gSource destPos)
; Drop a mine when we reach the destination
(objSetData gSource "DropMine" True)
)
)
)
</OnOrdersCompleted>
</Events>
<AISettings
fireRateAdj= "20"
fireAccuracy= "90"
perception= "4"
combatStyle= "standOff"
/>
</ShipClass>
Script(?) help for mine-layer auton
- dosbox-gamer
- Commonwealth Pilot
- Posts: 66
- Joined: Sat Apr 05, 2008 9:41 pm
- Location: Utopia Planitia Fleet Yards
"Make no little plans. They have no magic to stir men's blood and probably will not themselves be realized." -- Daniel Hudson Burnham, architect & urban planner
- digdug
- Fleet Admiral
- Posts: 2620
- Joined: Mon Oct 29, 2007 9:23 pm
- Location: Decoding hieroglyphics on Tan-Ru-Dorem
I think that the best and easiest way to do a mine layer auton is to create a timer, and make the auton drop mines using sysCreateWeaponFire.
Starting from line 59 of roguefleet.xml you can find an example of Mine Layer ship (the rogue Auroch) and an example of <OnOrdersCompleted>
Have fun!
Starting from line 59 of roguefleet.xml you can find an example of Mine Layer ship (the rogue Auroch) and an example of <OnOrdersCompleted>
Have fun!
- Arisaya
- Fleet Admiral
- Posts: 5535
- Joined: Tue Feb 05, 2008 1:10 am
- Location: At the VSS Shipyards in the frontier, designing new ships.
Periculi wrote:If you have a machine with a decent amount of ram, try having the mine layers lay other mine layers every 3rd drop.. lol..

(shpOrder gPlayership 'barrelRoll)
<New tutorials, modding resources, and official extension stuff coming to this space soon!>
<New tutorials, modding resources, and official extension stuff coming to this space soon!>
- alterecco
- Fleet Officer
- Posts: 1658
- Joined: Wed Jan 14, 2009 3:08 am
- Location: Previously enslaved by the Iocrym
Hello Dosbox-Gamer.
The (objCommunicate gSource gSender 1) is a little hard to use, since we don't have a clear description anywhere of what the different codes are (if I'm not mistaken). As an alternative look at the (shpOrder*) functions on xelerus. As far as i know, they accomplish the same.
About the position of the mine, 12Ghost12 had it almost correct. If you want to get the position of your target, you must first get your target, and then it's position. It would look something like this:
Just ask if something is not clear.
.]
The (objCommunicate gSource gSender 1) is a little hard to use, since we don't have a clear description anywhere of what the different codes are (if I'm not mistaken). As an alternative look at the (shpOrder*) functions on xelerus. As far as i know, they accomplish the same.
About the position of the mine, 12Ghost12 had it almost correct. If you want to get the position of your target, you must first get your target, and then it's position. It would look something like this:
Code: Select all
(setq MinePos (objGetPos (objGetTarget gPlayerShip)))
.]
- Periculi
- Fleet Officer
- Posts: 1282
- Joined: Sat Oct 13, 2007 7:48 pm
- Location: Necroposting in a forum near you
I remember asking George about objCommunicate codes some time ago. I seem to recall some explanation for the codes somewhere too...
Hmm.. Something about objCommunicate codes here.
still looking for the other bits..
Hmm.. Something about objCommunicate codes here.
still looking for the other bits..
from what i can recall from the posts i've read, objCommunicate is a somewhat outdated mode of giving commands. It was intended for autons and uses a queue of commands. For example, an auton is always on escort (player) mode, if an enemy gets close enough, the auton will attack, then return to escort. You can send the auton to attack, and once the target is destroyed, returns to escort.
the shpOrder commands are better for enemies and AI ships or if you want more control over the ship's behaviour. A ship will always default to shpOrderGate if it has no other orders to cut down on ships just hanging around.
the shpOrder commands are better for enemies and AI ships or if you want more control over the ship's behaviour. A ship will always default to shpOrderGate if it has no other orders to cut down on ships just hanging around.
Coming soon: The Syrtian War adventure mod!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
- dosbox-gamer
- Commonwealth Pilot
- Posts: 66
- Joined: Sat Apr 05, 2008 9:41 pm
- Location: Utopia Planitia Fleet Yards
Wow, thank you everyone for contributing. This is my first scripting effort, and all is appreciated.
Periculi -- thanks for the link to objCommunicate codes. That's the first time I've read anything in-depth like that about the game from George himself. It's kinda like getting a peak behind the curtain.
FWIW, I was a little miffed when you said the autons were "relics from an earlier game, and incomplete". I hope I've changed your mind...
Alterecco -- thanks especially for the clarification. Scripting is WAY hard when you're just starting to learn HOW to read it, let alone code it.
----------------
New Question: regarding my mod "AutonsExtended" (currently at v3p6 33ct), should I keep extending it (i.e. v4p1 41ct), or should I start a new mod that builds off the original, like "AutonsExpanded"??
Periculi -- thanks for the link to objCommunicate codes. That's the first time I've read anything in-depth like that about the game from George himself. It's kinda like getting a peak behind the curtain.

Alterecco -- thanks especially for the clarification. Scripting is WAY hard when you're just starting to learn HOW to read it, let alone code it.
----------------
New Question: regarding my mod "AutonsExtended" (currently at v3p6 33ct), should I keep extending it (i.e. v4p1 41ct), or should I start a new mod that builds off the original, like "AutonsExpanded"??
"Make no little plans. They have no magic to stir men's blood and probably will not themselves be realized." -- Daniel Hudson Burnham, architect & urban planner
- alterecco
- Fleet Officer
- Posts: 1658
- Joined: Wed Jan 14, 2009 3:08 am
- Location: Previously enslaved by the Iocrym
I'm not sure what you mean with v4p1 41ct, but i suppose you mean some sort of versioning. My suggestion is, that you should do all you can to avoid releasing a new mod, if it is similar to the old one. Try to adopt the new version to contain all the stuff you want. If the new mod is radically different (or if they are incompatible), it is of course an option to make a new mod release for it.dosbox-gamer wrote:New Question: regarding my mod "AutonsExtended" (currently at v3p6 33ct), should I keep extending it (i.e. v4p1 41ct), or should I start a new mod that builds off the original, like "AutonsExpanded"??
An example...
Say you have an auton that uses a mining laser in one version, and you upgrade it to use a more powerfull one. Then say you do this for all equipment on board the autons. It should still be a new version, not a new mod.
Say you rewrite the mod to deal with wingmen, not autons. This would be a case where you make a new mod.
These examples may be a bit extreme and absurd, but they represent my attitude on when a new mod should be made from an old mod. I used to have a mod on xelerus called the Signature Memoizer. I recently made a mod called Advanced Targeting Systems that includes alot of the other mods functionality. Instead of putting two mods on xelerus, i replaced the original one completely (even if they were rather different). The main reasons for this is that it keeps the number of similar mods on xelerus down, and it helps you to have fewer mods to maintain (eg. when 1.0 comes out, it would be cool to update yor mods. Having tons of similar mods released would be a pain then).
OK. that was a bit of a rant. Feel free to ignore any suggestions

.]
- dosbox-gamer
- Commonwealth Pilot
- Posts: 66
- Joined: Sat Apr 05, 2008 9:41 pm
- Location: Utopia Planitia Fleet Yards
Thanks alterecco, that does make sense. BTW, version 4p1 41ct was meant to be a teaser -- it means I've created 8 more new autons since my last upload...
"Make no little plans. They have no magic to stir men's blood and probably will not themselves be realized." -- Daniel Hudson Burnham, architect & urban planner