• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Shooter, switching weapons

Status
Not open for further replies.
I'm trying to make a shooter game and the only challinge left is the switching weapon command!
When the game starts, you have two units:
1-the unit which will shoot, walk, ect. (Solgier)
2-the unit which tells the other unit to shoot and swich weapons. (Controller)
You cant select the solgier. The weapons are items. The controller carryes all weapons, whitout the one that is being used.
I made a very long trigger, sameting like that:
  • Shotgun1
    • Events
      • Unit - A unit enters Shotgun1 <gen>
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (((Triggering unit) has an item of type Shotgun) Equal to False) and (((Random unit from (Units owned by (Owner of (Triggering unit)) of type Archmage)) has an item of type Shotgun) Equal to False)
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Random unit from (Units owned by (Owner of (Triggering unit)) of type Paladin)) has an item of type Rocketeer) Equal to True
            • Then - Actions
              • Unit - Add Rocketeer (switch) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Archmage))
              • Unit - Remove Rocketeer from (Random unit from (Units owned by (Owner of (Triggering unit)) of type Paladin))
            • Else - Actions
          • Unit - Order (Random unit from (Units owned by (Owner of (Triggering unit)) of type Paladin)) to drop (Item carried by (Random unit from (Units owned by (Owner of (Triggering unit)) of type Paladin)) in slot 1) at (Position of (Random unit from (Units owned by (Owner of (Triggering unit)) of type Paladin)))
          • Wait 0.50 seconds
          • Item - Move (Last dropped item) to (Position of (Random unit from (Units owned by (Owner of (Triggering unit)) of type Archmage)))
          • Wait 0.50 seconds
          • Hero - Give (Last dropped item) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Archmage))
          • Wait 0.50 seconds
          • Hero - Give Shotgun 0006 <gen> to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Paladin))
          • Unit - Add Shotgun to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Paladin))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 1 (Red)
            • Then - Actions
              • Set S_Ammo01 = (S_Ammo01 + 50)
              • Player - Set Player 1 (Red) Current lumber to S_Ammo01
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 2 (Blue)
            • Then - Actions
              • Set S_Ammo02 = (S_Ammo02 + 50)
              • Player - Set Player 2 (Blue) Current lumber to S_Ammo02
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 3 (Teal)
            • Then - Actions
              • Set S_Ammo03 = (S_Ammo03 + 50)
              • Player - Set Player 3 (Teal) Current lumber to S_Ammo03
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 4 (Purple)
            • Then - Actions
              • Set S_Ammo04 = (S_Ammo04 + 50)
              • Player - Set Player 4 (Purple) Current lumber to S_Ammo04
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 5 (Yellow)
            • Then - Actions
              • Set S_Ammo05 = (S_Ammo05 + 50)
              • Player - Set Player 5 (Yellow) Current lumber to S_Ammo05
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 6 (Orange)
            • Then - Actions
              • Set S_Ammo06 = (S_Ammo06 + 50)
              • Player - Set Player 6 (Orange) Current lumber to S_Ammo06
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 7 (Green)
            • Then - Actions
              • Set S_Ammo07 = (S_Ammo07 + 50)
              • Player - Set Player 7 (Green) Current lumber to S_Ammo07
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 8 (Pink)
            • Then - Actions
              • Set S_Ammo08 = (S_Ammo08 + 50)
              • Player - Set Player 8 (Pink) Current lumber to S_Ammo08
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 9 (Gray)
            • Then - Actions
              • Set S_Ammo09 = (S_Ammo09 + 50)
              • Player - Set Player 9 (Gray) Current lumber to S_Ammo09
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 10 (Light Blue)
            • Then - Actions
              • Set S_Ammo10 = (S_Ammo10 + 50)
              • Player - Set Player 10 (Light Blue) Current lumber to S_Ammo10
            • Else - Actions
        • Else - Actions
          • Item - Remove Shotgun 0006 <gen>
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 1 (Red)
            • Then - Actions
              • Set S_Ammo01 = (S_Ammo01 + 50)
              • Player - Set Player 1 (Red) Current lumber to S_Ammo01
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 2 (Blue)
            • Then - Actions
              • Set S_Ammo02 = (S_Ammo02 + 50)
              • Player - Set Player 2 (Blue) Current lumber to S_Ammo02
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 3 (Teal)
            • Then - Actions
              • Set S_Ammo03 = (S_Ammo03 + 50)
              • Player - Set Player 3 (Teal) Current lumber to S_Ammo03
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 4 (Purple)
            • Then - Actions
              • Set S_Ammo04 = (S_Ammo04 + 50)
              • Player - Set Player 4 (Purple) Current lumber to S_Ammo04
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 5 (Yellow)
            • Then - Actions
              • Set S_Ammo05 = (S_Ammo05 + 50)
              • Player - Set Player 5 (Yellow) Current lumber to S_Ammo05
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 6 (Orange)
            • Then - Actions
              • Set S_Ammo06 = (S_Ammo06 + 50)
              • Player - Set Player 6 (Orange) Current lumber to S_Ammo06
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 7 (Green)
            • Then - Actions
              • Set S_Ammo07 = (S_Ammo07 + 50)
              • Player - Set Player 7 (Green) Current lumber to S_Ammo07
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 8 (Pink)
            • Then - Actions
              • Set S_Ammo08 = (S_Ammo08 + 50)
              • Player - Set Player 8 (Pink) Current lumber to S_Ammo08
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 9 (Gray)
            • Then - Actions
              • Set S_Ammo09 = (S_Ammo09 + 50)
              • Player - Set Player 9 (Gray) Current lumber to S_Ammo09
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 10 (Light Blue)
            • Then - Actions
              • Set S_Ammo10 = (S_Ammo10 + 50)
              • Player - Set Player 10 (Light Blue) Current lumber to S_Ammo10
            • Else - Actions
      • Trigger - Turn off (This trigger)
The swich trigger:

  • Switch Rocketeer
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Rocketeer (switch)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Random unit from (Units owned by (Owner of (Casting unit)) of type Paladin)) has an item of type Shotgun) Equal to True
        • Then - Actions
          • Unit - Add Shotgun (switch) to (Random unit from (Units owned by (Owner of (Casting unit)) of type Archmage))
          • Unit - Remove Shotgun from (Random unit from (Units owned by (Owner of (Casting unit)) of type Paladin))
        • Else - Actions
      • Unit - Order (Random unit from (Units owned by (Owner of (Casting unit)) of type Archmage)) to Stop
      • Unit - Order (Random unit from (Units owned by (Owner of (Casting unit)) of type Paladin)) to drop (Item carried by (Random unit from (Units owned by (Owner of (Casting unit)) of type Paladin)) in slot 1) at (Position of (Random unit from (Units owned by (Owner of (Casting unit)) of type Paladin)))
      • Wait 0.50 seconds
      • Item - Move (Last dropped item) to (Position of (Random unit from (Units owned by (Owner of (Casting unit)) of type Archmage)))
      • Wait 0.50 seconds
      • Hero - Give (Last dropped item) to (Random unit from (Units owned by (Owner of (Casting unit)) of type Archmage))
      • Unit - Order (Random unit from (Units owned by (Owner of (Casting unit)) of type Archmage)) to drop (Item carried by (Random unit from (Units owned by (Owner of (Casting unit)) of type Archmage)) of type Rocketeer) at (Position of (Random unit from (Units owned by (Owner of (Casting unit)) of type Archmage)))
      • Wait 0.50 seconds
      • Item - Move (Last dropped item) to (Position of (Random unit from (Units owned by (Owner of (Casting unit)) of type Paladin)))
      • Wait 0.50 seconds
      • Hero - Give (Last dropped item) to (Random unit from (Units owned by (Owner of (Casting unit)) of type Paladin))
      • Unit - Remove Rocketeer (switch) from (Random unit from (Units owned by (Owner of (Casting unit)) of type Archmage))
      • Unit - Add Rocketeer to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Paladin))
      • Player - Set (Owner of (Casting unit)) Current lumber to 1000000000
I attached the map if anyone requests it
The solgier there is the paladin and the controller is the archmade.
To move the solgier use the arrow keys.

The problem is that the archmade does't resiveves the previos wepon.

Btw: i'm open for sugestions for diferent swich system.
If this does't works i will make it whit dialog buttons.
Or is there a way to control the paladin in any way, exept to move it whit your mouse ?
 

Attachments

  • q2.w3x
    121.5 KB · Views: 75
Last edited:
Level 5
Joined
Sep 13, 2007
Messages
33
Dark Hunter1357, please copy your trigger correctly so it would be readable. In it's current format it is very hard to understand what's happening.
You can do this by right clicking on the trigger and selecting "copy as text" and then pasting it here, wrapped with trigger tag.

If you would do this, I would be more than happy to help you. :)
 
Status
Not open for further replies.
Top