- Joined
- Jun 8, 2010
- Messages
- 283
Hey guys, Ive made a simple bullet system before in an old map but this time im trying to use a bullet system that incorporates item charges rather than using both gold and lumber as the clip and ammunition.
Anyhow, each item or weapon has a different amount of bullets in the clip (charges). So a shot gun would only have about 8-12 bullets where as an assault rifle would have something like 180.
So to define exactly what kind of gun the hero has I defined it like so:
1) The weapon attachment does not appear when you "Add the Ability" to the unit when the user clicks on it. I could easily just make the ability as an item ability and attach that to the m16 item, but then it would automatically equip the weapon. What I want exactly is the user manually selecting which gun to choose by clicking on it, thus giving our hero the appropriate weapon attachment.
So with that trigger, we must also define when to remove the ability with the following trigger:
To top it all, we have the final problem with the actual subtraction of the charges.
Could someone help me out with this? I really dont know whats going on.
Best Regards,
Atmosferic
ps. A similar system can be found on the map I Am Legend if ever need to look for references.
Anyhow, each item or weapon has a different amount of bullets in the clip (charges). So a shot gun would only have about 8-12 bullets where as an assault rifle would have something like 180.
So to define exactly what kind of gun the hero has I defined it like so:
-
m16
-
Events
-
Unit - A unit Uses an item
-
-
Conditions
-
(Item-type of (Item being manipulated)) Equal to M16 Assault Rifle (Charged/Active)
-
-
Actions
-
Unit - Add M16 Armor Bonus to (Hero manipulating item)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Owner of (Hero manipulating item)) Equal to Player 1 (Red)
-
-
Then - Actions
-
-------- Equip(1) = Player One (Red) --------
-
Set activegun[EQUIP[1]] = (Item being manipulated)
-
-
Else - Actions
-
Do nothing
-
-
-
-
1) The weapon attachment does not appear when you "Add the Ability" to the unit when the user clicks on it. I could easily just make the ability as an item ability and attach that to the m16 item, but then it would automatically equip the weapon. What I want exactly is the user manually selecting which gun to choose by clicking on it, thus giving our hero the appropriate weapon attachment.
So with that trigger, we must also define when to remove the ability with the following trigger:
-
drop m16
-
Events
-
Unit - A unit Loses an item
-
-
Conditions
-
(Item-type of (Item being manipulated)) Equal to M16 Assault Rifle (Charged/Active)
-
-
Actions
-
Unit - Remove M16 Armor Bonus from (Hero manipulating item)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Owner of (Hero manipulating item)) Equal to Player 1 (Red)
-
-
Then - Actions
-
-------- Equip(1) = Player One (Red) --------
-
Set activegun[EQUIP[1]] = No item
-
-
Else - Actions
-
Do nothing
-
-
-
-
To top it all, we have the final problem with the actual subtraction of the charges.
-
Attack Charged
-
Events
-
Unit - A unit Is attacked
-
-
Conditions
-
((Unit-type of (Attacking unit)) is A Hero) Equal to True
-
((Owner of (Attacking unit)) controller) Equal to User
-
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Charges remaining in activegun[EQUIP[1]]) Greater than 0
-
-
Then - Actions
-
Player - Add -1 to (Owner of (Attacking unit)) Current lumber
-
-
Else - Actions
-
Unit - Order (Attacking unit) to Stop
-
-
-
-
Could someone help me out with this? I really dont know whats going on.
Best Regards,
Atmosferic
ps. A similar system can be found on the map I Am Legend if ever need to look for references.