Submit your own Starcraft Map Making Tutorials/Tips/Tricks/Help!

Lwek

Member!
Joined
May 18, 2003
Messages
4,487
Reaction score
0
Website
www.Battleforums.com
Please submit any of your Starcraft Map Making Tutorials/Tips/Tricks/Help in this thread or by PM to Lwek.

Anything is appreciated, however, not all of your submissions will make it to the Official Starcraft Map Making Tutorials/Tips/Tricks/Help thread.
 

Bolt Head

Member!
Joined
May 20, 2003
Messages
1,194
Reaction score
0
Website
www.shadowfortress.net
Wrote this Last July

Random Triggers.

LESSON ONE:
The first thing you need to know about random triggers is they require switches. When you randomize trigger you take advantage of the randomize switch action. If you do not understand switches I suggest figure that out before continuing. When you randomize a switch the state (clear or set) of the switch is randomly determined. The current state of the switch doesn’t matter, it will be ether set or clear 50/50 chance.

When your creating a random effect first thing you need to ask yourself is “How many different things can happen?†Or how many possibilities are there. For simplicity I will first explain how to randomize between two different things.

Example: Your creating a random unit 1 minute into the game.

Conditions:
-Elapsed Time is at least 60 game seconds.
Actions:
-Randomize ‘Switch A’
-Set Switch ‘Randomize On’

Now when you randomize Switch A there are two possible states the switch can be. Set or Clear. So to create your unit you will need a trigger for each of the possible solutions that can occur.

Conditions:
-Switch ‘Switch A†is set
-Switch ‘Randomize On’ is set
Actions:
-Create one ‘random unit 1’ for current player at location

Conditions:
-‘Switch A†is clear
-‘Randomize On’ is set
Actions:
-Create one ‘random unit 2’ for current player at location

At this point you might be asking yourself “What is purpose of the extra switch?†Well, whenever the game starts all switches are clear by default. If the condition for the second trigger was ONLY “switch a†is clear then it would fire at the very start of the game. For this reason I always have a extra switch.

LESSON TWO
Ok now that we have the basics down lets take it a step up. As we all know Starcraft isn’t a perfect world and we don’t always want our random events to only have two results or a 50/50 chance. So this is where Combining Random Switches comes in handy. For example, Say you randomize two switches instead of only 1. When you look at the two switches together the first can be ether set or clear and so can the second. This leaves you with 4 possible solutions. Set/Set, Set/Clear, Clear/Set, and Clear/Clear.

For my next example I will describe a madness map with a random unit spawn. Say we want our players to get hydralisk 25% of the time marines 25% of the time and zerglings 50% of the time.

So lets take this step by step, First off you have more than 2 units so you will need more than 1 random switch. Also you want the zerglings to spawn 50% of the time. The solution isn’t hard. Use two random switches so you get 4 possible results and designate two of the results to give you zerglings.

Now before I go off writing my triggers I need to point something else out. I stated this was a madness map. Meaning the random triggers need to happen more than once. Preserving randomization is a little bit more complex than just adding preserve trigger to the end of all the triggers.

First off lets make our starting trigger (the condition)
Players:
-Player 1
Conditions:
-Always
Actions:
-Randomize ‘Switch A’
-Randomize ‘Switch B’
-Set Switch ‘Randomization On’
-Preserve Trigger

Then we will need our 4 triggers, one for each possibility.
Set/Set, Set/Clear, Clear/Set, and Clear/Clear

Players:
-Player 1
Conditions:
-‘Switch A’ is set
-‘Switch B’ is set
-‘Randomization On’ is set
Actions:
-Create one hydralisk at ‘spawn location’ for current player
-Clear switch ‘Randomization On
-Preserve Trigger.

Then you would create this trigger for each of the above combinations changing the unit it creates. (keep in mind two of the triggers would create a zergling)
Also pay close attention to the fact that I cleared the ‘Randomization On’ switch This isn’t really important for this trigger since it randomizes all the time but if you had to wait a long time for your unit you wouldn’t want the random trigger to just keep creating hydralisk. As far as clearing the random switches (switch A and B), it isn’t needed. Since the switches have no other effect on the map you will not need to clear them. You will just randomize them again next time you need a unit and what state there in doesn’t matter.

LESSON THREE
Ok lets get into the more advanced stuff now. Say you want a whole bunch of different random things to happen. Say any one of 15 questions for a quiz map.

