Staredit Network

Staredit Network -> UMS Assistance -> Question About Random Battles
Report, edit, etc...Posted by Leingod on 2005-08-04 at 02:23:37
Ok look....I am working on a RPG but i want the battle system to be random

More Thoroughly: Player walks around and about every 5 seconds get sent into a Battle Arena to fight, kills the enemy then gos back to the location where it was

I already set the trigger to follow the players unit wherever it gos, but the rest of it, i cant really get to work

Here are The Triggers


Trigger
Description:
Safe Switch
Players:
¤ Player 1
Conditions:
¤ Always
Actions:
¤ Set "Safe Switch - P1"


This is the Safe switch


Trigger
Description:
Set Random Battles
Players:
¤ Player 1
Conditions:
¤ "Safe Switch - P1" is Set
¤ Player 1 brings atleast 1 any unit to "Location Follow - P1"
¤ Player 1 brings atmost 0 any unit to "Battle Arena"
Actions:
¤ Wait 5000 miliseconds
¤ Randomize " Battle Enemy Type 1"
¤ Preserve Trigger


The switch battle enemy type 1 is called type 1 because I want to set this switch a couple times so the enemy will be different everytime they engage in a battle, so its not just, battle zerglings - win....battle zerglings - win....battle zerglings - win


Trigger
Description:
Random Battle Start
Players:
¤ Player 1
Conditions:
¤ "Battle Enemy Type 1" is Set
¤ Player 1 Brings atleast 1 any unit to "Location Follow - P1"
¤ Player 1 Brings atmost 0 any unit to "Battle Arena"
Actions:
¤ Clear Switch "Safe Switch - P1"
¤ Play WAV. - Battle Music
¤ Teleport all any unit owned by Player 1 at "Location Follow - P1" to "Battle Arena - Player"
¤ Center view at "Battle Arena Player
¤ Create 2 Zerglings at Battle Arena Enemy
¤ Create 2 Broodlings at Battle Arena Enemy
¤ Clear Switch "Battle Enemy Type 1"
¤ Preserve Trigger


These are all the triggers that happen when you are suppose to have the battle


Trigger
Description:
End Battle
Players:
¤ Player 1
Conditions:
¤ Switch"Battle Enemy Type 1" is Cleared
¤ Player 1 Brings atleast 1 any unit to "Battle Arena"
¤ Player 8 Brings atleast 0 any unit to "Battle Arena"
Actions:
¤ modify deaths counts for Player 8 to 0 for unit "Zergling"
¤ modify deaths counts for Player 8 to 0 for unit "Broodling"
¤ Teleport all any unit owned by Player 1 at "Battle Arena" to "Location Follow - P1"
¤ Play WAV.- Victory
¤ Preserve Trigger


But it doesnt work exactly right....?

I got these trigger from the example map from the site, and i just copied the triggers...so why dont they work?
Report, edit, etc...Posted by pimpinelephant on 2005-08-04 at 03:27:27
what exactly is your problem? can you please post where the problem is, like where specifically does it not work?

try this:
(Location = location that follows unit)
(Location2 = location that centers on flag)

C:
Always
A:
Center location on unit
Preserve trigger

C:
Switch 1 is cleared
Player brings at least 1 unit to location
Player brings at most 0 to battle arena
A:
Wait 5000 ms
Randomize switch 1
Preserve Trigger

C:
Switch 1 is Set
Player brings at least 1 unit to location
Player brings at most 0 unit to battle arena
A:
Create flag at location
Center location2 on flag
Move unit to battle arena
Create X enemy units at battle arena
Preserve trigger

C:
Enemy player suffers X deaths of enemy unit
A:
Set deaths of enemy unit for enemy player to 0
Remove flag at location2
Move unit to location2
Clear switch 1
Preserve trigger
Report, edit, etc...Posted by Neiji on 2005-08-04 at 11:50:02
Woah, that "What is your problem" looked very mean, but you meant problem as in the question...
Maybe you should only do the random battle random switches when the battle is not set?
Report, edit, etc...Posted by DaMiNaToR on 2005-08-04 at 12:00:14
Don't make the location center on the player while he's in battle, becase you want him to teleport back to where he was before the battle.

And also, you have to make sure it's not trying to create multiple battles at once, that could cause problems.

Finally, make it freeze before the battle starts, let it get set up for a few seconds, then teleport the hero into the battle. Same with the end of the battle.
Report, edit, etc...Posted by PCFredZ on 2005-08-04 at 12:35:02
Also, are you using Hyper Triggers? If so, you shouldn't use Wait actions for the randomizer.
Report, edit, etc...Posted by Kingra on 2005-08-04 at 12:54:39
Just some suggestions:

Instead of centering on the hero unit, have a burrowed unit that you can center the location on instead.
It would be neat to random time between encounters.

Not really helping with the problem, I guess others have already solved it.
Report, edit, etc...Posted by Urmom(U) on 2005-08-04 at 19:28:19
try this

Trigger
Conditions:
¤ Switch Follow is cleared
Actions:
¤ Move location Follow on hero
¤ Preserve Trigger


Trigger
Conditions:
¤ Safe Switch is cleared
¤ Player brings at least 1 men to Follow
¤ Player brings exactly 0 men to Battle Arena
¤ Foes bring exactly 0 men to battle arena
Actions:
¤ Wait 5000 MS
¤ Randomize Battle Switch
¤ Set Randomize Glitch
¤ Preserve Trigger


Trigger
Conditions:
¤ Player brings exactly 0 men to Battle Arena
¤ Player brings at least 1 men to Follow
¤ Safe Switch is cleared
¤ Foes bring at least 1 men to Battle Arena
Actions:
¤ Set Safe Switch
¤ Set Follow
¤ Move all hero for player to Battle Arena
¤ Center View at Battle Arena
¤ Play Music
¤ Preserve Trigger


Trigger
Conditions:
¤ Randomize Glitch is Set
¤ Randomize is cleared (do one for set too with different units)
Actions:
¤ Create 2 Zerglings at Battle Arena for enemy
¤ Create 2 Broodlings for Enemies at Battle Arena
¤ Clear Switch Randomize Glitch
¤ Preserve Trigger



null
Trigger
Conditions:
¤ Player brings at least 1 men to Battle Arena
¤ Foes bring exactly 0 men to battle Arena
Actions:
¤ Clear Follow
¤ Clear Safe Switch
¤ Move all hero for player to Follow
¤ Preserve Trigger


I may have messed up but its kind of hard making it out of your head in this format and not being able to test. But i think it should work. Im not sure what safe switch is for so i threw it in but if it doesnt work u can get rid of that switch.
Next Page (1)