Posted: Fri Jun 22, 2007 8:07 pm Post subject:
SW script
Subject description: super weapon scripting suggestion
I suggest a method of scripting super weapons rather than the curret hard coded method.
All varibles should be local within the script only to prevent conflicts if 2 scripts use the same varible name or 2 instances of a script run at once.
Certain varibles should be set when the SW is fired such as:
Code:
FiredBy ;The strcture that fired this sw such as a nuke silo.
Target ;Where the player targeted the sw.
Owner ;The player number who fired the sw
2 examples of it's use. 1st is for a para drop and the second for the multi missile.
1st word of each line should define a command
as Spawn, Deploy, Move
after this should be the commands parameters seperated by commas
Code:
[PARADROPSW]
SpawnOffMap, HPLANE, DropPlane, Owner ;Spawn Heavy Plane Unit off map. Assign unit name "DropPlane" owned by "Owner"
CriticleObject, DropPlane ;This makes "DropPlane" a script criticle object. If the object is destroyed script will end thus preventing a possible wait for eternity later in the script.
Move, DropPlane, Target ;Move unit "DropPlane" to "Target"
Distance, DropPlane, Target, >, 10 ;Don't proced unit DropPlane is less than 10 cells from Target.
Para, DropPlane, E1, 10, NULL, Owner ;Drop 10 units of type E1 from unit "DropPlane" and don't give these units a name. Units owned by "Owner"
ExitMap, DropPlane ;Order "DropPlane" to move off map and disapear.
End ;End the script
Code:
[MULTISW]
FireWeapon, MultiMissile, FiredBy, Target, Owner ;Fire the multimissile weapon from the fired by object (silo) at the target location. Missile Owned by "Owner"
End
If needed the commands etc could be replace with numbers as in TS's AI scripts but i think retaining words would be best if possible for readabilerty.
While this might seem alot of work for SW's the scripting system could also be used for writeing AI scripts. QUICK_EDIT
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum