• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Reload system(im stuck)

Status
Not open for further replies.
Level 4
Joined
May 31, 2011
Messages
85
Hey,
I was searching through the forums for fire/reload system i found some stuff and tried to put them in my map, did exactly as it was but i got few problems.
1. The Unit problem
- The unit equals to marine, therefor i need a unit on the map to select
this is problem to me because i use units from tavern, and im stuck at making it work, if i put "sold unit" instead of marine it doesnt work
2. Reload fails duo to i dont know
- The unit on the map fires 20 rounds and then stops, so i though, hey i need reload ability but got no clue how to make it nor attach it with the trigger or something.

I don't want answers that will solve the problem, tips please i want to learn this for my self.

this is the system:
Map Initialization
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Ammo = 20
      • Set Reloading = False
      • -------- Reloading is requered --------
Attack
  • Attacking
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacking unit) Equal to Marine 0022 <gen>
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Ammo Equal to 0
        • Then - Actions
          • Unit - Order Marine 0022 <gen> to Stop
          • Trigger - Run Reload <gen> (checking conditions)
        • Else - Actions
          • Set Ammo = (Ammo - 1)
Reload
  • Reload
    • Events
    • Conditions
      • Reloading Equal to True
    • Actions
      • Set Reloading = True
      • Wait 3.00 seconds
      • Set Ammo = 5
      • Set Reloading = False
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
For the condition (check whether unit is a marine), you'll have to use a unit TYPE comparison.

  • Conditions
    • (Unit-type of (Triggering unit)) Equal to Marine
The reloading doesn't work because the condition is wrong. The condition should be "Reloading equal to false".
Right now you're saying "If the unit is reloading, start reloading" - but the unit isn't reloading, thus he can never start reloading either.
 
Level 4
Joined
May 31, 2011
Messages
85
For the condition (check whether unit is a marine), you'll have to use a unit TYPE comparison.

  • Conditions
    • (Unit-type of (Triggering unit)) Equal to Marine
The reloading doesn't work because the condition is wrong. The condition should be "Reloading equal to false".
Right now you're saying "If the unit is reloading, start reloading" - but the unit isn't reloading, thus he can never start reloading either.

i've made the modifications but what about at order stop unit
 
Level 4
Joined
May 31, 2011
Messages
85
hey i fixed it, it supposed to be "attacking unit" equals to marine same for order to attacking unit to stop
will this cause any bugs or this only affects the marines ?


EDIT: now i want to bring it to next level like reloading only with ability?
can u help?
 
Level 4
Joined
Apr 9, 2011
Messages
84
Excuse me, but doesn't the condition in "Reload" actually say "If Reload = true, set Reload = true". But at Map Initalization you set Reloading = false, and you don't set it back to true again?
 
Level 4
Joined
May 31, 2011
Messages
85
Excuse me, but doesn't the condition in "Reload" actually say "If Reload = true, set Reload = true". But at Map Initalization you set Reloading = false, and you don't set it back to true again?

i dont know, im newbie, it works as it is :))
 
Status
Not open for further replies.
Top