- Joined
- Feb 20, 2007
- Messages
- 843
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:
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 ?
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
-
If - Conditions
- 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 - Conditions
-
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 - Conditions
-
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 - Conditions
-
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 - Conditions
-
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 - Conditions
-
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 - Conditions
-
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 - Conditions
-
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 - Conditions
-
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 - Conditions
-
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
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (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 - Conditions
-
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 - Conditions
-
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 - Conditions
-
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 - Conditions
-
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 - Conditions
-
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 - Conditions
-
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 - Conditions
-
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 - Conditions
-
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 - Conditions
-
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
-
If - Conditions
-
If - Conditions
- Trigger - Turn off (This trigger)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
-
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
-
If - Conditions
- 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
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
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
Last edited: