| 07-19-2004, 07:08 AM | #1 |
What I want is a trigger that checks if a variable (MiningXP) has gone past 200, 400, 600, etc.. If it has, then display a message saying your level (MiningLevel) and setting it to that level. (Well put the set level in front so it shows correctly.) And I need it done in a SIMPLE trigger (integer As and Bs, anyone?) that I can impliment easily. I don't have anything to offer but rep--first one to give me something efficient gets as much as I can spare for the day. EDIT: This is the trigger to get you a feel of it: Code:
Mine Tin
Events
Unit - A unit Begins casting an ability
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Destructible-type of (Target destructible of ability being cast)) Equal to Unidentified Ore (Copper)
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MiningLevel[(Player number of (Owner of (Casting unit)))] Greater than or equal to 0
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 2) Equal to 1
Then - Actions
Hero - Create Copper Ore and give it to (Casting unit)
Set MiningXP[(Player number of (Owner of (Casting unit)))] = ((50 / MiningLevel[(Player number of (Owner of (Casting unit)))]) + 5)
Game - Display to (Player group((Owner of (Casting unit)))) the text: (You have mined some copper ore. XP Gained: + (String((MiningLevel[(Player number of (Owner of (Casting unit)))] / (50 + 10)))))
Else - Actions
Player Group - Add (Owner of (Casting unit)) to Player
Game - Display to Player the text: You failed to mine ...
Player Group - Remove all players from (All players)
Else - Actions
Player Group - Add (Owner of (Casting unit)) to Player
Game - Display to Player the text: If your seeing this...
Player Group - Remove all players from (All players)
Else - Actions
Also, see that where it works and shows you the amount of XP you get? Well whenever I place the Set Variable trigger before anything there, it doesn't appear! Why is this happening? I can't figure it out. |
| 07-19-2004, 07:26 AM | #2 |
Something like this? Code:
Mining level
Events
Time - Every 2.00 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MiningXP Greater than or equal to 200.00
Then - Actions
Game - Display to Player Group - Player 1 (Red) the text: Your mining level has reached level 1
Hero - Set level to 1
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MiningXP Greater than or equal to 400
Then - Actions
Game - Display to Player Group - Player 1 (Red) the text: Your mining level has reached level 2
Hero - Set level to 2
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MiningXP Greater than or equal to 600
Then - Actions
Game - Display to Player Group - Player 1 (Red) the text: Your mining level has reached level 3
Hero - Set level to 3
Trigger - Turn off Mining Level
Else - ActionsThe trigger to turn off mining level can be moved to the action in the highest mining level to stop the trigger. This is a basic trigger and needs work. |
| 07-19-2004, 07:29 AM | #3 | |
Quote:
No, unfortunately that wouldn't work--I am planning to make the mining levels go up way high, and I can't do that repetetive trigger unless I'm desperate. Thanks anyways. Also, it doesn't change the hero level but a variable by +1, but that doesn't matter as I could of just changed it on my own. |
| 07-19-2004, 07:31 AM | #4 |
Actually, try this one, its three different triggers but its simple Code:
Mining XP1
Events
Time - Every 2.00 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MiningXP Greater than or equal to 200.00
Then - Actions
Game - Display to Player Group - Player 1 (Red) the text: Your mining level has reached level 1.
Hero - Set level to 1
Trigger - Turn off Mining XP1
Else - ActionsCode:
Mining XP2
Events
Time - Every 2.00 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MiningXP Greater than or equal to 400.00
Then - Actions
Game - Display to Player Group - Player 1 (Red) the text: Your mining level has reached level 2.
Hero - Set level to 2
Trigger - Turn off Mining XP2
Else - ActionsCode:
Mining XP3
Events
Time - Every 2.00 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MiningXP Greater than or equal to 600.00
Then - Actions
Game - Display to Player Group - Player 1 (Red) the text: Your mining level has reached level 3
Hero - Set level to 3
Trigger - Turn off Mining XP3
Else - Actions |
| 07-19-2004, 07:32 AM | #5 | |
Quote:
You want the mining level to go way high? Just a quick question, is the mining exp and the mining level actual levels or exp of units, or is it just a variable? If they are just variables, this would be a lot simpler. One last thing, how is the mining exp gained??? |
| 07-19-2004, 07:40 AM | #6 | |
Quote:
MiningXP is raised by simply mining--look at my first post, if you look you can see the formula to earning XP. Also, MiningXP and MiningLevel are just variables. |
| 07-19-2004, 10:26 AM | #7 |
Here's an example with linear progression of skill: Mining XP1 Events Time - Every 2.00 seconds of game time Conditions Actions If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions MiningXP Greater than or equal to (real(HeroLevel x 200)) + 200.00 Then - Actions Game - Display to Player Group - Player 1 (Red) the text: Your mining level has reached level (string((level of hero) + 1)). Hero - Set level to (level of hero) + 1 Else - Actions |