The first thing that should be going though your head is “how many switches do I need?†This is where an the equation comes in handy. Rather than guessing the amount of switches and trying to find all there combinations then counting use this equation.

(# of Possibilities) = 2 ^ (# of Switches)
Or quite simply each time you add a switch it doubles. (IE: 2, 4, 8, 16, 32, …)

So once you have figured that out you will realize that there isn’t a amount of switches that has 15 solutions. Well relax this can still be done, Whenever the number of desired possibilities isn’t a even power of 2 then you just pick the next number up. 4 switches with 16 possibilities in our case.

So first things first how do I determine what possibilities will there be? To make this process simpler I’ll use binary, 1 to represent set and 0 to represent clear So if I use 2 switches the possibilities would look like this

00
01
10
11

Now what if I have 4 or even 6 switches?
Take the same basic row structure and add to it.

(3 switches)
000
001
010
011
100
101
110
111

(4 switches)
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111

If you look at the first digit in each row you will realize that all the Zeros line up and all the Ones line up. If I wanted to create a list for 5 switches I would first copy the list for 4, Then I would put a 0 in front of each possibility. Then copy the list for 4 switches again and put a 1 in front of the rest.

Now that we have figured out how many switches to use and what all the combinations of switches are were ready to write our trigger. Our starting trigger (the randomizer) is the same.

Conditions:
-Whatever
Actions:
-Randomize Switch A
-Randomize Switch B
-Randomize Switch C
-Randomize Switch D
-Set Switch Randomizer On

Now we know how to write triggers for each combination but remember we only want 15 results NOT 16. To do this you can’t just leave one of them out (wouldn’t that be nice). Since it is still possible that that solution come up you will need to create what I call a “rerandomizerâ€.

Basically you just make the actions for the 16th possibility to start the randomization process again. The trigger would look like this.

Conditions:
-Switch A is clear
-Switch B is clear
-Switch C is clear
-Switch D is clear (you can use any of the possibilities, you don’t have to use all clears)
-Switch Randomizer On is set
Actions:
-Randomize Switch A
-Randomize Switch B
-Randomize Switch C
-Randomize Switch D
-Preserve Trigger

Now this trigger runs a little bit different than the rest. First off you MUST preserve it. Even if you only use the randomization once. This is because it is always possible to get the exact same results twice in a row. Secondly this trigger should be located before the rest of your possibility triggers (the other 15 in this case). This is more of a performance issue than anything else. If the rerandomizer actually runs the other triggers will be following it directly and you won’t have to wait for the triggers to come around next time. (I suggest this even if your using hyper triggers)
 

InfestedCarnifex

New Member
Joined
Jul 22, 2008
Messages
3
Reaction score
0
Hero Trigger (For RPG's)
Here is a trigger that i use for heroes. Fist tirgger is slecting a hero from a slection box. (like the one in RP's)Take note that there are triggers that must be made before you set up the triggers. So here it is.
PLAYERS:
Player 1
CONDITIONS:
Current Player brings exactly 1 Civillian to 'Tyranid Harliquin'.
ACTIONS:
Create 1 Tyranid Harliquin at P1 for Current player.
Kill All Civillian for Current Player at Heroes Box.
Set ((This is a switch))Tyranid Harliquin 1.
Preserve Trigger.

Ok so the reason why the switch Tyranid Harliquin 1 has a 1 at the end is beacuse if more than one player is going th use that Hero, they wont be working off the same switch. If they both used the same switch, the game would be messed up and everyone would start dying and chaos would break out. So thats why you need seperate switches.
 

InfestedCarnifex

New Member
Joined
Jul 22, 2008
Messages
3
Reaction score
0
Hero Trigger (For RPG's)
Here is a trigger that i use for heroes. Fist tirgger is slecting a hero from a slection box. (like the one in RP's)Take note that there are triggers that must be made before you set up the triggers. So here it is.
PLAYERS:
Player 1
CONDITIONS:
Current Player brings exactly 1 Civillian to 'Tyranid Harliquin'.
ACTIONS:
Create 1 Tyranid Harliquin at P1 for Current player.
Kill All Civillian for Current Player at Heroes Box.
((switchstatus))Set Tyranid Harliquin 1.
Preserve Trigger.

Ok so the reason why the switch Tyranid Harliquin 1 has a 1 at the end is beacuse if more than one player is going th use that Hero, they wont be working off the same switch. If they both used the same switch, the game would be messed up and everyone would start dying and chaos would break out. So thats why you need seperate switches.
Ok I accidentally hit enter and posted the first part. The first part was only the spawning part. The second part is having a location on the hero so you can have bags and spells and stuff to stay with him/her at all times. Its really simple. Here it is.

PLYERS:
Player 1
CONDITIONS:
((switchstatus))Tyranid Harliquin is Set.
ACTIONS:
Center Location labled P1 on Tyranid Harliquin owned by current Player at Anywhere.
Center Location labled P1 on Tyranid Harliquin owned by current Player at Anywhere.
Center Location labled P1 on Tyranid Harliquin owned by current Player at Anywhere.
Center Location labled P1 on Tyranid Harliquin owned by current Player at Anywhere.
Center Location labled P1 on Tyranid Harliquin owned by current Player at Anywhere.
Preserve Trigger.

Its repetative because starcraft only repeats a trigger every 500 milliseconds. Adding numerous amounts of the same action will have it repeat even faster.
So now that we have the location centering on that player, you can have the player walk up to someone and talk to them, even if they dont have a location around them.
Lets give our heroes "hands" now shal we? These "Hands" allow you to pick up objects in one spot, them move them to another. You will need an SCV, Drone, or Probe to do this. You also need objects they can handel such as a Psi Emitter or a Data Disc. In this trigger I took a drone and called it HANDS. You will also need a spot in where your "Hands" will move around in. (nicknamed "pockets") I made a small square with a path to a smaller square.
The location in the small square is called 'P1 Pockets'. The location in the smaller square is called 'Hands'. Here's the trigger.

PLAYERS:
Player 1
CONDITIONS:
Player 8 brings at least 1 Heat Pack to P1.
Move All Heat Pack owned by Player 8 from Anywhere to Pockets.
Preserve Trigger.

Ok so that gets the item INTO your "pocket". Heres how we take it out. Get your "Hands" to pick up the object. Use your hands to move the object.Here is the use trigger.

PLAYERS:
Player 1
CONDITIONS:
Player 8 brings at lest 1 Heat Pack to Hands.
(now here i can do 2 things. Number 1)
move all Heat Pack owned by Player 8 at Hands to P1
Preserve trigger
(or number 2)
Remove all Heat Pack owned by player 8
Create 5 Warmth for Current Player at Heat.
Preserve Trigger.

Ok so thats how you use your "hands". So what happens if you die? Well you can choose your player you respawn as. Its a little more complicated than you think though. Here it is.

PLAYERS:
Player 1
CONDITIONS:
Current Player commands at most 0 Tyranid Harliquin
((switch status)) Tyranid Harliquin 1 is Set
ACTIONS:
Clear Tyranid Harliquin 1
Center View for current player at Heroes
Create 1 Civillian for Current Player at Heroes Spawn
Center location labled P1 on Enter/Exit owned by all players at Respawn.
Preserve Trigger.

This way you wont start respawning with theother players running around and you are still alive.

There you have it. The basic triggers for a good user select RPG. I hope this worked for you.
 

InfestedCarnifex

New Member
Joined
Jul 22, 2008
Messages
3
Reaction score
0
Hero Trigger (For RPG's)
Here is a trigger that i use for heroes. Fist tirgger is slecting a hero from a slection box. (like the one in RP's)Take note that there are triggers that must be made before you set up the triggers. So here it is.
PLAYERS:
Player 1
CONDITIONS:
Current Player brings exactly 1 Civillian to 'Tyranid Harliquin'.
ACTIONS:
Create 1 Tyranid Harliquin at P1 for Current player.
Kill All Civillian for Current Player at Heroes Box.
Set ((This is a switch))Tyranid Harliquin 1.
Preserve Trigger.

Ok so the reason why the switch Tyranid Harliquin 1 has a 1 at the end is beacuse if more than one player is going th use that Hero, they wont be working off the same switch. If they both used the same switch, the game would be messed up and everyone would start dying and chaos would break out. So thats why you need seperate switches.
Ok what i ment here (Take note that there are triggers that must be made before you set up the triggers. So here it is.)
Was(Take note that there are LOCATIONS that must be made before you set up the triggers. So here it is.)
Sorry for the inconveniance.
 
Top