HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

machine Gun spell how to?

04-26-2007, 09:52 PM#1
barryburton
Hello, I've got question... I made a handgun spell work fine, but i cant make a machine gun spell.

For example, I want it to keep shooting until the person runs out of ammo (charges on a item), but I have no idea how to do this :S

And when I try, it does nothing, absolutely nothing, no matter what I try.... :( I just cant think of what else I could do; does any one know how or who who could help?
04-27-2007, 01:15 AM#2
Pyrogasm
I would assume you're using GUI, so here's a vague outline of a solution:

When a unit starts its "Machine gun" spell, add it to a unit group; let's call it MachineGunGroup. Then, set up a periodic trigger that looks like this:
Trigger:
Collapse Events
Time - Every 0.20 seconds of Game-time
----- 0.20 is the interval for bullets -----
Conditions
Collapse Actions
Collapse Unit Group - Pick every unit in MachineGunGroup and do (Actions)
Loop - Actions
Collapse For each (Integer A) from 1 to 6, do (Actions)
Collapse Loop - Actions
Set TempItem = (Item carried by (Picked unit) in slot (Integer A))
If ((Item-type of TempItem) Equal to Tome of Experience) then do (Set MachineGunBullets = TempItem) else do (Do nothing)
Collapse If (All conditions are true) then do (then actions) else do (else actions)
Collapse If - Conditions
MachineGunBullets not equal to (No item)
Collapse Then - Actions
Set MachineGunBullets equal to (No item)
Item - Set charges remaining in (MachineGunBullets) to ((Charges remaining in (MachineGunBullets)) - 1)
----- Do your handgun actions here for each unit, except change it so that it looks like how you want the machine gun spell to look/act -----
Collapse Else - Actions
Unit Group - Remove (Picked Unit) from MachineGunGroup
This is, of course, asuming that you're not using a timer for your Handgun trigger.

If that's the case, you should post your trigger(s) for that here.
04-27-2007, 08:28 PM#3
barryburton
ok ill give it a shot thanks

If ((Item-type of TempItem) Equal to Tome of Experience) then do (Set MachineGunBullets = TempItem)
K got stuck here what is the machinegunbullets? the item?

also whats tempitem im guessing another variable.
04-29-2007, 01:10 PM#4
barryburton
I hate to bump but its been a few days.
04-29-2007, 03:22 PM#5
blu_da_noob
Borderline, but meh.

MachineGunBullets and TempItem are both global item variables.
04-29-2007, 10:23 PM#6
Pyrogasm
Sorry, I was gone, and blu_da_noob is correct: they are both item variables.