- Joined
- Jul 27, 2005
- Messages
- 22
TaaZ's ITEM SYSTEM
Well, I know some of you have been looking for a decent item system that lets people only use one weapon at a time or one armor, or whatever, so this tutorial was produced from being bored.
This tut might give you beginners more knowledge with triggers and/or variables.
What you need:
-----------------------------------------------------------
First and foremost, we are going to start with a few variables...
If you are going to have 5 players in your map that cant pick up two weapons (I'll be using weapons as an example) then you need 5 variables.
I named my variables
These variables need to be boolean and false as default
Lets get started on the triggers...
Make a trigger called "Only1Weapon1"
And another trigger called "Able2PickUpAfterDrop1"
NOTE: these triggers will be for player 1 red
Go into the trigger Only1Weapon1 and create a new Event:
Now create a few Actions, this is what it should look like after I explain some of it:
First make an if/then/else Action.
This helps it when a unit picks up an item, if the unit already has a weapon it wont pick up the new weapon.
Now for the If - Conditions you need to make:
Now we got that down we need to make a Then - Action this is what it should be:
Now for the Else - Actions you need another if/then/else.
After you make another if/then/else in the else action you now make some If - Conditions.
now for the Then - Actions you make the following action
and tells it what to do with a weapon if the unit is not able to pick it up, also a little user friendly text message that informs the owner of the unit trying to pick up 2 weapons that you can only wield one weapon at a time.
in the Else - Action create another if/then/else action.
For the If - Conditions in the newly created if/then/else, do this:
Now for the Then - Actions:
And in the Else - Actions:
Now lets get to that second trigger. "Able2PickUpAfterDrop1"
Create an Event:
To use this trigger for all 5 players you need to use different variables and more triggers. EX: Player 2 blue's trigger - One1Weapon2, P2 Blues Variable - Only1Weapon2
Credits: World Editor (Of course )
Written by TaaZ
Well, I know some of you have been looking for a decent item system that lets people only use one weapon at a time or one armor, or whatever, so this tutorial was produced from being bored.
This tut might give you beginners more knowledge with triggers and/or variables.
What you need:
- A. Basic Knowledge of the Object Editor
B. Basic Knowledge of Variables
C. Basic Knowledge of the Trigger Editor
-----------------------------------------------------------
First and foremost, we are going to start with a few variables...
If you are going to have 5 players in your map that cant pick up two weapons (I'll be using weapons as an example) then you need 5 variables.
I named my variables
- Only1Weapon1
Only1Weapon2
Only1Weapon3
Only1Weapon4
Only1Weapon5
These variables need to be boolean and false as default
Lets get started on the triggers...
Make a trigger called "Only1Weapon1"
And another trigger called "Able2PickUpAfterDrop1"
NOTE: these triggers will be for player 1 red
Go into the trigger Only1Weapon1 and create a new Event:
- Unit - A unit owned by Player 1 (Red) Acquires an item
Now create a few Actions, this is what it should look like after I explain some of it:
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Item-class of (Item being manipulated)) Equal to Artifact
- Only1Weapon1 Equal to False
-
Then - Actions
- Set Only1Weapon1 = True
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Item-class of (Item being manipulated)) Equal to Artifact
- Only1Weapon1 Equal to True
-
Then - Actions
- Trigger - Turn off able to pick up after drop1 <gen>
- Item - Move (Item being manipulated) to (Position of (Triggering unit))
- Game - Display to Player Group - Player 1 (Red) the text: You can only wield ...
- Wait 0.01 seconds
- Trigger - Turn on able to pick up after drop1 <gen>
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Item-class of (Item being manipulated)) Equal to Artifact
- Only1Weapon1 Equal to False
-
Then - Actions
- Set Only1Weapon1 = True
-
Else - Actions
- Do nothing
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
First make an if/then/else Action.
This helps it when a unit picks up an item, if the unit already has a weapon it wont pick up the new weapon.
Now for the If - Conditions you need to make:
- (Item-class of (Item being manipulated)) Equal to Artifact
- Only1Weapon1 Equal to False
Now we got that down we need to make a Then - Action this is what it should be:
- Set Only1Weapon1 = True
Now for the Else - Actions you need another if/then/else.
After you make another if/then/else in the else action you now make some If - Conditions.
- (Item-class of (Item being manipulated)) Equal to Artifact
- Only1Weapon1 Equal to True
now for the Then - Actions you make the following action
-
Then - Actions
- Trigger - Turn off able to pick up after drop1 <gen>
- Item - Move (Item being manipulated) to (Position of (Triggering unit))
- Game - Display to Player Group - Player 1 (Red) the text: You can only wield one weapon at a time.
- Wait 0.01 seconds
- Trigger - Turn on able to pick up after drop1 <gen>
and tells it what to do with a weapon if the unit is not able to pick it up, also a little user friendly text message that informs the owner of the unit trying to pick up 2 weapons that you can only wield one weapon at a time.
in the Else - Action create another if/then/else action.
For the If - Conditions in the newly created if/then/else, do this:
- (Item-class of (Item being manipulated)) Equal to Artifact
- Only1Weapon1 Equal to False
Now for the Then - Actions:
- Set Only1Weapon1 = True
And in the Else - Actions:
- Do nothing
Now lets get to that second trigger. "Able2PickUpAfterDrop1"
Create an Event:
- Unit - A unit owned by Player 1 (Red) Loses an item
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Item-class of (Item being manipulated)) Equal to Artifact
- Only1Weapon1 Equal to True
-
Then - Actions
- Set Only1Weapon1 = False
- Wait 0.01 seconds
-
Else - Actions
- Set Only1Weapon1 = False
-
If - Conditions
To use this trigger for all 5 players you need to use different variables and more triggers. EX: Player 2 blue's trigger - One1Weapon2, P2 Blues Variable - Only1Weapon2
Credits: World Editor (Of course )
Written by TaaZ
Last edited: