• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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,183
  • 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,651
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