Laser Squad has several special effects that happen at certain points in the various scenarios (e.g. doors sliding open on Moonbase Assault, Robots turning up in the Cyber Hordes, and Prisoners leaving the game in Rescue from the Mines when you walk them into the lifts). This was implemented in the origional with machine code embedded in the data of the scenario file. In my version of Laser Squad I've implemented it using what I call an Effects editor. This allows me to emulate the effects in the origional game while opening the posibility of new effects in new scenarios. If you want a mine-field, you can create one using the cause and effect editor. If you want powered armour (as in the film Aliens) that increases your armour, and strength but slows you down, you can do this. Want a weapon that stuns someone rather than injure them? This also is possible. If you can think of something that's not possible, E-Mail me and I'll add it in, or tell you how it's already possible.
To implement so many things the Effects editor is a bit tricky but the basic premise is simple. It's like a programming language which starts running at the first command and implements each instruction in turn. You can change the flow of commands depending on certain conditions. For those of you with programming experience it hopefully won't be too difficult to get your head around, and for those of you without any programming experience don't worry: the concepts aren't so difficult that you can't do simple things (and once you've done simple things you'll have an idea of how the Effects editor works and you'll be able to figure out the more tricky stuff). Besides here are some examples to look through once you've gone through the basic concepts.
Effects are edited in the scenario editor using the Effects editor window. On the right are the commands that are executed when the effect is run. In front of each is the number indicating the command's position in the sequence of commands. These numbers are used by the jump and subroutine commands. The red rectangle highlights the current command and can be moved with a click of the mouse and the scroll bar.
On the left are the editing buttons. At the top is a pull-down list that allows you to select the type of command, and below this is another pull-down list that allows you to select the actual command. Below these pull-down lists will be any extra information that the command needs. Most of the extra information is fairly intuitive to edit. Simply alter the value in the text box or click on any picture to change a generic item or terrain, or to edit an animation.
At the bottom left are three buttons that remove the currently selected command, add a new command above the currently selected command, or add a new command below the currently selected command.
Above these buttons is the Clear Effects button. It will wipe all the commands in the current effect.
At the bottom of the editor, 'OK' saves the changes and closes the editor and 'Cancel' closes the editor discarding any changes.
The Effects editor obeys commands in sequence. These commands might be simple (for example forcing the game to end and display the victory screen) or they might require some extra information (for example adding a new unit to the game, and you need to specify the details of the unit to add). Numbers used as extra arguments are mostly between -32768 and +32767 for space reasons. There are only a few commands that use numbers between -2147483648 and +2147483647 and they will be specifically noted in the list of commands.
Certain commands (Jump, Call, and Gosub) alter the sequence that the commands are executed in. Jump tells the Effects editor to start obeying commands in sequence starting at the specified command. The Gosub commands are similar to the jump commands but remember where they came from. It makes a note of the next command after the current Gosub jump command. When it comes across a Return from subroutine command it then returns and obeys in sequence starting at the command after the Gosub jump command. These can be stacked up (it uses a seperate stack to the one mentioned below and can be ignored). So if you have a Subroutine jump to A command, and then while obeying commands at A you come across a Subroutine jump to B command, the Effects processor will return to the command after the Subroutine jump to B command when it comes across a Return from subroutine command. A further Return from subroutine command will return the Effects processor to the command after the Subroutine jump to A command. The Call commands are almost identical to the Gosub commands, except they will jump to the first command in the named Routine.
To perform any calculations (for example if you want to multiply the difficulty level by 2 to work out how many mines to put in a minefield so there are more mines in a difficult game) there is what is known as a stack. You can manipulate numbers, and the result is put back on the stack. A stack is a First in, Last out list of numbers that can hold any whole number between -2147483648 and +2147483647. For those of you without any programming knowlage, think of it as a stack of books on the floor. If you add a new book to the top of the stack it will be the first book you have to take off the stack. If you put book A on the stack, then book B, and then book C. Book C would be first on the stack, and B would be second on the stack. If you took book C off the stack then B would be the first on the stack and A would be the second on the stack. You can only take stuff off the top of a stack, and can only put new stuff onto the top of a stack. The technical term for putting a value onto the stack is to "push" it onto the stack and the term for taking a value off the stack is to "pop" it off the stack. The stack is wiped clean everytime an Effect is started.
In addition to changing values on the stack, certain commands (most notably the compare commands) change what are called state flags. These record whether the last calculation produced a result that was zero, not zero, equal, not equal, if the comparision was true or false, and if the comparison was greater or less than the number being compared to. These can then be checked and used to determine whether certain commands happen. So for example you can compare the item a unit is carrying with a generic item and then jump if the comparison was true to change the course of the Effects. The True/False flags (which is the same as the equal/not equal and zero/not zero flags) is also used in other commands to set other flags such as Unit attributes or the General Flags which can be used to keep track of things.
There are 64 general flags available for your use. These can be set (turned to True), reset (turned to False), and checked(the True/False state flag is set to the same value as the general flag). Their value doesn't change between effects and so can be used to record events in one Effect for use in another Effect. For example in the Cyber Hordes when a robot is destroyed a flag unique to that unit is set in the Death Effects. When the End of Turn Effects is run, each flag is checked and if it finds a set flag then that Unit is resurected.
There are 64 counters. These hold numbers from -2147483648 to +2147483647. These don't change between Effects and can be used to hold information from one Effect to another (positions of randomly placed mines in a minefield for example). Their values can be modified directly or moved to and from the stack to allow more intricate manipulations of the value.
You can also define Arrays. These are simply numbered sequences of numbers. You tell the Effects editor which entry in which Array you want to deal with, and it will retreave, or store the number. Each Array must have a unique ID number with which to identify that Array. If you create a new Array with the same ID number as an existing Array, then the existing one will be over-written. You specify which number in the array you want with the offset number. This is how many entries after the first entry the number you're interested in is. This starts with 0 for the first entry, 1 for the second, 2 for the third etc. So for example in the array 0,5,10,15,20 - offset 2 is 10, offset 4 is 20. Arrays are usefull to store large amounts of data, or sequences of numbers.Each number in an array can be any whole number between -2147483648 and +2147483647.
There are times when you need to do something that depends on the current unit (eg in the Stardrive you want the doors to open for The Engineers units but not for the Seventh Brigade units), the current team, the current item, or the current position in the map. These start out set to certain values depending on which effect is being processed (eg before you move, the current unit is the unit moving, the current team is the unit's team, the current item is the item held by the unit, and the current position in the map is set to the square the unit is considering moving into). These values are not always set to start off with, and some of them can be changed by commands in the Effects editor. See the table below to know what these are set to initially when an Effect starts.
When the effects editor exits you can specify a value to return. Sometimes Laser Squad uses these values to decide what further actions might be needed. See the table below to know what the return value tells Laser Squad to do.
Effect | Initial current unit | Initial current Team | Initial current Item | Initial current position | Initial 1st on Stack | Return value |
Change Item | Current Unit | Current Unit's Team | Item to change to | Current Unit's position | Not Specified | 0=Allow change anything else=Stop change item |
Pick Up Item |
Current Unit | Current Unit's Team | Item to pick up |
Current Unit's position | Not Specified | 0=Allow pick up anything else=Stop pickup |
Drop Item | Current Unit | Current Unit's Team | Item currently held | Current Unit's position | Not Specified | 0=Allow drop anything else=Stop drop |
Unit Death | Unit Dieing | Dieing Unit's Team | Item held by Dieing Unit | Dieing Unit's position | Not Specified | Ignored |
Select Unit | Unit selected | Current Team (is team of shooting unit in opportunity fire) | Selected Unit's held item | Selected Unit's position | Not Specified | 0=Allow selection anything else=don't allow selection |
Pre Unit Move | Current Unit | Current Unit's Team | Current Unit's held item | Square considering moving into | 0 if unit moving forward, else 1 | 0=Allow Move anything else=don't allow move |
Weapon Impact | Shooting Unit | Shooting Unit's Team | Shooting Unit's held weapon | Square hit by shot | Not Specified | 0=Allow damage anything else=No damage |
Terrain Destroy | not set | not set | not set | Square of Terrain | Terrain being destroyed | 0=Allow destruction anything else=Stop destruction |
Item Destroy | not set | not set | Item being destroyed | Not Specified | 1 if stopping destruction possible. (Will be 0 if part of a unit, and loading ammo) | 0=Allow destruction anything else=Stop destruction |
Extra Option Requirements | Current Unit | Current Unit's Team | Current Unit's Item Held | Current Unit's position | Not Specified | 1=Allow Option anything else=Don't allow option. |
Extra Option Effects | Current Unit | Current Unit's Team | Current Unit's Item Held | Current Unit's position | Not Specified | Ignored |
Turn End | not set | Team who's turn is ending | not set | not set | Not Specified | Ignored |
Start Game | not set | not set | not set | not set | Not Specified | Ignored |
End Game | not set | not set | not set | not set | Not Specified | Total of the following: 1-Scenario Loaded 2-Change controls 4-Select players & level 8-Do Start Game 16-Do Equip and Deploy |
Table of initial Current Unit, Current Team, Current Item, Current position and the meaning of the vaule returned.
These are grouped into commands with similar or related effects. Int is programming slang for Integer (a whole number).
This command tells the Effects editor to finish and returns the value specified to the Laser Squad game.
This command tells the Effects editor to finish and returns the value on top of the stack to the Laser Squad game.
This command causes the game to quit. Once the specified message has been displayed Laser Squad will reset and ask you to pick a new scenario.
This command tells Laser Squad to finish the scenario and move to the Victory screen displayed when a game finishes.
This command tells the Effects editor to check if any team has reached 100 Victory points. If so then it will move to the Victory Screen and the game finishes. Otherwise this has no effect.
This command tells the Effects editor to pop the top two numbers on the stack and multiply them. It then pushes the result back onto the stack.
This command tells the Effects editor to pop the top number on the stack and multiply it by a supplied number. It then pushes the result back onto the stack.
This command pops the top number off the stack. It then pops the second value off the stack and divides the first by this number. The result is pushed onto the stack.
This command pops the top number off the stack and divides this by a specified number. It then pushes the result onto the stack.
This commands pops the top number off the stack and divides the specified number by this. The result is pushed onto the stack.
This command pops the top two numbers off the stack. It adds them and pushes the result back onto the stack.
This command pops the top number off the stack and adds the specified number to it. It then pushes the result back onto the stack.
This command pops the top number off ths stack and pops the second off the stack and subtracts the first from the second. The result is pushed onto the stack.
This command pops the top number off the stack and subtracts the specified number. The result is pushed back onto the stack.
This command pops the top number off the stack and subtracts it from the specified number. The result is pushed back onto the stack.
This command pops the top 2 values on the stack and divides the second on the stack by the first. The Remainder is then pushed back onto the stack.
This command pops the top value from the stack and divides it by the specified integer. The remainder is then pushed back onto the stack.
This command pops the top value from the stack and divides the specified number by it. The Remainder is then pushed back onto the stack.
This command performs a Binary AND between the popped top 2 items from the stack. The result is then pushed back onto the stack. To understand a binary AND you need to recognise that computers store numbers in binary bits. Binary is where numbers are handled in base 2. We are used to using Decimal (Base 10) where any digit of a number can have a value from 0 to 9 (10 different possible values). In Binary (base 2) each digit can have a value of 0 or 1 (2 different possible values). In Decimal the value of the right most digit are multiplied by 1, and each digit to the left is 10 times bigger than the one to the right (10, 100, 1000, 10000 ect). In Binary the right most digit is also multiplied by 1, and each digit to the left is 2 times bigger than the one to the right (2, 4, 8, 16, 32 ect). So 256 in Decimal is worth 2*100 + 5*10 + 6*1. In Binary 100101 is worth 1*32 + 0*16 + 0*8 + 1*4 + 0*2 + 1*1 (ie 37 in decimal).
Binary AND combines 2 binary numbers using logical AND which returns 1 only if both equivalent digits are 1 otherwise it will return 0. So if you do 100101 AND 111001 the result is 100001 (or 33 in binary). Remember that the Effects editor uses 32 binary digits to hold it's numbers (This is known as 32 bits). Any digits not shown are of value 0 (just like in decimal: 36 is the same as 00036).
This command performs a Binary AND on the top item popped from the stack and the supplied number. The Result is pushed onto the stack. Remember that the number is supplied in decimal even though the calculation takes place in binary. If you have trouble converting, most calculators have the ability to convert from binary to decimal and back again.
This command performs a Binary XOR between the popped 2 items from the stack. The result is then pushed back onto the stack.
Binary XOR combines 2 binary numbers using logical XOR which returns 1 if equivalent digits are different or 0 if they are the same. So if you do 100101 XOR 111001 the result is 011100 (or 28 in decimal).
This command performs a Binary XOR on the top item popped from the stack and the supplied number. The result is pushed back onto the stack.
This command performs a Binary OR between the popped top 2 items from the stack. The result is then pushed back onto the stack.
Binary OR combines 2 binary numbers using logical OR which returns 1 if either equivalent digit is 1 or 0 if they are both 0. So if you do 100101 OR 111001 the result is 111101 (or 61 in decimal).
This command performs a Binary OR on the top item popped from the stack and the supplied number. The result is pushed back onto the stack.
This command pops the top number from the stack and throws it away.
This command pushes a copy of the top number on the stack onto the stack.
This command swaps the top 2 items on the stack. The top item becomes the second from top and the 2nd from top becomes the top item.
This command clears all items from the stack.
This command sets the state flag to True, Zero, Equal. This has the same effect as if the last comparison had resulted in a True value, an Equal comparison or was Zero.
This command sets the state flag to False, Not Zero, Not Equal.
This command flips the state flag. If it is True then it becomes False. If it is False then it becomes True. The same is true of the Zero/Not Zero, and Equal/Not Equal.
This command checks what's at the current position. If the current position is valid and there is terrain at this position without a unit or item on it then it sets the state flag to True. Otherwise it sets it to False. This command is affected by the current Logic Mode.
This command checks what's at the current position. If the current position is valid and there is an item without a unit on it then it sets the state flag to True. Otherwise it sets it to False. This command is affected by the current Logic Mode.
This command checks what's at the current position. If the current position is valid and there is a unit on it then it sets the state flag to True. Otherwise it sets it to False. This command is affected by the current Logic Mode.
This commands sets the state flag depending on the value held in a generic flag. The flag number is poped from the stack. This command is affected by the current Logic Mode.
This command sets the state flag depending on the value held in the generic flag indicated by the specified number. This command is affected by the current Logic Mode.
This command sets True if the specified team is being controlled by a human player. This command is affected by the current Logic Mode.
This command sets True if the specified team is being controlled by the computer. This command is affected by the current Logic Mode.
This command sets True if the specified team has no more units. This command is affected by the current Logic Mode.
This command sets True if the specified team has units. This command is affected by the current Logic Mode.
This command sets True if the current position is on the map. This command is affected by the current Logic Mode.
This command sets True if the current unit is holding an item. The number of the generic item to check that is being held is poped from the stack. This command is affected by the current Logic Mode.
This command sets True if the current unit is holding the specified type of item. This command is affected by the current Logic Mode.
This command sets True if the current unit has a certain type of item in it's inventory. The number of the generic item is poped from the stack. This command is affected by the current Logic Mode.
This command sets True if the current unit has the specified type of item in it's inventory. This command is affected by the current Logic Mode.
This command sets True if the current unit is in play (ie it's not dead and has been deployed). This command is affected by the current Logic Mode.
This command sets True if the Current item is set to a valid item (the list of items in Laser Squad can contain empty slots. Use this command to check if you've selected one of these empty slots. This command is affected by the current Logic Mode.
This command sets True if the current item is valid and the current item can be used in Hand-to-Hand combat. This command is affected by the current Logic Mode.
This command sets True if the current item is valid and the current item can be shot. This command is affected by the current Logic Mode.
This command sets True if the current item is valid and the current item when fired will cause an explosion on impact. combat. This command is affected by the current Logic Mode.
This command sets True if the current item is valid and the current item can be primed. This command is affected by the current Logic Mode.
This command sets True if the current item is valid and the current item is ammo. This command is affected by the current Logic Mode.
This command sets True or False depending on the current unit's behaviour or abilities. You can specify which unit behaviour to check. This command is affected by the current Logic Mode.
This command sets True if an item of the type specified is at the current position. This command is affected by the current Logic Mode.
This command sets True if an item of the type poped from the stack is at the current position. This command is affected by the current Logic Mode.
This command sets the Logic Mode to AND. The next command that is affected by the current Logic Mode will use the True/False value it calculates and ANDs it with the True/False state to calculate the new True/False state. The Logic Mode is then reset back to normal (ie a command that sets True/False will ignore the current True/False value).
This command sets the Logic Mode to OR. Otherwise this is the same as Set Compare Mode to AND (See above).
This command sets the Logic Mode to NOT. Otherwise this is the same as Set Compare Mode to AND (See above).
This command compares the value on the top of the stack with 0. It sets Zero/Equal/True if the top value on the stack is 0, otherwise it sets Not Zero/Not Equal/False. The True/False state is affected by the current Logic Mode. It sets greater than if the value on the top of the stack is bigger than 0 and less than if it's less than 0.
This command is the same as Compare Stack with 0 but after comparing it will delete the top value on the stack.
This command is the same as Compare Stack with 0 but instead compares the top value on the stack with the 2nd on the stack rather than with 0.
This command is the same as Compare 1st on Stack with 2nd but after comparing it will delete the top value on the stack.
This command is the same as Compare Stack with 0 but instead compares the top value on the stack with the specified number rather than with 0.
This command is the same as Compare Stack with int but after comparing it will delete the top value on the stack.
This command sets Zero/Equal/True if the current is valid and the unit name is the same as the specified text, otherwise it sets Not Zero/Not Equal/False. The True/False state is affected by the current Logic Mode. Note that the text may have the new line command ("//") in it if it's more than one line for example "COMBAT//DROID-1".
This command is the same as Compare Stack with int but instead compares the top value on the stack with the number coresponding with the specified terrain type. In the Effects editor, references to terrain types are simply numbers. The terrain type's number can be calculated by it's position in the list of terrain types with the first terrain type being number 0. This means that was well as setting Zero/Equal/True, greater than and less than are set. The reason for this command over and above Compare Stack with Int are two fold: It's clear what you are comparing with and you don't have to worry about a Terrain type's number changing as you add or change terrains as the Editor adjusts for this.
This command is the same as Compare Stack with Terrain but after comparing it will delete the top value on the stack.
This command is the same as Compare Stack with Terrain but instead compares the top value on the stack with the number coresponding with the specified generic Item. In the Effects editor, references to Generic Items are simply numbers. The Generic Item's number can be calculated by it's position in the list of Generic Items with the first Generic Item being number 0.
This command is the same as Compare Stack with Generic Item but after comparing it will delete the top value on the stack.
This command is the same as Compare Stack with int but instead compares the top value on the stack with the number coresponding with the specified team. In the Effects editor, references to Teams are simply numbers. The Team's number can be calculated by it's position in the list of Teams with the first Team being number 0.
This command is the same as Compare Stack with Team but after comparing it will delete the top value on the stack.
This command compares the value on the top of the stack with the KeyCode of the specified key. Note that the KeyCode is not the same as the ASCII value for a key. This is used in conjunction with the Push Get Keypress command to see which key was pressed. The True/False state is affected by the current Logic Mode.
This command compares the value on the top of the stack with the KeyCode of the specified user-defined key (Up, Down, Left, Right, Fire). This is used in conjunction with the Push Get Keypress command to see which key was pressed. The True/False state is affected by the current Logic Mode.
This command tells the Effects editor to start executing the command at the specified line skipping any commands in-between.
This command tells the Effects editor to start executing the command at the specified line skipping any commands in-between if the state flags indicate that the current state is Zero/Equal/True.
This command tells the Effects editor to start executing the command at the specified line skipping any commands in-between if the state flags indicate that the current state is Not Zero/Not Equal/False.
This command tells the Effects editor to start executing the command at the specified line skipping any commands in-between if the state flags indicate that the current state is Greater Than.
This command tells the Effects editor to start executing the command at the specified line skipping any commands in-between if the state flags indicate that the current state is Less Than.
This command tells the Effects editor to start executing the command at the specified line skipping any commands in-between if the state flags indicate that the current state is Zero/Equal/True or is Greater Than.
This command tells the Effects editor to start executing the command at the specified line skipping any commands in-between if the state flags indicate that the current state is Zero/Equal/True or is Less Than.
This command pushes the specified number onto the stack.
This command pushes 0 onto the stack if the current state is Zero/Equal/True, otherwise it pushes 1.
This command pushes the value held in the counter, the number of which is popped from the stack.
This command pushes the value held in the specified counter.
This command pushes the Victory points of the specified team.
This command pushes the current turn number.
This command pushes the difficulty level of the game. Note that in a game where all the teams are controlled by humans, that the difficulty level will be 0.
This command pushes the X (horizontal) value of the current position.
This command pushes the Y (vertical) value of the current position.
This command pushes the number of the current unit onto the stack. Each unit will have a unique number. If the current unit is not set or set to an empty slot in the list of units in the game then the state flags are set to Not Zero/Not Equal/False.
This command pushes the number of the Terrain at the current position.
This command pushes the number of the Current Team.
This command pushes the number of slots in the list of units in the game. Note that this may be more than the number of actual units in the game as some of the slots might be empty. Also note that this may change as the number of units in the game increases.
This command pushes the specified atribute of the current unit. Victory Point Value, Morrale Value, and Rounds Until Forgotten first pop the team number for which you want the value. Patrol Route Way Points first pops the number of the Way point you want. Region Threat Value first pops the number of the region you're interested in. Terrains Want to Destroy first pops the index in the list of terrains that the unit wants to destroy.
This command pushes the specified atribute of the current item.
This command pushes the number of the unit with the specified name. It will push -1 if it can't find a unit with the specified name. Note that if the unit is dead it may return -1, and if the unit has been told to enter the game but has not yet turned up (ie it will turn up in a few rounds) then it can be found. Also note that the unit name may have the new line command ("//") in it if it's more than one line for example "COMBAT//DROID-1".
This command pushes a random number onto the stack. The number pushed will be between (and including) 0 and the number poped from the top of the stack.
This command pushes a random number onto the stack. The number pushed will be between (and including) 0 and the specified number.
This command pushes the number of the specified team. This is the same as the Push int command but will adapt the value as you add and remove teams.
This command pushes the number of the specified terrain. This is the same as the Push int command but will adapt the value as you add and remove terrains.
This command pushes the number of regions in a scenario.
This command pushes the value of the current time in miliseconds since 1st January 1970. Because this is a 64 bit number and the Effects editor uses 32 bits only the lower 32 bits of the number will be pushed, however this can still be used to calculate the amount of time elapsed since the last time this command was called (by subtracting the values).
This command pushes the number of slots in the list of items in the game. Note that this is not the same as the total number of items in the game as some slots may be empty. Also note that this can increase or decrease as the number of items in a game increases or decreases.
This command pushes the index of the current item in the list of items in the game. It will set the state flag to Zero/Equal/True if the current item has been set, and Not Zero/Not Equal/False if the current item has not been set.
The Effects editor's commands mostly deal with 16 bit number (-32768 to +32767). The Effects editor can handle 32 bit numbers (-2147483648 to +2147483647) and this command pushes a 32 bit number onto the stack.
This command pushes the KeyCode of the specified key onto the stack. Note that this is not the same as the ASCII code.
This command pushes the number of way-points used by the Artificial Inteligence.
This command pushes the length (in milliseconds) of the specified number onto the stack.
This command pushes the maximum number of turns for this scenario onto the stack.
This command pops the top number from the stack and sets the Victory Points of the specified team to this value.
This command pops the top number from the stack and sets the X (horizontal) value of the current position to this.
This command pops the top number from the stack and sets the Y (vertical) value of the current position to this.
This command pops the top number from the stack and sets the current unit to the unit indicated by the value in the unit list. Zero/Equal/True is set if the number indicates a valid unit, otherwise it is set to Not Zero/Not Equal/False.
This command pops the top number from the stack and sets the specified atribute of the current unit to that value. Note that Victory Point Value, Morrale Value, and Rounds Until Forgotten pop the team number before poping the new atribute vale. Patrol Route WayPoint first pops the waypoint number before poping it's new value. Region Threat value first pops the region number before poping it's new threat value. Terrains Want to Destroy first pops the number of the terrain in the terrain wants to destroy list before poping it's new value.
This command pops the top number from the stack and sets the specified atribute of the current item to this value.
This command pops the top number from the stack and sets the current item to the item in the item list indexed by this value. Zero/Equal/True is set if the item exests, and Not Zero/Not Equal/False is set if it points to an item that doesn't exist.
This command pops the top number from the stack and sets the scenario's Maximum number of turns to this value.
This command pops the top value. If it's 0 then it sets the flag to True, otherwise it sets the flag to False. The Flag number is calculated by poping the 2nd from the top.
This command pops the top number. It then sets the flag indicated by this value to the current Zero/Equal/True state flag.
This command sets the specified flag to the current Zero/Equal/True state flag.
This command sets counter number indicated by the second from the top on the stack to the value on top of the stack. It then pops those two values off the stack.
This command sets the specified counter to the value poped from the top of the stack.
This command adds one to the specified counter.
This command subtracts one from the specified counter.
This command sets the current position to that of the current unit.
This command sets the current unit's position to that of the current position.
This command sets the current position to the square faced by the current unit.
This command pops the top value from the stack. It then sets the current position to the position of the unit who's value was poped from the stack.
This command pops the top value from the stack. It then sets the position of the unit who's value was poped from the stack to the current position.
This command pops the top value from the stack. It then sets the current position to the position faced by the unit who's value was poped from the stack.
This command sets the current position to that of the current item.
This command sets the position of the current item to the current position.
This command sets the item held by the current unit as the current item. If the current unit isn't set or doesn't hold an item then the state flag is set to False.
This command makes the current unit hold the current item.
This command creates a new item of the specified generic type. It becomes the current item.
This command creates a new item of the generic type specified by the value poped from the stack. It then becomes the current item.
This command finds the first item at the current position and makes it the current item. It will set True if there is a valid item there, otherwise it sets False.
This command can be used after Current item to item at pos to find any further items at the current position. You can then repeatedly use this command to find more items. If there are no more items at the current position it will set False, otherwise it will set the curent item to the next item at the current position.
This command prints the specified text to the screen. See Text in Laser Squad to know what commands are possible.
This command allows you to show an animation at the current position. It allows you to specify the start terrain, and the final terrain by clicking on the terrain, and to edit the animation inbetween (clicking on the animation gives you an Animation window).
This command tells Laser Squad to re-display the map.
This command tells Laser Squad to re-display the map's border.
This command tells Laser Squad to refresh the screen. In modern operating systems just because you change what you want to display (by printing it) doesn't mean that it is shown on the screen! Use refresh to tell Laser Squad that the screen has changed to ensuse any changes are shown.
This command tells Laser Squad to show an error message, wait for up to 2 seconds and then move onto the next command. This is the same as the 'Not enough Action points" error message. It won't end the Effects editor.
This command tells Laser Squad to display and run a menu where the player can scroll through a list of options and select one option. Add or remove menu options using the relavent buttons in the editor. Use the text box to edit what Text the menu item displays. Please note that you must add a '//' at the end of the option to tell Laser Squad to move to the next line and you must set the colour with '/Q????' as the first part of the text. Laser Squad uses this to know what colour to flash the menu option as the cursor moves over it. See Text in Laser Squad for more information.
This command tells the Effects processor to pop the top value off the stack and print it on the screen.
This command tells the Effects processor print the name of the current unit on the screen.
This command tells the Effects processor print the name of the current item on the screen.
This command tells the Effects processor to print the name of the terrain specified by the value popped off the top of the stack.
This command tells Laser Squad to load a sound file into the specified sound number. Sounds 1 to 16 are system sounds. Load into these if you want to replace system sounds. Load into a value above 16 for your own extra sounds.
This command tells Laser Squad to play a sound already loaded. It will stop playing once the end of the sound is reached. You must specify the sound number to play. Note that Once the sound playback has started the Effects Processor will continue (it won't wait for the sound to finnish.
This command stops playing a sound. You must specify the sound number.
This command tells Laser Squad to play a sound already loaded. It will repeatedly play the sound. You must specify the sound number to play.
This command copies a sound from one number to another. This would be usefull to change a sound quickly by preloading it and then copying it. You could use it to emulate the Commodore 64 sound effects of a shortening sound as a unit walks by preloading all the values and then copying shorter and shorter sound files as the unit walks more.
This command tells Laser Squad to play a sound already loaded. It will not move on to the next command until the sound has finished playing.
This command tells Laser Squad reload a system sound (0 to 16). Use this if you've redefined a game sound and want to reset it.
This command tells Laser Squad that all units must be made visible on the map.
This command tells Laser Squad that all units must be made hidden on the map.
This command tells Laser Squad that the current unit should be made visible on the map.
This command tells Laser Squad that the current unit should be hidden on the map.
This command forces the game to wait for the specified number of 100ths of a second.
This command causes an explosion of the specified force at the current position.
This command causes an explosion of the specified force at the specified position.
This command changes the first specified terrain into the second terrain all over the map.
This command sets the underlying terrain at the current position to the specified terrain.
This command removes the current unit from the game.
This command checks if the current unit has enough action points. The specified number is used to divide the maximum Action points. If the unit doesn't have this many action points left then it displays the error message and then returns from the effects editor. The value it returns can also be specified.
This command adds a new unit to the game. The start round is relative to the current round. Otherwise the unit editor is the same as for the unit editor in the editor.
This command moves the current unit. You can specify if the unit changes direction, where you move to, if the unit gets Action Points deducted, and if a movement sound is made as the unit moves.
This command damages the current unit by the specified amount. You can also specify if the damage to the unit (ie the flashing and the sound) is displayed or not.
This command is the same as Damage unit by int but pops the amount of damage to apply off the stack.
This command sets the specified behaviour of the current unit to the True/False value in the state flag.
This command sets the current unit to be the unit at the current position. The state flag is set to True if there is a valid unit there, otherwise it is set to False.
This command tells the Effect editor to load a new scenario. The stack and state flags are unchanged, but everything else is (counters, general flags, items, terrains etc). The only place you ought to use this is in EndGame effect so that you can tell Laser Squad to start the new scenario by using the value returned from the Efects processor (also letting it know what other scenario set-up is still needed). If there is any information you need to carry over from one scenario to the other you ought to push it onto the stack before using this command and then popping it off the stack and updating the new scenario. The state flag is set to False if the command was unsucessful in loading the new scenario. You must specify which scenario file to load. You must only use the filename without the path and without the .class (so "C:\LaserSquad\NewScenario.class" would be "NewScenario").
This command tells the Effects editor return from a subroutine, or a call.
This command tells the Effects editor to go to the specified Subroutine, making a note of the position of the next command.
This command is the same as the Subroutine Jump Always command but only goes to the specified subroutine if the current state flag is Zero/Equal/True. Otherwise this command is ignored.
This command is the same as the Subroutine Jump Always command but only goes to the specified subroutine if the current state flag is Not Zero/Not Equal/False. Otherwise this command is ignored.
This command is the same as the Subroutine Jump Always command but only goes to the specified subroutine if the current state flag is Greater Than. Otherwise this command is ignored.
This command is the same as the Subroutine Jump Always command but only goes to the specified subroutine if the current state flag is Less Than. Otherwise this command is ignored.
This command is the same as the Subroutine Jump Always command but only goes to the specified subroutine if the current state flag is Zero/Equal/True or is Greater Than. Otherwise this command is ignored.
This command is the same as the Subroutine Jump Always command but only goes to the specified subroutine if the current state flag is Zero/Equal/True or is Less Than. Otherwise this command is ignored.
This command tells the Effects editor to return from a subroutine, or a call if current state flag is Zero/Equal/True. Otherwise this command is ignored.
This command tells the Effects editor to return from a subroutine, or a call if current state flag is Not Zero/Not Equal/False. Otherwise this command is ignored.
This command tells the Effects editor to return from a subroutine, or a call if current state flag is Greater Than. Otherwise this command is ignored.
This command tells the Effects editor to return from a subroutine, or a call if current state flag is Less Than. Otherwise this command is ignored.
This command tells the Effects editor to return from a subroutine, or a call if current state flag is Zero/Equal/True or Greater Than. Otherwise this command is ignored.
This command tells the Effects editor to return from a subroutine, or a call if current state flag is Zero/Equal/True or Less Than. Otherwise this command is ignored.
This command tells the Effects editor to go to the named Routine, making a note of the position of the next command so that on comming across a Return command it knows where to return to.
This command is the same as the Subroutine Call Always command but only goes to the named routine if the current state flag is Zero/Equal/True. Otherwise this command is ignored.
This command is the same as the Subroutine Call Always command but only goes to the named routine if the current state flag is Not Zero/Not Equal/False. Otherwise this command is ignored.
This command is the same as the Subroutine Call Always command but only goes to the named routine if the current state flag is Greater Than. Otherwise this command is ignored.
This command is the same as the Subroutine Call Always command but only goes to the named routine if the current state flag is Less Than. Otherwise this command is ignored.
This command is the same as the Subroutine Call Always command but only goes to the named routine if the current state flag is Zero/Equal/True or is Greater Than. Otherwise this command is ignored.
This command is the same as the Subroutine Call Always command but only goes to the named routine if the current state flag is Zero/Equal/True or is Less Than. Otherwise this command is ignored.
This command creates a new Array. You can either set the Array's unique ID number, or pop the ID number from the top of the stack. If an Array with this ID number already exists, it is replaced with the new Array. The length of the Array created by this command can again be set, or can be popped from the stack. The length of the Array can be from 1 to 2147483647. If both the ID number and length are being popped from the stack, the ID is popped first, then the length.
This command creates a new Array just like Create Empty Array. You can either set the Array's unique ID number, or pop the ID number from the top of the stack. The Array size is typed into the 'Array Size' box. Changing this value changes the size of the Array being edited, either adding zeros to the end, or truncating values beyond the new length of the Array. The 'Array Data' box lists the elements of the array and the values they hold. By changing the 'Element Value', you can change the value of the element currently selected in the 'Array Data' box. You could create an entire Array full of data like this, but it is slow and laborious - better for editing an existing array. Use the 'Load Array Data' button to select a tab, space, or new-line delimited data file. Most Spreadsheets will save off data in this format. This is a much faster way to load data. The Array will be automatically set to the length of the data in the data file.
This command will delete the array with the Defined ID number. It's not strictly speaking nescessay to delete Arrays you no longer need, but will save memory.
This is the same as the Delete Defined Array command, but pops the ID of the Array to delete from the top of the stack.
This command will copy data from one array to another (or even the same array). You need to specify the Arrays to copy from and to. You also need to specify the offset (how far into the array to start copying or writing). Lastly you need to specify how much data to copy. All these values can be either set, or popped from the stack. The order that the values will be popped from the stack (if they are being popped) is From Array ID, then From offset, then To Array ID, then To offset, and lastly Amount to copy.
This command will set an element in an Array to the value you desire. You can either set, or pop the ID of the Array you want to change. The Position of the element (or the offset), and the Value to which to set the element can either be popped off the stack, set, or retrieved from a Counter. The order that the values will be popped from the stack (if they are being popped) is Array ID, then position, and then value.
This command will get a value from an Array and push it onto the stack. You can either set, or pop the ID of the Array you want to change. The Position of the element (or the offset) can either be popped off the stack, set, or retrieved from a Counter. The order that the values will be popped from the stack (if they are being popped) is Array ID, and then position.
This command increments the value held by an element of an Array (ie it adds one to it). The Array number, and Position behave like the Get Array Value command.
This command is the same as the Increment Array value command, except that the value held by an element is reduced by one.
This command will push the size of the defined Array onto the top of the stack.
This command will pop the ID of the Array you are interested in from the top of the stack. It will then push the size of this array back onto the top of the stack.
All the above can be a little difficult to comprehend so here are some examples to show you how the Effects processor can be used to implement special effects in Laser Squad.
You want a randomly deployed mine-field, and you want the number of mines to depend on how difficult you've chosen to play the scenario. I mentioned early on that you could use the counters to hold the positions of the mines. The down-side to this is that these counters then would not be available for other jobs and you are limited to 25 mines (two counters per mine to hold the X and Y positions). An easier way is to have a special terrain that looks and behaves identical to whatever terrain you want to mine. Lets say there is "ground" in the area you want to mine. Simply copy the "ground" terrain so you now have two terrains called ground. They will both look the same, and both have the same characteristics (move cost, strength etc), but Laser Squad references them by their number in the list of terrains and so can tell the difference. For the sake of clarity we'll call the origional ground Terrain A, and the copy Terrain B. We'll make it so that Terrain B will explode if you step on it. We want to place the mines in an area 10 squares by 10 squares, the top left of which is at X position 4 and the Y position is 10.
Firstly you need to calculate where you want your mines. The logical place to put this is in the Start Game Effect that gets run after you've chosen your level but before any unit gets to move. Here goes the code.
Command | Comments | |
0 | Push:Difficulty | Find out how difficult a game the player/players have selected. |
1 | Compare:Stack with 0 | This tests to see if we're in an all human game. You want some mines even if there is no computer controlled team. This will set the state flag to True/Zero/Equal if we are in an all human player game. |
2 | Jump:if Not Zero/Not Equal/False (to 4) | Skip the commands that set how many mines to have in a 2 player game. |
3 | Add:1st on stack to Int (2) | The top item on the stack will be 0 (the difficulty of an all human player game). This changes the top value to 2. (You could equally have used push 2.) |
4 | Multiply:Stack with int (2) | This command multiplies the difficulty by 2 to get the number of mines we want. We now have 4 for a 2 player game, 2 for a level 1 game, 4 for a level 2 game, 6 for a level 3 game, etc. |
5 | Compare:Stack with 0 | Test how many more mines we need to place. To start off with this will be Not Equal/False but as we loop back to this point and decrease the number of mines left to place it will eventually be Equal/True |
6 | Jump:if Not Zero/Not Equal/False (to 8) | Skip the next command if there are still mines to place on the map. If there are no mines left to place it moves into the next command. |
7 | Exit Processor:Return value (0) | This command exits the processor. As it's the Start Game Effect the return value is ignored. |
8 | Push:Random (int) (9) | This pushes a random number onto the stack. The area we want to place the mines into is 10 wide. As the random number generator generates numbers up to and including the specified value, specifying 9 ensures 10 different posibilities (0,1,2,3,4,5,6,7,8,9). |
9 | Add:1st on Stack to Int (4) | This adds 4 (the left border of the mine-field) to the random number, giving us a random X position. |
10 | Push:Random (int) (9) | This pushes a random number onto the stack for use in generating the Y position. |
11 | Add:1st on Stack to Int (10) | This adds 10 (the left border of the mine-field) to the random number, giving us a random Y position. |
12 | Pop:Current position Y | This takes the top value off the stack and sets the current position's Y value. The random X value is now on top of the stack. |
13 | Pop:Current position X | This takes the top value off the stack and sets the current position's X value. The number of mines left is now on top of the stack. |
14 | Push:Terrain at Current position | This pushes the terrain at our randomly selected position onto the stack. |
15 | Compare:Stack with terrain, delete (Terrain A) | This checks what terrain we have at our randomly selected position. If there is any other terrain in the area that can be mines (grass for example), or the terrain has already been mined (and has Terrain B there) this command will set the state flag to Not Equal. Deleting the top value ensures that the number of mines left is on top of the stack. |
16 | Jump:if Not Zero/Not Equal/False (to 8) | Go back and pick another random square if the one picked is unsuitable. Note that you need to ensure that there will have to be enough squares to hold all the mines you want to place, what's more as you're relying on random chance to find the empty squares, if the number of Terrain A squares is the same or close to the number of mines to place it can take the computer a while to get there by guesswork and you may have to add extra code to get round this, but for now let's keep this as simple as possible. |
17 | Change Terrain:Set Terrain at current position (to Terrain B) | Set the randomly selected terrain to be the mined ground. |
18 | Subtract:1st on Stack - Int (1) | Deduct 1 from the number of mines left to place on the map. |
19 | Jump:Always (to 5) | Go back and check how many mines there are to place and place them or finish the Start Game Effect |
You've now got a random mine-field. All you need to do now is to check if anyone is unlucky enough to step on one. The way to do this is to check in the Pre Unit Move Effect as this is called every time a unit moves. It is run before a unit is moved rather than afterwards as you may want to stop a unit from moving. By using the Move Unit command you can move the unit during the effect and then do the explosion all in the effect.
Command | Comment | |
0 | Push:Terrain at Current position | This will push the number of the terrain about to be stepped onto. Remember that in the Pre Movement Effect that the current position is set to the square that the unit is considering moving into. |
1 | Compare:Stack with terrain (Terrain B) | Check to see if the unit is stepping onto a mined piece of ground. |
2 | Jump:if Zero/Equal/True (to 4) | Move to the commands that deal with the explosion if the unit is about to step on a mine. |
3 | Exit Processor:Return value (0) | Leave the Effects processor. The return value of 0 indicates that the move can go ahead as far as the Effects processor is concerned. This might still be stopped if the terrain can't be entered by the unit because of the unit's terrain band for example. |
4 | Unit:Move Unit (Facing unchanged, Move destination relative to Proposed square, X move by: 0, Y move by: 0, Deduct Action Point Cost, Make move noise) |
Because we need the unit to move during the effect rather than wait for the effect to end (so the explosion happens after the move and not before) do the move now. The X and Y move by values are 0, but then that's relative to the square the unit's about to move into. |
5 | Explosion:Do Explosion at current position (100) | Kaboom! |
6 | Change Terrain:Set Terrain at current position (to Terrain A) | The mine has exploded, so it won't explode again. Change the terrain to the un-mined ground to ensure this. |
7 | Exit Processor:Return value (2) | Leave the Effect processor. As the move has happened tell Laser Squad not to move the unit again by returning 2. |
You want a weapon that stuns a unit rather than damaging them. You could even add extra commands to check the unit's type so that robots are not affected, or that units are stunned for differing lengths of time depending on their strength, but for now let's keep it simple. You could use the counters to keep track of how long a unit is stunned for, but this would limit you to 50 units. Another way around the problem is to use the unit's user defined flags. This is actually a 32 bit number (giving you 32 bits of which for other reasons only the lower 16 are usable). You can use this to hold a number if you want, and this has the advantage of allowing you to have more than 50 units. To make sure that the value of the user defined flags is set to 0 you must make sure that none of the unit's user defined flags are set in the editor. However, to demonstrate how you would use the number of units in a game and the number of a unit to set the current unit and how to deal with empty slots in the unit list I'll set the unit user defined flags in the Start Game Effects. The same methods can be used to check items in the game's list of items.
Command | Comments | |
0 | Push:Int (0) | We need to keep track of which unit number to check. |
1 | Push:Max Number Of Units | How many slots there are in the list of units. |
2 | Compare:1st on Stack with 2nd, delete | Compare current unit number with the maximum number of units. Then delete the number of unit slots so that the current unit number is the top of the stack again. |
3 | Jump:if Not Zero/Not Equal/False (5) | Skip the command exiting the Start Game Effects if the Effects processor hasn't looked at all the units. |
4 | Exit Processor:Return value (0) | Leave the Effect processor. |
5 | Manipulate Stack:Duplicate 1st on stack | The next command will pop the value of the current unit off the stack and thus remove it from the stack. By copying it only the copy of the number will be removed during the next command. |
6 | Pop:Current unit number | This command pops the copy of the current unit number and sets the current unit to the unit in Laser Squad's list of units. If the entry specified is empty of contains a dead unit then the state flag will be set to False. |
7 | Jump:if Not Zero/Not Equal/False (10) | Skip setting the user defined flags if have an invalid unit and move to the commands to move to the next unit. |
8 | Push:Int (0) | Put the value you want to set the User Defined Flag to on the stack ready for the next command. |
9 | Pop:Unit attribute (User Defined Flags) | Pop 0 off the stack and put it into the current unit unit's User Defined Flags. |
10 | Add:1st on stack to Int (1) | Increase the number of the current unit to the next unit. |
11 | Jump:Always (to 1) | Move back to see if you've gone through all the units in Laser Squad's unit list. |
You ought to adapt the weapon so that it stuns rather than damages a unit. Use the Weapon Impact Effect of the weapon you want to use as a stun gun to do this.
Command | Comments | |
0 | TRUE/FALSE:Current position is Unit | In the Weapon Impact effect the current position is initially set to the square that the unit has hit with the weapon. This command checks to see if you've hit a unit (as opposed to a terrain or an item). |
1 | Jump:If Zero/Equal/True (to 3) | If you've hit a unit then skip the code that exits the Weapon Impact Effect. |
2 | Exit Processor:Return int (1) | Leave the editor indicating that it doesn't do any damage (I want it so that a stun gun doesn't cause any damage to anything). |
3 | Push:current turn number | The unit hit will be stunned for 4 turns. Push the current turn number as part of calculating the turn number that a unit becomes un-stunned. |
4 | Add:1st on stack to Int (4) | Calculate the turn number 4 turns from now. |
5 | Unit:Current unit to unit at pos | Make the current unit the unit that you've just hit. There's no need to check the state flag to see if it was sucessful as we know there must be a unit there (you would not have got to this code unles the Jump at position 2 had found out that you've hit a unit). |
6 | Pop:Unit attribute (User Defined Flags) | This pops the value held on the top of the stack (the round that a unit becomes un-stunned) and sets the unit's User defined flag value to that. |
7 | Display:Message ("/K/I") | Clear the right side of the screen and set the print position to the top left of the right side of the screen. |
8 | Display:Current Unit Name | Print the name of the unit that has been shot. |
9 | Display:Message ("//HAS BEEN//STUNNED") | Print the message "has been" on the line below the unit name, and stunned on the line below this. |
10 | Display:Refresh | Tell the processor to refersh the screen to ensure that the message is printed to the screen. |
11 | Wait:Wait (200) | Wait for 2 seconds. |
12 | Exit Processor:return int (1) | Leave the editor indicating that it doesn't do any damage (I want it so that a stun gun doesn't cause any damage to anything). |
Finaly you need to make sure that a stunned unit can't be selected, so you need to put this in the Select Unit Effect.
Command | Comments | |
0 | Push:unit atribute (User Defined Flags) | Stack the turn that the unit becomes unstunned. |
1 | Push:current turn number | What turn we're currently on. |
2 | Compare:1st on Stack with 2nd | See if we've moved beyond the turn that the unit becomes unstunned. |
3 | Jump:if Less Than (to 5) | If we haven't reached the turn that the unit becomes unstunned then skip telling Laser Squad that can select the current unit. |
4 | Exit Processor:Return int (0) | Exit the Effect processor indicating that can select the current unit. |
5 | Display:Message "/K/I" | Clear the right side of the screen, move the print position to the top left of the right side of the screen. |
6 | Display:Current Unit name | Print the name of the current unit. |
7 | Display:Message "//IS//STUNNED" | Move to the next line down after the unit name, print "IS", move to the next line down and print "STUNNED". |
8 | Display:Refresh | Ensure that the altered part of the screen is displayed. |
9 | Wait:Wait (200) | Wait for 2 seconds. |
10 | Exit Processor:Return int (1) | Indicate that the unit the player is attempting to select can't be selected. |
You want to allow units to dis-arm a primed grenade. The counter on a grenade is held in the ammo variable. Un-primed grenades have the counter set to 65535, and primed grenades have the ammo variable set to the number of segments until the grenade goes off.
As this is an action that a unit can do using the Extra Menu Options in the scenario sheet is the apropriate way to implement this. Click on the Add New Option button and then type "/Q0D0D/TDIS-ARM//GRENADE/U" into the menu option title text box. This will set the menu text to bright cyan. Most menu items are double height but there's no reason why it has to be so long as the menu item doesn't take up more than a line of double height text. I could have made it simply dis-arm but this way shows off the posibilities available to you. The /T sets the print mode to normal height text and the /U sets it back to double height text.
Then use the Edit Requirements button to define what needs to be true for the dis-arm option to appear in the menu.
Command | Comments | |
0 | TRUE/FALSE:Current Item is valid | The current Item is set to the item held by the current unit. This will test to see if the unit is holding anything. |
1 | Jump::if NOT ZERO/NOT EQUAL/FALSE (to 8) | If the unit holds no item or there is some other problem with the item then jump to the line that exits telling Laser Squad that the option is not allowed. |
2 | TRUE/FALSE:Current Item is primable | Check to see if the unit is holding a grenade. |
3 | Jump::if NOT ZERO/NOT EQUAL/FALSE (to 8) | If the unit is not holding a grenade then exit the processor indicating that the option is not allowed. |
4 | Push:Large Number (65535) | Although the processor can handle numbers between -2147483648 and +2147483647 because of the way information is stored most commands where numbers are specified directly can only use numbers between -32768 and +32767. As we need to compare with 65535 we must use this command to put this larger than normal number onto the stack. |
5 | Push:Item Attribute (Ammo) | This pushes the item's ammo attribute onto the stack (which for a primable item is 65535 if not primed or is the number of segments until it explodes). |
6 | Compare:1st on Stack with 2nd | This compares the grenade's prime value with 65535. |
7 | Jump::if NOT ZERO/NOT EQUAL/FALSE (to 9) | If the grenade's prime value is not 65535 (in other words it has been primed) jump to the line that exits the processor indicating that the option is allowed. |
8 | Exit Processor:Return int (0) | Leave the effects processor indicating that the dis-arm option is not available. |
9 | Exit Processor:Return int (1) | Leave the effects processor indicating that the dis-arm option is available. |
Now that Laser Squad knows if the extra menu option is allowed or not we need to tell it what happens when someone chooses the option.
Use the Edit Effects button to define what happens.
Command | Comments | |
0 | Unit:Check Has Action Points (Fraction 2, return 0) | Check to see if the unit has half it's unburdoned action points available (disarming a grenade should not be easy). The return value is not used. |
1 | Push:Large Number (65535) | Put 65535 onto stack (remember this is the value that indicates that a grenade is not primed). |
2 | Pop:Item Atribute (Ammo) | Put 65535 into the current unit's held item's ammo variable setting the grenade to un-primed. We don't need to check to see if the unit is holding anything and if it is a grenade because we could not get to this effect without the Extra Menu Option requirements Effect returning 1 so we know that the unit must be holding a grenade. |
3 | Exit Processor:Return int (0) | Leave the effects processor. |