• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Spawning

Status
Not open for further replies.
Level 7
Joined
Mar 8, 2009
Messages
360
(basic) GUI is SOOOOOO simple if u just use your brain. (and if you try yourself to find a solution)

  • KillCounter
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set PlayerKills[(Player number of (Owner of (Killing unit)))] = (PlayerKills[(Player number of (Owner of (Killing unit)))] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerKills[(Player number of (Owner of (Killing unit)))] Equal to numberOfKillsYouWant
        • Then - Actions
          • Set SpawnUnit = Unit-Type you want to send
        • Else - Actions
In you spawn trigger you must set the units created to unit-type SpawnUnit

Try to understand what it does or you will have to keep asking questions.
 

Spo

Spo

Level 6
Joined
Jun 1, 2009
Messages
122
(basic) GUI is SOOOOOO simple if u just use your brain. (and if you try yourself to find a solution)

  • KillCounter
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set PlayerKills[(Player number of (Owner of (Killing unit)))] = (PlayerKills[(Player number of (Owner of (Killing unit)))] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerKills[(Player number of (Owner of (Killing unit)))] Equal to numberOfKillsYouWant
        • Then - Actions
          • Set SpawnUnit = Unit-Type you want to send
        • Else - Actions
In you spawn trigger you must set the units created to unit-type SpawnUnit

Try to understand what it does or you will have to keep asking questions.

waht sektion is playerkills in?
 
Level 15
Joined
Aug 11, 2009
Messages
1,606
Yes,sure its simple.Open your world editor,go to trigger editor(f4) then press Ctrl+B and the variable editor opens.Then Create a new variable with Ctrl+N in Variable Name field put PlayerKills and in Variable Type you put the type your variable want to be.Vulcano's variable is an Integer type.Simple?
 
Level 4
Joined
Sep 27, 2009
Messages
119
Did a small tut. on varriables for you, just open the trigger editor and follow these steps.
Step 1:
Step 1.jpg
As you can see varriables editor is hot-keyed to Ctrl + B in your trigger editor.

Click it, hot-key it, get it open.

Step 2:
Step 2.jpg
Ok, we want to create our variable right? Well lets hit Ctrl + N and see what happens.

Step 3:
Step 3.jpg
If you see this screen this means you are in the right place.

Things you should know:
Varriable Name: The name of your varriable - Can be letters, numbers or an underscore (_) We'll say the name is Kill_Tracker for now.
Varriable type: The type of varriable we want to have, for this case we want to set it to Integer, to store numbers.
Array: Arrays are used on a varriable to store multiple things, for example an integer array of 12 can be used to store 12 different values. We'll leave this unchecked.
Initial Value: You won't have to worry about this now, you can set it to 0 or leave it blank.

It should look a bit like this:
Step 3 Product.jpg


Ok, you have your variable, you can use a trigger to count kills similar to this:
  • Kill Tracker:
    • Events:
      • Unit - A unit dies.
    • Conditions:
      • (Owner of (Killing Unit) Equal to Player 1 (Red)
    • Actions:
      • Set Kill_Tracker = Kill_Tracker + 1
Hope that helps.



Here is the other part you requested.

Ok first off since it is a multi-player map, you want to turn your variable into an array of 12 for all 12 players like so.
Step4.jpg

Ok, now we can make the trigger to count these kills :)

Step2.jpg
To get there you simply go to Actions -> Set Varriable and on the left side when you click on it, click on Arithmetic and you'll see the two values as show, put the first one your Kill_Tracker [1] and the second value + 1

Simple enough? Right, you got this.

Now your finished counter trigger should look a bit like this, except with functions for all the players.
Step5.jpg

We're not done yet, now we have to make a trigger to tell it what to make and when to stop making stuff.

Our conditions? We'll use And here, your conditions should look a bit like this: (Note: Will be using If/Then/Else, Multiple functions for each player, this is not the condition for the trigger in general.)
Step6.jpg

And bamn, we have our conditions for player one, now on to the rest of the trigger.
Ste7.jpg
Turn off <Trigger> and Turn on <Trigger> tell it to stop making the level 1 spawns and start making level 2 spawns and so on.

That ends this, hope you have a better understanding of varriables and uh.. other stuff I went over.
 
Last edited:
Status
Not open for further replies.
Top