duderock101
Check out my 2 Player Co-op RPG!
- Reaction score
- 71
Ammo System by Duderock101
Introduction
You need a good ammo system for any zombie survival maps where you fight with guns. Or maybe you’re making a battle map where you fight with guns. I don’t mind but this system will teach you how to create an ammo system effectively that will work for multiplayer as well as single player. All you need is very limited or higher knowledge of the Variable editor and a basic knowledge of the trigger editor that most who use the WE should have. So let’s get started? What will this ammo system give us?
A unit attacks with a gun and needs ammo (gold). The unit gets ammo from clips (lumber). Run out of gold you use lumber, run out of gold and lumber then you don’t fire, easy and simple.
Triggers
Ok first of all we need to create a variable. I am afraid to say that this system will only work for one unit per player. Now create a unit variable called Main_Unit, it must be array and set the array number to the amount of players that will be controlling an ammo using unit. My map will be having 3 players that control 3 ammo using units so I set the array to 3.
Here is the trigger –
Ok now to the attacking trigger, we need it to be that when a unit attacks that requires ammo the gold is taken off the right player. If you try and attack and you don’t have any gold you will automatically reload that will pause the firing unit for 4 seconds, you don’t reload instantly in real life now do you? And if you have no lumber the action will stop the unit from dealing any damage.
Here is the trigger –
Now final trigger is a manual reload. When the designated player clicks the ESC key and if you have lumber then you will pause the unit and reload the weapon using up 1 lumber. Now if you have bullets and you reload you have to take out the clip you already have in your weapon, that also means throwing away any bullets you haven’t used as well I’m afraid so if you use esc key and you have a full clip you still will use up 1 lumber. You could always create a condition yourself if you wanted to I supposed. So for the last time
Here is the trigger –
Thanks for reading this and I hope its helped you greatly. These triggers are the basic bone for you to edit yourself so go ahead and edit them if you feel you must. A map will be added shortly unless it’s already there.
Q&A
Q - Why are there not any screen shots?
A - Such a simple system and you still want screen shots? You can tell what it’s supposed to do can’t you?
Q – I thought I was asking the questions?
A – You seem to be at the moment.
Q – It doesn’t work for me! DIS TUT IS SH*T COS IT DON'T W0RK!!!!
A – Oh do shut up, it’s probably because you rushed too soon for your little 5 year old mind to cope. This tut is self explanatory basically, if you can’t get it then you obviously can’t read English.
Q – What does explanatory mean?
A - … Q&A session over…
Introduction
You need a good ammo system for any zombie survival maps where you fight with guns. Or maybe you’re making a battle map where you fight with guns. I don’t mind but this system will teach you how to create an ammo system effectively that will work for multiplayer as well as single player. All you need is very limited or higher knowledge of the Variable editor and a basic knowledge of the trigger editor that most who use the WE should have. So let’s get started? What will this ammo system give us?
A unit attacks with a gun and needs ammo (gold). The unit gets ammo from clips (lumber). Run out of gold you use lumber, run out of gold and lumber then you don’t fire, easy and simple.
Triggers
Ok first of all we need to create a variable. I am afraid to say that this system will only work for one unit per player. Now create a unit variable called Main_Unit, it must be array and set the array number to the amount of players that will be controlling an ammo using unit. My map will be having 3 players that control 3 ammo using units so I set the array to 3.
Here is the trigger –
Code:
set vars
Events
Map initialization
Conditions
Actions
Set Main_Unit[1] = Marine 0000 <gen>
Ok now to the attacking trigger, we need it to be that when a unit attacks that requires ammo the gold is taken off the right player. If you try and attack and you don’t have any gold you will automatically reload that will pause the firing unit for 4 seconds, you don’t reload instantly in real life now do you? And if you have no lumber the action will stop the unit from dealing any damage.
Here is the trigger –
Code:
Attacking
Events
Unit - A unit Is attacked
Conditions
(Owner of (Attacking unit)) Not equal to (!=) Player 12 (Brown)
(Owner of (Attacking unit)) Not equal to (!=) Player 11 (Dark Green)
Actions
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Attacking unit)) Current gold) Greater than or equal to (>=) 1
Then - Actions
Player - Set (Owner of (Attacking unit)) Current gold to (((Owner of (Attacking unit)) Current gold) - 1)
Else - Actions
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Attacking unit)) Current lumber) Greater than or equal to (>=) 1
Then - Actions
Unit - Pause (Attacking unit)
Player - Set (Owner of (Attacking unit)) Current gold to 50
Player - Add -1 to (Owner of (Attacking unit)) Current lumber
Game - Display to (Player group((Owner of (Attacking unit)))) for 4.00 seconds the text: Reloading
Wait 4.00 seconds
Unit - Unpause (Attacking unit)
Else - Actions
Unit - Order Main_Unit[(Player number of (Owner of (Attacking unit)))] to Stop
Now final trigger is a manual reload. When the designated player clicks the ESC key and if you have lumber then you will pause the unit and reload the weapon using up 1 lumber. Now if you have bullets and you reload you have to take out the clip you already have in your weapon, that also means throwing away any bullets you haven’t used as well I’m afraid so if you use esc key and you have a full clip you still will use up 1 lumber. You could always create a condition yourself if you wanted to I supposed. So for the last time
Here is the trigger –
Code:
Reloading
Events
Player - Player 1 (Red) skips a cinematic sequence
Player - Player 2 (Blue) skips a cinematic sequence
Player - Player 3 (Teal) skips a cinematic sequence
Player - Player 4 (Purple) skips a cinematic sequence
Player - Player 5 (Yellow) skips a cinematic sequence
Player - Player 6 (Orange) skips a cinematic sequence
Player - Player 7 (Green) skips a cinematic sequence
Player - Player 8 (Pink) skips a cinematic sequence
Player - Player 9 (Gray) skips a cinematic sequence
Player - Player 10 (Light Blue) skips a cinematic sequence
Player - Player 11 (Dark Green) skips a cinematic sequence
Player - Player 12 (Brown) skips a cinematic sequence
Conditions
((Triggering player) Current lumber) Greater than or equal to (>=) 1
Actions
Unit - Pause Main_Unit[(Player number of (Triggering player))]
Player - Set (Triggering player) Current gold to 50
Player - Add -1 to (Triggering player) Current lumber
Game - Display to (Player group((Triggering player))) for 4.00 seconds the text: Reloading
Wait 4.00 seconds
Unit - Unpause Main_Unit[(Player number of (Triggering player))]
Thanks for reading this and I hope its helped you greatly. These triggers are the basic bone for you to edit yourself so go ahead and edit them if you feel you must. A map will be added shortly unless it’s already there.
Q&A
Q - Why are there not any screen shots?
A - Such a simple system and you still want screen shots? You can tell what it’s supposed to do can’t you?
Q – I thought I was asking the questions?
A – You seem to be at the moment.
Q – It doesn’t work for me! DIS TUT IS SH*T COS IT DON'T W0RK!!!!
A – Oh do shut up, it’s probably because you rushed too soon for your little 5 year old mind to cope. This tut is self explanatory basically, if you can’t get it then you obviously can’t read English.
Q – What does explanatory mean?
A - … Q&A session over…