• 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.

Reloading

Status
Not open for further replies.
Level 6
Joined
Feb 16, 2014
Messages
193
So in my map i want it to be that u can only reload 1 gun at a time will this work? and have i removed all the leaks?
  • Reload PGM II
    • Events
      • Player - Player 1 (Red) types a chat message containing pg2 as An exact match
      • Player - Player 2 (Blue) types a chat message containing pg2 as An exact match
      • Player - Player 3 (Teal) types a chat message containing pg2 as An exact match
      • Player - Player 4 (Purple) types a chat message containing pg2 as An exact match
      • Player - Player 5 (Yellow) types a chat message containing pg2 as An exact match
      • Player - Player 6 (Orange) types a chat message containing pg2 as An exact match
      • Player - Player 7 (Green) types a chat message containing pg2 as An exact match
      • Player - Player 8 (Pink) types a chat message containing pg2 as An exact match
      • Player - Player 9 (Gray) types a chat message containing pg2 as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing pg2 as An exact match
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Is_Reloading Equal to 0
        • Then - Actions
          • Set Is_Reloading = 1
          • Game - Display to Players[(Player number of (Triggering player))] the text: Reloading PG Mark II...
          • Wait 2.50 seconds
          • Set Is_Reloading = 0
          • Game - Display to Players[(Player number of (Triggering player))] the text: PG Mark II Reloaded...
          • Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Actions)
            • Loop - Actions
              • Item - Set charges remaining in (Item carried by (Picked unit) of type PG Mark II) to 25
              • Custom script: set bj_wantDestroyGroup = true
        • Else - Actions
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,220
  • Custom script: set bj_wantDestroyGroup = true
put that above the unitgroup.

  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Actions)
    • Loop - Actions
Hopefully that'll fix it but I can't promise it x)

edit: also some minor stuff.
1. don't use a integer to check if reloading is in progress, use a boolean, it's a little better and more logical to use.
2. use variables for stuff you use many times, in your case triggering player.

Also a note, your code is not MPI, which means that it wont work for more than one player at once.
 
Level 6
Joined
Feb 16, 2014
Messages
193
  • Custom script: set bj_wantDestroyGroup = true
put that above the unitgroup.

  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Actions)
    • Loop - Actions
Hopefully that'll fix it but I can't promise it x)

edit: also some minor stuff.
1. don't use a integer to check if reloading is in progress, use a boolean, it's a little better and more logical to use.
2. use variables for stuff you use many times, in your case triggering player.

Also a note, your code is not MPI, which means that it wont work for more than one player at once.
How do i make it to work for multiple players at once?
 
Level 6
Joined
Feb 16, 2014
Messages
193
You should use abilities instead of forcing the players to type pg2 everytime.

Or the chat will look like this:

pg2
pg2
pg2
pg2
pg2
pg2
pg2
But if i use ablities how will that all fit in when the player's unit also have abilities(like grenades or other things) but a player can have 6 weapons at a time(items),though is there any way that when a player types something(like pg2) then it will not send the message? (so the chat wont be flooded with messages)
 
Level 25
Joined
May 11, 2007
Messages
4,650
I don't know how your firing system works, but if they can have 1 equipped weapon you reload that weapon.

Or they could have multiple weapons but need to switch to the one they want to use and then you reload that gun.
Please don't use chat commands, it's going to annoying to use. Especially in a firefight.
 
Level 6
Joined
Feb 16, 2014
Messages
193
I don't know how your firing system works, but if they can have 1 equipped weapon you reload that weapon.

Or they could have multiple weapons but need to switch to the one they want to use and then you reload that gun.
Please don't use chat commands, it's going to annoying to use. Especially in a firefight.
But in my map its gonna have lots of weapons PG2(Plasma Gun 2),PG1 ,Barrett M82,Rockets and many more,so if 2 players are fighting,if 1 of there guns runs out of ammo they can use another one,
Though i like that idea problem is i dont know how to do it :vw_death:
EDIT: i think i'll try to make a dummy unit and everytime a player buys an weapon for that certain unit then that item gets stored into the inventory of the dummy unit then everytime a player uses an ability then a weapon on the inventory of that dummy unit is given to the player and the current weapon on the player's unit inventory gets given to the dummy unit.Its a bit challenging for me but i think i can do it :D
 
Last edited:
Status
Not open for further replies.
Top