• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

A newby like me wants to learn

Status
Not open for further replies.
Level 3
Joined
Jun 3, 2006
Messages
31
im in a desprate situation u guys are the first people ive seen with stuff like this I would like to become part of yalls w/e and learn how to do the coo things you do and many praises on warhammer 40k td i play it when my internet goes down!! =)
 

Archian

Site Director
Level 61
Joined
Jan 1, 2006
Messages
3,053
1st, do you even know about triggers?
otherwise you'll need a course or you'll have to find out yourself.
(you can also read some of our tutorials)

Melee Initialization

Events
Map initialization
Conditions
Actions
Melee Game - Use melee time of day (for all players)
Melee Game - Limit Heroes to 1 per Hero-type (for all players)
Melee Game - Give trained Heroes a Scroll of Town Portal (for all players)
Melee Game - Set starting resources (for all players)
Melee Game - Remove creeps and critters from used start locations (for all players)
Melee Game - Create starting units (for all players)
Melee Game - Run melee AI scripts (for computer players)
Melee Game - Enforce victory/defeat conditions (for all players) (delete this trigger)

i usally just delete this whole trigger, but that's because i wish to make my own startup.
 
Level 12
Joined
Jan 13, 2005
Messages
1,138
Like from one spot to the other? Or attacking people far away? Or attack to an area?

Thank you for your interest and I hope we can adequately help you.
 
Level 21
Joined
Jan 5, 2005
Messages
3,515
first you must understand the inferstructure or triggers. event condition action. it basically means when something happens (event) so long as whatever is true (condition) do something(action). you must also understand that whatever is in the tirggers will only work when applied to the map itself. so when you say "a unit to start in one place, go to anouther, kill the units there, and then do the whole thing again" you must know where the unit starts, what the unit is or who it belongs to, where it is going to kill units, how it is going to get there and where it is going to go back to.

you havent been very specific about the event or conditions or what is on the map.

however i can tell by what you are saying you need some regions. a region for the unit to start in and a region for the unit to go. if you do not know about regions yet, look at the tutorial or tinker about with world editor until you understand them.

here is an example, i have used the region "unit spawn" to show where your unit starts, and i have used the position of a specific enemy as where it will attack. as i said you were not specific about events or conditions so i have chosen 5 seconds after the game has started as the event and no conditions to keep things simple.

[trigger:1:56afc0c6fd]
Untitled Trigger 001
Events
Time - Elapsed game time is 5.00 seconds
Conditions
Actions
Unit - Create 1 Footman for Player 1 (Red) at (Center of Unit Spawn <gen>) facing Default building facing degrees
Wait 0.10 seconds
Unit - Order (Last created unit) to Attack Spell Breaker 0000 <gen>
[/trigger:1:56afc0c6fd]

so here we have a very simple trigger which spawns a unit at the center of the region called unit spawn and then it attacks a already existing unit on the map which is a spell breaker. WE (world editor) is very picky about certain things, timing is one of them. if you were to run this trigger without the "Wait 0.10 seconds" action there its possible that the unit would not receive this order because the trigger has actually finished before the game could spawn the unit. the game is fast but triggers are faster. because the wait is so short you wont notice it.

the next stage is to have the unit move back to the "unit spawn" region after the enemy is dead. this is where conditions are involved because the game needs to know the enemy unit is dead. there are two ways of doing this, you can either "Wait until (((Targeted unit) is dead) Equal to True), checking every 0.10 seconds" or you can make a brand new trigger for it. generally we use the latter because checking every 0.10 seconds tends to cause lag, especially if there are alot of other triggers going on at the same time.

in this trigger your event will be the enemy units death. to make sure the enemy unit is dead we must have conditions to make sure the dying unit is and enemy of player 1 (red) and is the spell breaker.

[trigger:1:56afc0c6fd]
Untitled Trigger 002
Events
Unit - A unit Dies
Conditions
((Owner of (Triggering unit)) is an enemy of Player 1 (Red)) Equal to True
(Triggering unit) Equal to Spell Breaker 0000 <gen>
Actions
Unit - Order (Killing unit) to Move To (Center of Unit Spawn <gen>)
[/trigger:1:56afc0c6fd]

when a unit dies, the game checks if it is true that the unit is an enemy of player 1 (red) and that it is the spell breaker that was targeted. if it is the unit is simply told to move back to the centre of the "unit spawn" region.

and there you have it, hopefully you have learn someting from this mini tutorial :) try messing around with the triggers adding little things in and taking other things out, its amazing what you can do. after you have gotten the basics of triggers try using some variables, the "If / Then / Else" functions and the "for each integer x" loop actions. youll be well on your way to a fantastic map :)

Ps. report back on if this has helped you and how your project is progressing. if you need anymore help as away!

PPs. in future make sure you are more specific, the more specific you are the more we can help!
 
Level 21
Joined
Jan 5, 2005
Messages
3,515
another thing i just noticed, u said "How do i make a unit advance to one place to destroy a line and to the next and to the next?"

ok so now i have given you the info on how to make a unit attack an enemy and move back to where he started, can you see what you would change to have a unit attack an enemy and then move onto another enemy? (~Tip~ its an action in the second trigger)
 
Level 21
Joined
Jan 5, 2005
Messages
3,515
ahh that is where you need variables. a variable is basically a peice of information that is stored. here you will need a number (you can store units or strings or even triggers) to count up to 12. you need to have it so that for every unit moved you add one to that variable, with a condition checking it isnt 12 or more. then, when it is 12 that trigger wont work because the variable goes against the conditions.

let me show you

First you need to make a variable, to do this open trigger editor and select the big X in the top menu. the box that comes up is the variable editor. all it shows you are you current variables, im gussing you will have none. now you need to press the green +X which is for making a new variable. this brings up another box, in this box all you need to do is type the relevant info. the name you want for the variable (i use UnitNo later on) and the drop down box for variable type. you want to select integer which basically mean number. ignor all the array stuff for now, but i suggest you read a tutorial about them because they are very useful. you will also need chose what you want the variable to start off as, here you want 1 (to show that the first unit has been spawed) so change it to that by clicking on the blue and typing 1. now click ok on both boxes to confirm the variable. you can see it in the main variable editor box now click ok again to be back on the trigger editor.

now im going to make a similar trigger to the one i made before but with the variable counting up every time the trigger is run and a condition checking that the variable isnt 12. this means that after the trigger has been run 12 times it wont run again.

[trigger:1:a12e661eab]
Untitled Trigger 003
Events
Time - Every 5.00 seconds of game time
Conditions
UnitNo Less than or equal to 12
Actions
Set UnitNo = (UnitNo + 1)
Unit - Create 1 Footman for Player 1 (Red) at (Center of Unit Spawn <gen>) facing Default building facing degrees
Wait 0.10 seconds
Unit - Order (Last created unit) to Attack Spell Breaker 0000 <gen>
[/trigger:1:a12e661eab]

can you see how the condition check if the variable is 12 and how the action make the variable +1 each time?

try it out for yourself!
 
Level 21
Joined
Jan 5, 2005
Messages
3,515
lol mabey i dont know, its the problem of specifying. wc3 is so vast that if you are in the least bit vauge it can lead to loads of explinations for something that probably wasnt the problem anyway. i hope this is what you meant. mabey you wanted 12 units to spawn and them all to move like a TD style, who knows? just try to claryfy in future :)
 
Status
Not open for further replies.
Top