Saturday, April 21, 2012

set variables through chat messages?

hey. Is there an easy way to use the


Code:
Player - Player 1 (Red) types a chat message containing *** as An exact match

to set variables? for example:


Code:
Events
Player - Player 1 (Red) types a chat message containing 3 as An exact match
Conditions
Actions
Set integer = 3

that would be sweet, and i think its do-able because ive seen maps where one can choose from 1-99 lives etc.

pwease answer :)|||sure, here is an example.


Code:
Melee Initialization
Events
Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
Conditions
Actions
Set chatnumber = (Entered chat string)
Set Number = (Integer(chatnumber))

The event detects, any chat (keep in mind with any I mean anything that is written, so you might want to toy around with that)

The first variable is a string variable, to save what has been written, the second is an integer variable, that converts the string to an actual number.|||Quote:






View Post

sure, here is an example.


Code:
Melee Initialization
Events
Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
Conditions
Actions
Set chatnumber = (Entered chat string)
Set Number = (Integer(chatnumber))

The event detects, any chat (keep in mind with any I mean anything that is written, so you might want to toy around with that)

The first variable is a string variable, to save what has been written, the second is an integer variable, that converts the string to an actual number.




hmmm. im afraid im not fully getting it. here's what i made:


Code:
Untitled Trigger 001
Events
Player - Player 1 (Red) types a chat message containing -L1 as A substring
Player - Player 1 (Red) types a chat message containing -L2 as A substring
Player - Player 1 (Red) types a chat message containing -L3 as A substring
Conditions
Actions
Set stringvariable = (Entered chat string)
Set numbervariable = (Integer(stringvariable))
Game - Display to (All players) the text: (String(stringvariable))

but all this displays is 0, when -L1/2/3 has been entered

edit:

okay, i sort of fixed it...


Code:
Untitled Trigger 001
Events
Player - Player 1 (Red) types a chat message containing 1 as A substring
Player - Player 1 (Red) types a chat message containing 2 as A substring
Player - Player 1 (Red) types a chat message containing 3 as A substring
Conditions
Actions
Set stringvariable = (Entered chat string)
Set integervariable = (Integer(stringvariable))
Game - Display to (All players) the text: (String(integervariable))

but i still need to add an event for each possible number typed. is there no way to like detect any integer chat message? also, this way only numbers can be detected, not -L<number>

im not making myself very clear am i? xD|||If you are trying to allow people to type an amount of lives between 1 and 99 via a chat string, you can use the following code, or something alike.


Code:
Melee Initialization
Events
Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
Conditions
Actions
Set Chatnumber = (Entered chat string)
Set number = (Integer(Chatnumber))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
number Greater than 0
number Less than 100
Then - Actions
Game - Display to (All players) the text: (You typed to set the amount of lives to: + (String(number)))
Else - Actions
Game - Display to (All players) the text: You did not type an...

Explaination:

The event detects if the player has typed anything.

The string is than loaded into a string variable, which is called "Chatnumber" in this case, you can assign your own name to it off course.

The second action, then puts the typed string (that is loaded into the string variable) into a integer variable (a whole number variable).

Then comes the If/then/else action.

The condition checks if the integer value is between 1 (greater than 0) 99 (less than 100).

The then happens when the typed string is between 1 and 99, you can add your actions in there you would like to use to set those lives for that player.

The else, basically informs the player that he/she did not press any value between 1 and 99.

Hope this is clear enough.

Hero limiting problem

Okay. So I just started learning how to mess with the triggers and stuff to get my map up and running. However my map involves a LOT of heroes, like about 8 for each player.

Now I've got a bug that, since they're all custom heroes, a few of them completely custom, the default Melee map command
Code:
Melee Game - Limit Heroes to 1 per Hero-type (for all players)

for limiting heroes does absolutely nothing to my new, custom heroes.

I've looked around the trigger editor and played with stuff, but nothing seems to work.



Also, I've got a small leaderboard problem I cant seem to get fixed. The counter wont go up past 2.
Code:
Set Kills[(Player number of (Owner of (Killing unit)))] = ((Player number of (Owner of (Killing unit))) + 1)
Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to Kills[(Player number of (Owner of (Killing unit)))]
Leaderboard - Sort (Last created leaderboard) by Value in Descending order

Any and all help would be greatly appreciated.

|||As far as your counter goes, cause you are player one, and that will stay the same, it will automatically, say that if the trigger runs player 1 = 1 + 1 = 2.


Code:
Set Kills = Kills + 1

Thats what you will need|||Quote:






View Post

As far as your counter goes, cause you are player one, and that will stay the same, it will automatically, say that if the trigger runs player 1 = 1 + 1 = 2.


Code:
Set Kills = Kills + 1

Thats what you will need




How exactly would I go about doing that? When I try and mess with the Set Variable = X + (X+1) it wants me to fill in an index, which makes this not work.



Like I said, I'm sort of new to figuring this stuff out. I've played with the thing for about 3 hours now on this one piece of script and it's driving me insane.|||Quote:






View Post

How exactly would I go about doing that? When I try and mess with the Set Variable = X + (X+1) it wants me to fill in an index, which makes this not work.



Like I said, I'm sort of new to figuring this stuff out. I've played with the thing for about 3 hours now on this one piece of script and it's driving me insane.




Example.

X default is 0

so X = 0 is what we start with.

in a trigger the following is presented.

X = X + 1

This action is being ran 3 times.

That would look like the following.

X = 0 + 1 = 1

X = 1 + 1 = 2

X = 2 + 1 = 3

So after running this trigger 3 times, X will give 3 as the outcome.

That is how my action in the first post is counted, by the editor, every time the event is being activated, and the actions are being executed.

for more explanation about variables, I'd suggest you read a tutorial about variables.|||Well I know how a variable would function and stuff, and what you're saying makes perfect sense.

MY problem is getting there, making the trigger say that ;P

Need only 1 skill point per 2 levels for the hero

Hello,

I'm making a map where the heroes (under normal conditions) gain to much attributes to fill all the levels, so what I want is that you only get 1 attribute per 2 levels.

Now I had a trigger that when

(EVENT:) a unit gains a level

then the

(ACTION:) Substract 1 skill point



Now I do not know what Condition is needed,

or if I'm thinking this all the wrong way.

I was searching in the Gameplay Constants, but that did not help me. (was hoping there was a Hero skill point per level thingy)



The maximum hero level is quite high (100)

Thanks in advance.|||If I understand you would want to write a code through triggers, that will substract one skill point every 2 levels, so you basically have 1 skill point every 2 levels.

Is so you can use a sorta alike example I wrote below here.


Code:
your trigger name
Events
Unit - A unit Gains a level
Conditions
Actions
Set Integervariable = ((your hero <gen>) mod 2)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Integervariable Equal to 0
Then - Actions
Hero - Modify unspent skill points of Paladin 0021 <gen>: Subtract 1 points
Else - Actions

Explanation:

The IntergerVariable obviously is a integer variable to store a number in.

It checks the current level of your selected hero, then it mod's it with 2, mod stands for Modulo.

If you want to know more about Modulo, I'd suggest opening up a wikipedia page.

then a condition is set to check if the variable you just declared is equal to 0 or not, if it is, it will subtract 1 skill point, else it will do nothing and thus add a skill point.

A list of the modulo.

level2: (2 mod 2 = 0) 1 point is subtracted

level3: (3 mod 2 = 1) nothing happens

leve4: (2 mod 2 = 0) 1 point is subtracted

level5: (3 mod 2 = 1) nothing happens

etc

This can be used on any level, it will always output 0 or 1.

So there you go.|||Great thanks man, that's really useful!

Need help with Dummy in WE

Hello , First of all thanks for taking the time to read this . I have been looking on forums and google and mostly ppl talked about it but not the way i needed .

My problem is that i made the dummy and the trigger and its working when i manually cast the spell with my tower . But when i put the same spell , i manually casted with , autocast , it doesnt trigger my dummy anymore.

I use Searing arrows base for my frost nova modified spell dunno if thats the problem , if so what spell should i base off when i try to make a dummy

Event:

unit - a units starts the effect of an ability

Condition:

Ability being cast equal "spell of my tower"

Action:

create dummy

expiration

order cast spell



Also i was wondering if anyone knew if its possible to make chain lightning autocast or would i have to make another dummy thing.

Im working on my own 2 player td and i gotta say the tower is some job >.>



Cheers|||GUI doesn't have an condition to detect autocast, so it's not possible to make this able with GUI (the normal triggers you can use), you will need to learn JASS for it, to be able to get this off the floor.|||really so without autocast would their be way to make a tower do chain lightning . Or i really need jass language?

Cuz i guess i can learn it .|||You could try to replace the projectile art in the F6 editor.

For JASS tutorials, have a look at http://www.wc3c.net/tutorials.php?f=650|||k thx ill do some reading|||Well i found it ...finaly...

For those who like me where seeking how to do those kind of tower. here is your answer :



No JASS needed |||Good self solve, ill close this thread then.

Camera Trigger

How do I create a trigger that sets the camera just behind and barely above the unit, much like World of WarCraft?|||Just place a camera in the editor on the desired angle, double click on the camera, and you'll have all the information you ever wanted to have about the camera specifications.

you can then apply that camera through a camera trigger.

and then lock the camera to the desired unit.|||There are threads all over the net concerning 3rd person camera triggers.

You should learn a lot if you take the time to read some of them.

Item making question.

Hello , i was making some items for my hero's in my td cuz its a mix im trying out and i was wondering if anyone knew how to make items that merge like in dota.|||Triggering is the key.|||I never played dota, so you will need to a be a bit more explanatory, for me to understand what your trying to create.|||Okay well ill try my best.

There is 2 way the effect i want happen .

first way is that you have 2 items of required items for the merging on 3

then you get the 3rd item and the 3 items become one containing the skills of all 3 ( for the skills retained i bet that would be item creating ) . For the merging part banreality just told me trigger is the key so i guess maybe trigger ill have to check.

the second way is that u have the items needed but need to buy the recipe for them to merge|||Very simple, just check if there are items in slots from a hero through a trigger, if you need a helping hand, ill can deliver an example later today.|||Well thanks item trigger i should be able to find it ill post if i cant make it on my own from there thank you.|||Ok, this is an easy one, what you mean is similar to recipee except without the recipe part. For this i'll say you want to fill a vial of water.

Create the 5 items,

1. Empty vial

2. 1/3 full vial

3. 2/3 full vial

4. full Vial

5. Some kind of item that would fill up the vials [in this case, Water Jug]

you can make these do anything you really want, aura's, really anything, but make sure they only have 1 charge if their a charged item.


Code:
Unit - A unit Acquires an item

((Hero manipulating item) Water Jug) Equal to True
((Hero manipulating item) has an item of type Empy Vial) Equal to True

Item - Remove (Item carried by (Hero manipulating item) of Empty Vial)
Item - Remove (Item carried by (Hero manipulating item) of Jug of Water)
Item - Create 1/3 Full Vial at (Position of (Hero manipulating item))
Special Effect - Create a special effect at (Center of (Playable map area)) using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
Hero - Give (Last created item) to (Hero manipulating item)
Wait 2.00 seconds
Special Effect - Destroy (Last created special effect)
Do nothing

this is a very simple version of this code, you can set it up so you use the vial on a unit, such as a "fountain of Water" but this trigger is used untill you fill up the water|||Thank you very nice i shall test out and learn this =]

Leveling Ability/trigger help

Ok, i'm making an ability where you use the ability on a ground point and trigger's make 2 lava spawns with activated immolation and tell them to move to this point, they dissapear when they hit that point, but i do not know how to set it up so their's more and stronger lava spawns when you level the ability, here's my current two triggers


Code:
Unit - A unit Begins casting an ability

(Ability being cast) Equal to Fire Storm NEWEST

Set Firestormpointmove = (Target point of ability being cast)
Set Firestormcasterpoint = (Position of (Casting unit))
Wait 0.05 seconds
Unit - Create 1 Lava Spawn (Level 1) for (Owner of (Casting unit)) at Firestormcasterpoint facing Default building facing degrees
Set FirestormMovingFire[1] = (Last created unit)
Wait 0.01 seconds
Unit - Order (Last created unit) to Move To Firestormpointmove
Unit - Create 1 Lava Spawn (Level 1) for (Owner of (Casting unit)) at Firestormcasterpoint facing Default building facing degrees
Set FirestormMovingFire[2] = (Last created unit)
Wait 0.01 seconds
Unit - Order (Last created unit) to Move To Firestormpointmove

One above for creating the units and ordering them to move


Code:
Unit - A unit Is issued an order targeting a point

Or - Any (Conditions) are true
Conditions
FirestormMovingFire[1] Equal to (Ordered unit)
FirestormMovingFire[2] Equal to (Ordered unit)
FirestormMovingFire[3] Equal to (Ordered unit)
FirestormMovingFire[4] Equal to (Ordered unit)
FirestormMovingFire[5] Equal to (Ordered unit)

Wait 4.00 seconds
Unit - Kill (Ordered unit)

and thats the one to kill them when they arrive at the point.

also: the cast range is 600 and the lava spawn move speed is 260|||If you want timing that is accurate to fractions of a second, Wait commands won't work well. You'll need to use timers or periodic time events.

Anyway, instead of creating a unit type variable named "Lava Dude (level 1)", Lava Dude (level 2), etc., you could create an array, where Lava_Dude[1] is the first level, and Lava_Dude[2] is the second level, etc.. Then, when you spawn your unit, you can do it like "create Lava_Dude[Level of ability being cast]", and that will automatically pick the one you want as the ability's level increases.

You could also do the same thing with the amount of units that are being created. "Create (level of ability being cast) units...".|||Quote:






View Post

If you want timing that is accurate to fractions of a second, Wait commands won't work well. You'll need to use timers or periodic time events.

Anyway, instead of creating a unit type variable named "Lava Dude (level 1)", Lava Dude (level 2), etc., you could create an array, where Lava_Dude[1] is the first level, and Lava_Dude[2] is the second level, etc.. Then, when you spawn your unit, you can do it like "create Lava_Dude[Level of ability being cast]", and that will automatically pick the one you want as the ability's level increases.

You could also do the same thing with the amount of units that are being created. "Create (level of ability being cast) units...".




Thank you, I'll have to try and test it, actually I really didn't know you could like sync the variables and triggers to that extent...but I've really only recently started using variables [I used to have long and pointless triggers that were shortened dramatically by variables.|||Quote:






View Post

If you want timing that is accurate to fractions of a second, Wait commands won't work well. You'll need to use timers or periodic time events.




Actually, the way i've changed it, when the lava guys get to the point, they have about 1 second of free time before they dissapear inless i do the maximun cast range [800]

How would i make it so the range i cast it is how long the lava guys would last?|||Again, if the range increases with the ability's level, you could use that number to determine the amount of time till expiration. To do that, you could either make a variable array, such as Life_Time[], and use that in a similar manner as I described earlier, or you could do some math, like ((level of ability being cast) x 0.5) seconds.

Either way, I think it will be a lot easier if you were to simply add an expiration timer to each unit right after it is created. That way it will be automatically killed after the specified duration, and you can avoid having to fool with that second trigger.

Turn off <this trigger> or Turn off <Triggername>

Since I'm using Turn off <This trigger> massively. I want to know if there is a difference between using the <This trigger> and just Turn off <Triggername>.

I'm worried since I use <This trigger> so much in my map that when two of these kind of triggers are used, one of them won't be turned off.

Is this a real problem that I can come across or not?

And is it bad to use the triggername instead of <This trigger> ?

Thanks in advance.|||With using the function "This trigger" you turn of the trigger you put the action in.

When you specify to a trigger, you can turn of a trigger you want from any other trigger you put the action in.

So if want to disable the trigger you are putting the action "Turn off this trigger" in, that is a correct function to use, and will not hurt any other trigger in particular.

Memory leaks at point

Hello, I'm trying to fix the memory leaks in my map. But I'm not sure what kind of variable I need to use for the point:


Code:
Creep0 lvl1
Events
Unit - A unit owned by Neutral Hostile Dies
Conditions
CreepVariable[0] Equal to (Dying unit)
Actions
Unit - Suspend corpse decay for CreepVariable[0]
Wait 20.00 seconds
Unit - Create 1 Mugger (Level1) for Neutral Hostile at (Position of CreepVariable[0]) facing (Position of CreepVariable[0])
Set CreepVariable[1] = (Last created unit)
Unit - Remove CreepVariable[0] from the game

I tried to use this link I saw in an other thread, but I'm not totally understanding it: http://www.jx3.net/TDG/wiki/index.ph...ng_Point_Leaks

Thanks for your time.



EDIT: I fixed my own problem, so I no longer need help, but still thanks for your time.|||Here you go, just in case you might need it.


Code:
Creep0 lvl1
Events
Unit - A unit owned by Neutral Hostile Dies
Conditions
CreepVariable[0] Equal to (Dying unit)
Actions
Unit - Suspend corpse decay for CreepVariable[0]
Wait 20.00 seconds
Set memorypoint = (Position of CreepVariable[0])
Unit - Create 1 Mugger (Level1) for Neutral Hostile at memorypoint facing (Position of CreepVariable[0])
Custom script: call RemoveLocation (udg_memorypoint)
Set CreepVariable[1] = (Last created unit)
Unit - Remove CreepVariable[0] from the game

Creep help

Hello , its me gain!

I dont know if anyone saw this sometime but all the creep i spawn for my hero to kill just run away from him like cowards....i have put cant flee and attack is set i wonder what could be doing that....|||If you remove a units attack, and do not specifically order it to go to certain point, it will flee when attacked, cause it can't attack back.|||yeah i get what you are saying but i checked the attack and i did order an patrol move but still they flee.

Something i saw what that after hitting the boundaries i made they stop running and finaly fight back.

Its really weird to explain If needed i can try to upload my map or a video perhaps.|||Sure, be my guest, you can also mail it if you want to keep it personal to "Hemlockdevelopment@gmail.com"|||Their also the possiblity of giving the unit a attack of 0 damage, 100 cooldown, and the same range of the hero [so they keep the same space from each other] it'll keep them from attacking the only other problem is that, the hero will auto retaliate from being attacked, causing him to stop doing somthing less important in the eyes of warcraft. [normally this wont happen inless it's a very unimportant thing]|||@Hemlock Sry i was away , I sent it to you now so you may have a look if u have the time. I tryed putting path blocker and all but it didnt resolve the issue totaly

@doomfox hum but i want them to attack me no just stay with my hero :D|||Sorry for the somewhat late response, I've had a look at your map and what is causing the units to flee, is because of these two triggers.

Creep Blocking

and

Blocking

What you basically say with these triggers, that if your those spawned units attack your hero, they have to move to Mid CP.

What you want to do, is register your hero creation first, like so


Code:
Hero creation
Events
Unit - A unit Finishes training a unit
Conditions
(Unit-type of (Trained unit)) Equal to Vampire
Actions
Set Hero = (Trained unit)

Then accordingly adjust those two triggers, to leave the attacked hero out of the function like the following.


Code:
Creep Blocking
Events
Unit - A unit Is attacked
Conditions
(Owner of (Attacking unit)) Equal to Player 12 (Brown)
(Attacked unit) Not equal to Hero
Actions
Wait 0.50 seconds
Unit - Order (Attacking unit) to Move To (Center of Mid cp <gen>)

and


Code:
Blocking
Events
Unit - A unit Is attacked
Conditions
(Owner of (Attacking unit)) Equal to Player 12 (Brown)
(Attacked unit) Not equal to Hero
Actions
Wait 1.00 seconds
Unit - Order (Attacking unit) to Move To (Center of Mid cp <gen>)
|||wow thanks alot !! im gonna make the change

Thanks for your time.

Edit : There is still one thing itching me , it mite sound stupid but i dont know how to make my hero revivable from the hero altar i made maybe its a trigger ill check that .|||Sorry for double post im having trouble with the image im trying to show...but i finaly made it.. yay

Ive been messing around with the trigger and i am able to make my hero revive instantly like so:



but when i try to make it with a timer , it end up not reviving the hero :

|||Step1: Remove both the event and condition in your first trigger, and you don't need to turn off the "initially on" function.

step2: Remove the wait function and the "Countdown Timer - Destroy" function.

step3: Add the event function "Time - Timer Expires" in your first trigger, and add your made timer which you made in your second trigger.

and voila.

Now for a short note on what you did wrong here.

- You create a countdown timer, and then 15 seconds later you destroy it, use countdown timers over waits, for they are more accurate anyway.

- Countdown timers can be compared with those cliche timerbombs you see in movies, when it reaches 0.00 it will explode, so with this timer, you can let an event register what will happen when it reaches 0.00 (which are you actions in your first trigger if you add step3)|||EDIT : I got it now! thanks Hemlock great support.

I'd like to ask a last question , do you have an idea how to raise to hero lvl cap from 10 to X

X being the level wanted.|||Your welcome.

Make sure you go to "Advanced -> Gameplay Constants" to set the hero cap to be at least higher than you would like to set it with triggers.

Then for the triggers, there are a couple choices, but ill present you with the most logical one.


Code:
Setup trigger
Events
Map initialization
Conditions
Actions
Set X = 19

X is an integer variable and in this case set to 19, you can set this to the level.


Code:
Leveling cap
Events
Unit - A unit Gains a level
Conditions
(Level of (Leveling Hero)) Greater than or equal to X
Actions
Hero - Disable experience gain for (Leveling Hero)

If you want to make different level caps, for different units you might want to toy around a bit more with different values and unit variables.|||Nice !! thanks

Need Some help

Wonder how Damage Target trigger works

Unit-Cause(Trigger Unit) to damage (trigger unit), dealing 500 damage of attack type spells and damage type fire.

which function spot is player and enemy that work best for it.|||ah k thanks. Need help with this trigger so caster don't take the damage.

Events

Unit - A unit begins casting ability

Conditions

(ability being cast) Equal to Thousand Needles

Actions

Unit-Cause(trigger unit)to damage circular area after 0.00 seconds of radius 475.00 at(position of(casting unit),dealing (Random real number 0 to 1000) damage of attack type Pierce and damage type Enchanced

don't know which part i went wrong on the trigger

Vertex modifier

So im trying to use this program to remove the sword from the footman model but when i open the program the 3 windows are just black even if i load a model. So i cant use it. help please!

How to disable unit control/make them return?

Hello guys i need a little help here :)

- idea:

how can i disable unit control ? i tried "ward" and yes it kinda works, but i still can give units orders to move. (basicaly i just want disable player control on units movement.)

Second how to make units return to theyr build position ? (idea - unit builded>starts wave>units move/attack, all creeps are killed>units returns to build position).

I just need action/condition to order them move back to original position they were builded.

Thanks !|||Why don't you give the unit 0 movement speed in object editor.

If you need the trigger it's:


Code:
Unit - Set (Triggering unit) movement speed to 0.00

And this trigger for their default position:


Code:
Unit - Make (Triggering unit) face Default building facing over 0.00 seconds

help with triggers

I need someone to help me make a trigger that lets you check income. also i want to know how to make it so only certain players can use certain triggers (triggers that change names)|||Perhaps you should be a little bit more informative, what income are you referring to? cause if you made the income with your own triggers, it's even easier to keep track of it really.

Your second question is even less understanding.

please rephrase your question for better help.|||ok ignore the second question I figured that out. For the first question i want to make a trigger that when i type the chat message "-income" i want the recource gain gold and recource gain wood to be displayed to the triggering player


Code:
Resource Add1
Events
Unit - A unit Finishes construction
Conditions
(Unit-type of (Constructed structure)) Equal to Resource Storage
Actions
Set ResourceGainGold[(Player number of (Owner of (Constructed structure)))] = (ResourceGainGold[(Player number of (Owner of (Constructed structure)))] + 2)
Set ResourceGainWood[(Player number of (Owner of (Constructed structure)))] = (ResourceGainWood[(Player number of (Owner of (Constructed structure)))] + 4)


Code:
Resource Add2
Events
Unit - A unit Finishes an upgrade
Conditions
(Unit-type of (Triggering unit)) Equal to Bigger Resource Storage
Actions
Set ResourceGainGold[(Player number of (Owner of (Triggering unit)))] = (ResourceGainGold[(Player number of (Owner of (Triggering unit)))] + 6)
Set ResourceGainWood[(Player number of (Owner of (Triggering unit)))] = (ResourceGainWood[(Player number of (Owner of (Triggering unit)))] + 2)


Code:
Resource Add3
Events
Unit - A unit Finishes an upgrade
Conditions
(Unit-type of (Triggering unit)) Equal to Great Resource Storage
Actions
Set ResourceGainGold[(Player number of (Owner of (Triggering unit)))] = (ResourceGainGold[(Player number of (Owner of (Triggering unit)))] + 2)
Set ResourceGainWood[(Player number of (Owner of (Triggering unit)))] = (ResourceGainWood[(Player number of (Owner of (Triggering unit)))] + 4)


Code:
Resource Subtract1
Events
Unit - A unit Dies
Conditions
(Unit-type of (Dying unit)) Equal to Resource Storage
Actions
Set ResourceGainGold[(Player number of (Owner of (Dying unit)))] = (ResourceGainGold[(Player number of (Owner of (Dying unit)))] - 2)
Set ResourceGainWood[(Player number of (Owner of (Dying unit)))] = (ResourceGainWood[(Player number of (Owner of (Dying unit)))] - 4)


Code:
Resource Subtract2
Events
Unit - A unit Dies
Conditions
(Unit-type of (Dying unit)) Equal to Bigger Resource Storage
Actions
Set ResourceGainGold[(Player number of (Owner of (Dying unit)))] = (ResourceGainGold[(Player number of (Owner of (Dying unit)))] - 8)
Set ResourceGainWood[(Player number of (Owner of (Dying unit)))] = (ResourceGainWood[(Player number of (Owner of (Dying unit)))] - 6)


Code:
Resource Subtract3
Events
Unit - A unit Dies
Conditions
(Unit-type of (Dying unit)) Equal to Great Resource Storage
Actions
Set ResourceGainGold[(Player number of (Owner of (Dying unit)))] = (ResourceGainGold[(Player number of (Owner of (Dying unit)))] - 10)
Set ResourceGainWood[(Player number of (Owner of (Dying unit)))] = (ResourceGainWood[(Player number of (Owner of (Dying unit)))] - 10)

those are the triggers for the recource gain. i didn't do them myself i am editing a map for my clan and im pretty new at this trigger stuff|||Code:
Game - Display to (Your player) the text: (String(ResourceGainGold))
Game - Display to (Your player) the text: (String(ResourceGainWood))
|||tysm your the best man|||YAY I JUST FIGURED IT OUT sorry about double post|||Falco,

This is Sin, my laptop charger hasn't been working for the past couple days so I'll be inactive shortly. Do me a favor and don't kick me :].

Also, If you feel like it, I'd like that trigger? =D

If you need to get ahold of me in while it's not working hit me up here... www.myspace.com/06bubba

P.S. o.O o.O o.o O.O

Sincerely,

Sin

Wait instructions

hello

In this trigger


Quote:




Waittrigger

Events

-a unit starts ability effect

Conditions

-Owner of casting unit controller = computer

Actions

-turn boolean_cast[playernumber of [owner of [casting unit]]] = true (example: player 1)

-wait 20.00 seconds

-turn boolean_cast[playernumber of [owner of [casting unit]]] = false (player 1?)




After that time casting unit reference is the same triggering casting unit?

what happens if other unit owned by other computer player start this trigger after 5 seconds.|||If you don't want the trigger to fire again during the wait, you can "turn this trigger off" before the wait, and then "turn this trigger on" at the end of the trigger.

If you want to 20 second countdown to be reset every time the ability is cast, you could just use that trigger to set a timer to 20 seconds, and then have a different trigger that only sets the boolean back when the timer is allowed to expire.|||thanks shadowtek, i check it now

building dragon wars level but its rocket science HELP!!

i started making a new dragon wars map and I dont know how to do somethings in the editor.

1) how to place a manafountain that is visable and works in the game.

2) how to make my dragons attacks actually work instead of just seeing a big blob of fire above its head.

3) how to get way gates to work

PLEASE HELP!!! |||Ive been searching for a Leaderboard wich shows Damage, Not points, not kills. I have never found one and im DESPERATE for help! I wanna know how to set a integer variable to store how much damage a specefic unit have done. How is this possible? PLEASE help me.|||1- mana fountains are neutral units, check it on unit palette [u], also you can create custom mana fountain via Object Editor[f6] units tab - use search for default unit that you want copy.

2- Object Editor - set art graphics, art - missile... etc. use fire trap or any Lighting effect. Other way is creating an effect via trigger editor, remember destroy effect if u use that, to prevent memory leaks.

3- Way gates works with regions and another way gates. If u place a way gate on your map select it and press enter to set destination. also via trigger option you can set destination of way gate, but only work with regions made with region layer.|||Quote:






View Post

Ive been searching for a Leaderboard wich shows Damage, Not points, not kills. I have never found one and im DESPERATE for help! I wanna know how to set a integer variable to store how much damage a specefic unit have done. How is this possible? PLEASE help me.




mmm.

not posibble, blizzard does not make function where you get unit-damage.

a way could be you make a trigger with unit atacked event and calculate damage per healt points loses, but it is hard and erratic.|||Quote:




I wanna know how to set a integer variable to store how much damage a specefic unit have done.




I can't remember exactly, but I think there is a "takes damage", or something like that, event that you can reference to do what you need. I think it's only available as a specific-unit event, so you would need to create a trigger that would pick every unit in the game, add them to a trigger with that event, and then you could set your variables with that trigger.

But it's been a while, so I can't remember exactly.|||yes, "takes damage" trigger exist on -specific unit event- but in GUI editor only works with predefined units on the map. Use -damage source- if u use this trigger.|||You can use it for any unit that you like by using the add event to trigger action at any time during the game.

For instance:

unit enters playable map area (is created)

add event to trigger...

Then you just reference the entering unit, which will be the "specific unit" that will be added with that event.

Help w/ trigger please =]

hello guys been a while .

I've been trying to do a trigger to restrict towers before a level has been past from my tower defense. But i dont know that to do for action.

Condition :Currentlevel equal to 25

Action : allow building of X tower

Also i was wondering if anyone knew how to set the towers where u want them in the builder. Cuz they all are at random spot id like em in order of cost.

Thanks !|||Concerning:


Quote:




Also i was wondering if anyone knew how to set the towers where u want them in the builder. Cuz they all are at random spot id like em in order of cost.




Go to object editor, click the tower, go to Art - Button Position (X) and Art - Button Position (Y).

X = 0 and Y = 0 will make the unit go into the upper left corner

X = 1 and Y = 1 will make the unit go 1 to the right, and 1 down. (From the upper left corner)|||Thanks a lot!

why custom team color doesnt work ingame?

I create a team color texture 8x8 that is another color example:

██ Magenta Team Color

I want to use it in my map so I import it with path: ReplaceableTextures\TeamColor\TeamColor00.blp to replace Player 1 Red.

So it works in World Editor after I reopen the map but it doesn't in-game. Like Player 1 is still red in-game. This question was posted on your forum by someone else but it can't have worked in-game, this never works in the game, so anyone knows?

Pls no answers such as Triggers - Set Player Color or CHange Owner or Select the unit to be another player's color...

This regards the entire player's units to be say magenta. And if it works in Wolrd Editor you can see it, it remains the default color in-game.

need model maker for game, URGENT MUST BE A GOOD MOEDLER PLEASE

i need someone to either make 2 models or give me a link to the sites with these models.: freddy kruger and jason vorheeves.

I'm making a freddy vs jason game and i need these models!!!!

many thanks in advance|||let me refresh that, freddy kruguer from the nightmare at elm street and jason vorheeves from friday the 13th models

How to make npc neutral/hostile to some

Well this is my problem. I have a forest full of spiders. I want to have a team be like forest people who live with the nature. And then I want the spiders/creeps not to be hostile. Allies would be even better.

So the basic question is: How to make creeps hostile/neutral/ally to some. :D

|||Ok, this is too easy to change..

In war3 editor go to:

Scenario -> Ally Priorities Properties

and change what you want in there...

Make sure you have assigned the computer/npc/player to a colour to make ally with another colour.

Have fun |||Great ;D thx a lot

Do you also know how to shrink buildings? |||When do you want to shrink buildings?

On an upgrade?

From building?

and do you also mean shrinking the amount of squares it takes up? or just the size of it?|||I know how to make it take no place and thats how it is and I want it to.

But I would like how to make it smaller after. But thats just to choose something that is smaller? right? A different pathing map?

And yes the real problem is the size. |||to change the size of a building or unit you must go into the object editor....

there you select the building / unit and look for "Art - Scaling Value"

You will notice that it is allready set to 1.00 ..... 1.00 means 100% size.... so the unit will be at its normal size.... eg. 0.50 would make the building / unit half its normal size....

as of yet i can't remember how to make buildings / units occupy less map squares as its been over a year since i have used the warcraft map editor.

Once again have fun |||

Your the greatest :P :D|||If you want to make Buildings / Units occupy a different amount of map squares...

1. Go to object editor, and select the building / unit you want to change.

2. Go to Pathing - Pathing map and click on modify selected field

3. Search through Preset - Units for a building type that has the size you want.

Eg. If you wanted to change an orc burrow (3x3 squares) to a 2x2 square size, you would change the Pathing Map type {Human Shipyard, Warmill, Orc Burrow ect.} to something like Arcane Tower, Cannon Tower, Guard Tower, Farm ect.

4. Select the setting, and click ok!



Enjoy!

mount/dismount as hero ability

Hello guys.

I've been working for a while on a long campaign, and decided, at one point, to give the hero an ability to shapeshift. Now, said hero uses the model of the human Archmage, so I felt right to use a customized Mount Hippogryph to make the hero shift, as well as keep the horse (Riderless Horse) around.

Only that the ability multiplies the hero every time it is used. (multiple ressurectable heroes appear). I've solved said problem by destroying the dead hero every time the spell is cast, which works perfectly.

However, when i use the reverse, the hero is reset to level one. I've tried setting his stuff as variables, him as variable, replacing, restoring from game cache saved before the shift, and none work.

Anyone has any idea what I could use to make him the same? Thanks in advance.|||I had a similar problem where the hero had to be replaced with an other hero. I used the noob method by just placing a hero on the field for Neutral - Passive and then this trigger:


Code:
RHeroLevel
Events
Unit - A unit Gains a level
Conditions
(Leveling Hero) Equal to HeroVariableRed[1]
Actions
Hero - Set HeroVariableRed[2] experience to HeroVariableRed[1], Hide level-up graphics

These are issues with this technique which I found out:

You need to repick the abilities for the hero (Does not need to be a bad thing)

If the hero does not level, the experience is not transferred.

(Example: Your mounted hero has 199 experience, and needs 1 experience for level 2, then you use the ability, your new hero will have 0 experience.)|||Thanks, I'll try it out and see how it works, and let you know.

As to the level, i'm not really interested into keeping all the experience (anyway, he gains said ability at higher level), but I'm trying to keep the chosen skills and items, which didn't work.

But I'll try now :)|||I forgot to add the trigger I used to replace the unit.


Code:
    Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Mount Hippogryph
Actions
Unit - Set life of HeroVariableRed[2] to (Percentage life of HeroVariableRed[1])%
Unit - Set mana of HeroVariableRed[2] to (Percentage mana of HeroVariableRed[1])%
Unit - Turn collision for HeroVariableRed[1] Off
Unit - Turn collision for HeroVariableRed[2] Off
Unit - Move HeroVariableRed[2] instantly to (Position of HeroVariableRed[1])
Unit - Hide HeroVariableRed[1]
Unit - Unhide HeroVariableRed[2]
Unit - Change ownership of HeroVariableRed[1] to Neutral Passive and Change color
Unit - Turn collision for HeroVariableRed[1] On
Unit - Turn collision for HeroVariableRed[2] On
Unit - Change ownership of HeroVariableRed[2] to Player 1 (Red) and Change color
Selection - Select HeroVariableRed[2] for Player 1 (Red)

Note: My trigger also lets you get the other unit back if you reverse the variables.

Help please! =)

Ok, i made a model with autodesk 3ds max. made a .mdl file of it then convert it to .mdx when i import it to warcraft 3 world editor it is invisible...

how can i fix this? it is invisible ingame and in the map maker. it doesnt have a texture. restarting the map maker doesnt help. i followed a tutorial but it doesnt work for me. please helpzz

i used materials from autodesk to paint the model. maybe it could be that w3 map editor can find this materials. how can i import them to w3 map editor? i dont have a file of it? they say i have to import the skin to. how do i get a skin of it? i want to keep it the colour i made it with 3ds.

Hero XP Gain questions

So i've got this problem, unreliable of gameplay constants, that hero's in map all gain the same XP, no matter who gets the kill. Now what i'm asking is the solution for this. Only the one that kills should get the Exp.

Should i go trigger this or do it with something else?

All comments welcome |||Are Your Units near the Hero you have training or rather far from him?? If they are close to him they get a percentage of the exps he gains.

Help with building ownership

I am making a custom side based off the night elves, and I am trying to make two buildings that can be built by that side, but become neutral buildings if you move your base, so the buildings are only yours while you have an ancient near them. I cant do it with regions, because I cant find a way to have the game make a region around the building when it is built in-game. I've also tried using the "Unit has specific buff" trigger, but I cant find an event that would start that trigger whenever the building gets the buff, and I cant even get the building to have a buff. The two buildings are a shop and a moon well equivalent (called a "Fountain").

Also for the fountain, I am trying to have the players food go up based on how many units are inside it (like a gold mine, except for food). Anyone have any advice?



Thanks|||Quote:






View Post

I cant do it with regions, because I cant find a way to have the game make a region around the building when it is built in-game.




In any action where you can select a region, you can create a region there by using any of the "Conversion" options from the region drop-down. So in the list that includes "Playable Map Area" there is also "Convert Points with size to Region" (for example), which will then give you options for the point (position of unit, for example), and the size of the region in height and width.

Alternatively you can create a region, assign it to a variable at map initialization, and then just move the region using the "Region - Move" action.

I would recommend not even using regions, unless you have to, though. There's better ways to do it by checking units in range or something like that.


Quote:






View Post

I've also tried using the "Unit has specific buff" trigger, but I cant find an event that would start that trigger whenever the building gets the buff, and I cant even get the building to have a buff.




Buildings never show buff-tips, even when they have the buff in question - which you might be able to tell through the art associated with the buff if it is something that attaches to the origin of the model (like an aura, for example).

How would i make one tile change to another via environment trigger

-----THE TRIGGER----

Heavy Snow

Events

Player - Player 1 (Red) types a chat message containing -hsnow as An exact match

Conditions

Actions

Environment - Create at (Playable map area) the weather effect Northrend Snow (Heavy)

Environment - Set sky to Lordaeron Winter Sky

Environment - Turn (Last created weather effect) On

------------



I want to know how i can make one certain title variable "Dalaran Grass Trim" turn into "Icecrown Ice" Does anyone know how to perform this trigger?

For instance how would i convert a terrain variable to a region variable.|||Quote:






View Post

I want to know how i can make one certain title variable "Dalaran Grass Trim" turn into "Icecrown Ice" Does anyone know how to perform this trigger?




The action is:


Code:
Environment - Change terrain type at (Point) to Icecrown Glacier - Ice using variation -1 in an area of size (size) and shape (shape)


Quote:






View Post

For instance how would i convert a terrain variable to a region variable.




There is no way to convert them - what you have to do is check points on the map in a grid (based on the size of the tile) to first find out which terrain type is there - like so:


Code:
If:
(Terrain type at (Point)) Equal to Dalaran Ruins - Trim Grass
Then:
Environment - Change terrain type at (Point) to Icecrown Glacier - Ice using variation -1 in an area of size (size) and shape (shape)

setting limits

I got a question is it possible to make a limit on how much health a unit can have??? If so how do I do that??|||Change the unit's max hp field in the Object Editor.|||um not sure thats what I meant guess I should of been more pacific a limit on the max health a hero can have. I meant limit as in how high its allowed to go not base. and sry for not being pacific enough.

Limit

Events

Unit - A unit Gains a level

Conditions

(Integer((Life of (Triggering unit)))) Greater than 30000

Actions

Unit - Set life of (Triggering unit) to 30000.00

this was my try it didnt work.

F.A.Q link broken?

Quote:




Question: How can I upload an map or Tutorial

Answer:

*To upload A tutorial click here (The Tutorials you submit are checked on quality, and could take several days to get validated and approved into our archives)

[small]Please read the rules and guidelines before submitting a new tutorial[/small]

*To upload A map click here

(maps will be uploaded between 2 and 7 days into our database)

(you need to be A usser in order to submit A map)




The click here for map upload seem to be broken or is it just me?

Help with an ability trigger

Is there way make ability was trying to put in my make like a summon but have an 5% will make a summon unit?|||Randomize(20) make that 5% probability



Summon

Events

Unidad - Unit starts an ability effect

Conditions

(Ability being cast) = summon water elemental //set this spell to cannot summon any unit, a fake summon spell.

Acciones

Set temp_point = (Position of (Casting unit))

Set money = (Random integer number between 1 and 20)

If (money equal to 5) then

Unidad - Create 1 dummy caster for (Owner of (Casting unit)) at temp_point facing temp_point

Unidad - Add true summon water elemental to (Last created unit)

Unidad - Order (Last created unit) to Human Archmage: summon water elemental

Unidad - Add a 1.00 second generic expiration timer to (Last created unit)

Custom script: call RemoveLocation(udg_temp_point)

Else do nothing

Floating Text and Cooldown Lag.

I need help with some of my triggers in my map.

Trigger 1 :

Floating Text

Ability Being Cast

Events

Unit - A unit Begins casting an ability

Conditions - (Ability being cast) Equals to (My Skill)

Actions

- Create floating text that reads (My Skill) above (Casting unit) with Z offset 0.00, using font size 7.00, color (100.00%, 100.00%, 0.00%), and 0% transparency.

-Set (My_Skill_Text) = (My Skill)

-Change the lifespan of Ablility_Being_Cast to 3.00 seconds

---------------------------------------------------------------

But after a while this trigger makes me lag because i have more than 1 triggers like this with different variables.

I mean , if i have 2 skills,

Death Pact and Heal,

i will have 2 variables for them .. like -- Death_Pact_Text and Heal_Text

just to create a different (Last created floating text).

But it lags me.. is there another way?



Trigger 2 :

Some people who plays my map are bored with the cooldown systems that just refresh but no numbers and always want to know how long is it gonna take for the skills to cooldown.

so i make up a trigger that create a timer window if the skill is activated.

This is 1 of my trigger =

Event - A unit begins casting an ability

Conditions - (Ability being cast) Equals to (Ice Slash)

- Level of (Ability being cast) Equals to 1

Action -

If -

- Level of (Ability being cast) Equals to 1

Then -

-Start Ice_Slash_Timer as a One-shot timer that will expire in 20.00 seconds

-Create a Ice_Slash window for Ice_Slash_Timer with title Ice Slash in :

-Wait for 20.00 seconds <<< Real seconds.

-Destroy Ice_Slash.

Else -

-Do Nothing



If -

- Level of (Ability being cast) Equals to 2

Then -

-Start Ice_Slash_Timer as a One-shot timer that will expire in 15.00 seconds

-Create a Ice_Slash window for Ice_Slash_Timer with title Ice Slash in :

-Wait for 15.00 seconds <<< Real seconds.

-Destroy Ice_Slash.

Else -

-Do Nothing





------------------------------------------------------



But this 1 also makes me lag.. coz i have a lot of this..



is there any other way to reduce the lag?

Lag i mean at early game it doesnt lag, a few times casting the skill with the trigger it lags, a few times again the PC just stuck.

help?

What Game Constants to change to allow hero to creep above level 5?

Question like in topic. I can't remember what game constants to change.|||Hero XP Gained - Creep Reduction Table, the last number you fill in, will be remembered for all the remaining levels. (If 20% is last data given for level 6, all next levels will also get 20%.)

How can I make Holy Light target the Paladin and still target other units?

I'm trying to make the Paladin so he can behave like, well, the Paladins from WoW, in that he can use his light abilities to heal himself and his allies, or hurt his enemies.

It seems the 'self' target tag is exlusive, though - if 'self' is set, then you can't target anything else. How can I fix this?|||All you have to do is remove the not self and not put self

it will heal both you and ur friends

How can I make summoned heroes unique?

I'm making a psuedo-hero mod for me and some friends to tool around with - basically we want high-level RPG-type heroes beating down on unholy waves of the undead, using more or less normal Melee parameters - IE, instead of just a hero controller, the player still raises an army, manages peasants, builds, etcetera.

The problem I'm having is that, at the Altar of Kings or whatever, when I summon a hero, the option to summon them again remains - I want the option to summon them to vanish after you've chosen to summon them once - this is because they're all unique named individuals, most of them being campaign characters, the rest based on WoW characters.

I've gone through their files I can't say how many times, trying to find what option or toggle will make that happen. What do I need to do to fix this?|||That would be a trigger...

Events - Map initialization

condition - NA

Action - Player - Limit training of " Name of your Hero " to 1 For player 1 (red)

Action - Player - Limit training of " Heroes " to 1 For player 1 (red) **



Do this for all hero and player and they shall all be unique somewhat



** note that the second trigger mite not be apply or be used , but i put it for the heck of it :P

Cheers

Is there any way to adjust the ambient light?

This is gonna sound silly, but...

I want to gloom a map up. I want dreary, overcast days, and absolutely dreadful, dark, dark nights.

How can I do this?|||You could create a weather effect by going to environment and doing Create Weather Effect > Create at (Entire Map) the weather effect Dungeon White Fog (Light)

Construction auto finishing?

Hello ive been trying to make it so when i start building a tower and i move away it finish building by itself. I tryed some triggers but nothing really close to working =[ i tryed to make a dummy builder lol failed also.

If anyone know the trick it would help me greatly =] Thanks

Edit : much like undead builder does dunno if that helps|||Bump!

(sorry if its prohibed i didnt see it in rules )|||Change the race of the builder to Undead in the object editor.|||wooo thanks . so simple !

My attraction Beams are dysfuntional :)

hey guys, here is my trigger for an attractor beam:


Code:
function Trig_Attractor_Beams_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'ANcl' ) ) then
return false
endif
return true
endfunction

function Trig_Attractor_Beams_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local unit target = GetSpellTargetUnit()
local real angle = AngleBetweenPoints(GetUnitLoc(target), GetUnitLoc(caster))
local lightning light
set udg_distance = DistanceBetweenPoints(GetUnitLoc(caster), GetUnitLoc(target))
call AddLightningLoc( "LEAS", GetUnitLoc(caster), GetUnitLoc(target) )
set light = GetLastCreatedLightningBJ()
loop
exitwhen udg_distance < 2
call TriggerSleepAction( 0.01 )
call SetUnitPositionLoc( target, PolarProjectionBJ(GetUnitLoc(target), 3.00, angle) )
set udg_distance = DistanceBetweenPoints(GetUnitLoc(caster), GetUnitLoc(target))
call MoveLightningLoc( light, GetUnitLoc(caster), GetUnitLoc(target) )
endloop
endfunction

//===========================================================================
function InitTrig_Attractor_Beams takes nothing returns nothing
set gg_trg_Attractor_Beams = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Attractor_Beams, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Attractor_Beams, Condition( function Trig_Attractor_Beams_Conditions ) )
call TriggerAddAction( gg_trg_Attractor_Beams, function Trig_Attractor_Beams_Actions )
endfunction

would there be a way to make udg_distance into a local? This is the first time im making maps in a number of months, so be easy on me :)

edit: it seems that whatever integer i put after "exitwhen udg_distance <" the attraction will never stop. What's the problem?|||Quote:




edit: it seems that whatever integer i put after "exitwhen udg_distance <" the attraction will never stop. What's the problem




"2" is a very small distance. Perhaps the collision size of each unit is preventing them from ever getting that close?|||Quote:






View Post

"2" is a very small distance. Perhaps the collision size of each unit is preventing them from ever getting that close?




yes, it's very small but i've tried 45, 60 and 115 aswell, same result. the unit just keeps moving until it bumps into to casting unit|||115 is still a small number. Of course, it all depends on the units involved. Try 500.|||Quote:






View Post

115 is still a small number. Of course, it all depends on the units involved. Try 500.




worked... -.- lol

thanks :p

is the trigger well written otherwise?|||Ehh, my brain's too hot to think right now. If it works and doesn't leak or lag, it's good 'nuf.|||Quote:






View Post

Ehh, my brain's too hot to think right now. If it works and doesn't leak or lag, it's good 'nuf.




kk. I guess it leaks a little but i know how to fix that, i was more concerned about unnecessary lines or functions. so, im happy :p

Drag Select multiple buildings?

How do i enable the ability to drag select multiple buildings?

Im making a TD where you make units but they are classified as buildings so that you can upgrade them directly from themselves. Really need to be able to drag select these.|||bump .|||Bump your own thread again, get banned.

Read the forum rules, dude.

Also, I think your premise is wrong. You should be able to upgrade several buildings at once if you are selecting the same unit types.|||sorry, ive read them now, i know you can double click them or ctrl click them to select the same kind of units(buildings) but my upgrade system branches out and a lot will be at different stages, also i planned on it being sorta like a war so there will be many units at once, i may have to change my plans.

JASS triger does not work

Hello there,

I want a respawn system for units, and when they die that a same type of unit comes in it's place.

Now, I made this trigger in GUI, converted it in JASS and changed some things (My first attempt at JASS).

But when I try the trigger, it did not work, but neither did it give any errors.

Here is the code:


Code:
function Trig_CreepLevel1_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'h00G' ) ) then
return false
endif
return true
endfunction

function Trig_CreepLevel1_Actions takes nothing returns nothing
local unit i = GetTriggerUnit()
local location 1 = GetUnitLoc( i )
call UnitSuspendDecayBJ( true, i )
call TriggerSleepAction( 35.00 )
call CreateNUnitsAtLocFacingLocBJ( 1, 'h00G', Player(PLAYER_NEUTRAL_AGGRESSIVE), 1, 1)
call RemoveLocation( 1 )
call RemoveUnit( i )
endfunction

//===========================================================================
function InitTrig_CreepLevel1 takes nothing returns nothing
set gg_trg_CreepLevel1 = CreateTrigger( )
call DisableTrigger( gg_trg_CreepLevel1 )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CreepLevel1, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_CreepLevel1, Condition( function Trig_CreepLevel1_Conditions ) )
call TriggerAddAction( gg_trg_CreepLevel1, function Trig_CreepLevel1_Actions )
endfunction

As always, thank you for your time.

EDIT: I also would like to know how to set a Real to null, because if I do: set RealVariableName = null

I get an error stating type mismatch assignment.|||Code:
    local location 1 = GetUnitLoc( i )

You can't use a number as a variable name in the global variable editor and I think that also holds true for JASS (although I could be wrong).


Quote:






View Post

I also would like to know how to set a Real to null, because if I do: set RealVariableName = null

I get an error stating type mismatch assignment.




Why would you even attempt to set a real to null? If anything, set it to 0. But there's no point in trying to clear the value of reals, they aren't objects and they don't leak.|||Ah I see, then is this trigger cleared of all leaks? If not, which ones and how to fix them?


Code:
function Trig_Unit_Revive_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'n001' ) ) then
return false
endif
return true
endfunction

function Trig_Unit_Revive_Actions takes nothing returns nothing
local real realX = GetUnitX(GetTriggerUnit())
local real realY = GetUnitY(GetTriggerUnit())
local real facePoint = GetUnitFacing(GetTriggerUnit())
local unit i = GetTriggerUnit()
call TriggerSleepAction( 35.00 )
call CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'n001', realX, realY, facePoint)
call RemoveUnit( i )
endfunction



//===========================================================================
function InitTrig_CreepReviveLevel1 takes nothing returns nothing
set gg_trg_CreepReviveLevel1 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_CreepReviveLevel1, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_CreepReviveLevel1, Condition( function Trig_Unit_Revive_Conditions ) )
call TriggerAddAction( gg_trg_CreepReviveLevel1, function Trig_Unit_Revive_Actions )
endfunction

And again, thank you for your time.|||Well, you should probably set the local unit variable to 'null' before you remove it, but otherwise, you aren't even generating any leaks.

Legion TD type?

can anyone point me in the right direction for trying to figure out how to make the placed buildings turn into units and reset after the wave, like legion td does? i dont want to directly rip it off but its a cooler idea than just buildings|||I havent tested it but what i think could work is to make 2 of each tower u want one would be the building and the other the unit and with a trigger make them switch on timed event or whenever u need .|||I believe Lisk just hides the structures and creates units where they were placed. You might try asking him - he's a nice guy. You'd also probably have better luck just asking on our clan forum (www.jx3.net/tdg/forum), where his subforum is Lisk's Hive.|||sorry if its not really related to the topic but i like ur maps chunk hehe|||Thanks. You are probably in the minority of people, though. :P|||i really like the fiend td cuz we get others leaks and we can fight with em thats pretty awesome.

Need help extremely badly! (mathy point trigger)

Hey all. So i got a map where each player controls 1 lightning effect using the arrow keys. and there is a problem, well, two actually. First, I have 6 points in a group variable called "Point[1-6]. These Points are set in a hexagon (like this - : : - , the "-" resembling 1 point and ":" resembling 2 points)

The lightning effects are supposed to work like fences to stop units from exit the hexagon. As mentioned youre supposed to move a lightning using Up, DOwn, Right and Left arrow keys but my first problem comes when im gonna trigger the movement of said lightnings. I just cant think of a good way to trigger it without using a LOT of if/then/elses. Ive tried assisgning 2 point variable to each lightning and an Integer but it's all just a mess. My second Problem is "Point[1]" and "Point[6]". This problem basically just adds to the first problem, cause if i am to move a lightning which goes from Point[1] and [2] to Point [6] and [1], i cant just use an "Integer - 1", which I imagine would be the smoothest way to move Points around, i just cant think of a smart way to utilize it.

Picture to explain my problems:

http://data.fuskbugg.se/skalman01/dshsdh.bmp

So i need a clever code to move these lightnings and im simply just too unexperianced to do it. Anyways Good luck, I need it :D

edit; another problem is that you cant compare points or lightning effects, so that also adds to difficulty.|||When does this effect begin, and how is it activated?

Does it only happen after an ability has been cast?

Is it activated and deactivated in such a manner that it will be occurring in different places around the map, such as wherever unit happens to be?|||Quote:






View Post

When does this effect begin, and how is it activated?

Does it only happen after an ability has been cast?

Is it activated and deactivated in such a manner that it will be occurring in different places around the map, such as wherever unit happens to be?




im planning on referencing the lightning in one way or another at Map Initialzation. It's activated when a player presses Up/Down/Right/Left, each player (6 total) have control over 1 lightning each, and they lightnings can't move to any other places than "Point[1-6]", which are static. (see picture). The trigger is always running (detecting arrow key events (its never deactivated)). I think that should cover all your questions.|||What if the lightning is currently at 5,6 and the player presses up? Does it jump to 2,3, or is it supposed to work its way around step by step?

What if the lightning is at 1,2 and the player presses left? Does it stay at 1,2?|||Quote:




What if the lightning is currently at 5,6 and the player presses up? Does it jump to 2,3, or is it supposed to work its way around step by step?




hmm, havnt thought of that. I guess it could go to either 5,4 or 6,1. Or not move at all. But if anything, to 5,4, for convenience ;p


Quote:




What if the lightning is at 1,2 and the player presses left? Does it stay at 1,2?




yes|||dont leave me hangin'!

;p|||Since the lightning can only move in two directions - either clockwise or counter-clockwise (or at least that's what it seems like from what you've said), the logical thing to do would be to just make it controlled only by the right and left arrow keys, with right arrow meaning clockwise and left arrow meaning counterclockwise. It's simpler for the player and a lot easier to code.

For example, if the lightning is spanning from 1-2, you can just have 1 and 2 replaced by variables high and low. Point[high] is 2, initially in this case. Then if the players pushes right arrow you set high = high +1 and low = low +1, if they press left arrow you set high = high -1 and low = low -1. Then you only need to worry about when high/low = 0, then set it to 6 and when high/low = 7, set it to 1.|||Quote:






View Post

Since the lightning can only move in two directions - either clockwise or counter-clockwise (or at least that's what it seems like from what you've said), the logical thing to do would be to just make it controlled only by the right and left arrow keys, with right arrow meaning clockwise and left arrow meaning counterclockwise. It's simpler for the player and a lot easier to code.

For example, if the lightning is spanning from 1-2, you can just have 1 and 2 replaced by variables high and low. Point[high] is 2, initially in this case. Then if the players pushes right arrow you set high = high +1 and low = low +1, if they press left arrow you set high = high -1 and low = low -1. Then you only need to worry about when high/low = 0, then set it to 6 and when high/low = 7, set it to 1.




thanks alot! it's so nice with an outside perspective!|||just updating to let you know that the map is nearing completion and it will be my first map to be released to the public :) you guys are of course on the credists list!

Thanks.

edit: done! it's a very small map, so as soon as i got those movement triggers done, it was basically finished :P

http://war3.incgamers.com/?p=mymods <-- download|||Quote:






View Post

dont leave me hangin'!




That's odd. I *did* post a reply. I guess I closed the preview post before I actually posted it.

Anyway, CHUNK said exactly what I tried to say. The mechanics of your perimeter would basically function like that old arcade game Tempest.

Edit: Actually, the link you posted only works for *you*.|||It will work for everyone in a second here. :P|||Quote:




Edit: Actually, the link you posted only works for *you*.




oh, well now it says "Approved" in nice green letters :p|||Wow, version 0.1 had quite a few faulty codes, im gonna fix them right now

fixed it!

I'm hosting it on the european battle.net once in a while and on there my nickname is "MEWTWO_o". Really satisfied atm. Upcoming changes will be adding a point system, a rematch system, a system for changing Runner speed based on the number of runners on the map, and a little more eyecandy to make the overall experiance more pleasant, and ofc, an option to set the number of lives!

wc3firetruck@hotmail.com for feedback!|||Update your map by going through "my maps" and editing them - don't just submit your update as a new map.|||Quote:






View Post

Update your map by going through "my maps" and editing them - don't just submit your update as a new map.




ah, k. sry. Any good advices for map protecting?|||I sometimes use ext.protect but I think I've found Vex's Optimizer actually does slightly better on compression for most things - so I use that now (since I am mainly worried about reducing map size).|||yea, im using this one http://www.wc3c.net/showthread.php?t=79326 atm, i guess that vex's. Im having difficulties understanding what to do though. Any tutorials anywhere?

Is there a trigger in existence that can change the model

Is there a trigger in existence that can change the model of the unit, but for the rest not affecting the unit?

I couldn't find it one google (I'm not such a good searcher.)

But maybe because It doesnt exist.

It can be either GUI or JASS, I don't care.|||Quote:






View Post

Is there a trigger in existence that can change the model of the unit, but for the rest not affecting the unit?

I couldn't find it one google (I'm not such a good searcher.)

But maybe because It doesnt exist.

It can be either GUI or JASS, I don't care.




You can pick the action "Replace unit" that will virtually change it's model, and you can then additionally choose to keep the old units statistics.

Note: If this unit is stored into a variable, don't worry, the information from the unit inside the variable will remain the same, so you don't have to worry into reasigning the unit's variable.|||Ok thanks for that solution

I guess I'll also need to trigger that the experience will be transferred for the hero, and the position, and the abilities, and the last action it needs to do. Sigh... It takes a lot of time this mapmaking. :/|||Why do you need a trigger - what's wrong with just using Bearform or Metamorphosis or any of those abilities that switches between two forms?

random points / integers not so random!?

hey. I got a trigger which sets an integer X to random number between 1 and 12 (at map init) and then places a unit in region[X], but my problem is that it's always the same region! Why is that? and how to fix it? it's a pretty crucial part of my map|||http://war3.incgamers.com/forums/sho...=random+number

?|||Search buttowned!

Hero bug cant put my finger on what it is.

Well basicly sometimes my heros just stop responding at all they go on patrol icon and then i cant do anything but kill em to unstuck. Also when i fight with the same hero i cant put my skills point unless i click 30 time.

does anyone have an idea how to fix this or perhaps what is the cause?

If required my map is in my signature if u want to know what i mean.

Also i can send the map unprot if needed.

Thanks for your time.

Get Corpse Autocast Trigger

if i want make a meat wagon enable/disable its "autocast" of the "get corpse" ability


Code:
call IssueImmediateOrderById( <unit>, 852051 )

seems not to working (get the id somewhere so i dont even know its right one)

and second

how detect if a unit has a ability activated like "Autocast" ability or such like burrow or defend.|||All those autocast abilities should have On and Off versions of simple orderstrings. Open the ability in the object editor and just find the correct "off" orderstring and issue that.

I'm not sure you can detect whether and ability is set to auto-cast or not - so if you are triggering something, you'll just have to use a flag of some sort to mark units that have autocast on/off (by flag I mean: unit group, boolean, custom value, etc).|||thx for the answers

unfortunate that was also my first idea but "get corpse" is the only auto cast abilities which has no such string in the WE neither via Trigger or in object editor only "loadcorpse".

But oddly it can be set as "default active abilitie" in the Unit Editor

When i tried to use make my own "loadcorpseoff" but it doesn't work.

Well the answers to my 2nd Question work.

edit: Thank you again it works now.|||The problem was, the order you were giving (#852051) turns autocast on for get corpse. To turn it off, you need to use #852052.


Code:
call IssueImmediateOrderById( <unit>, 852052 )

Tested it, it works.

Need help with AI editor and find a reason for the random crashes in custom map.

Ive been working on an old custom map I made. It has most basic units but as heroes rather than normal units.

The problem I'm running into is kind of basic and tohught that most of you out there have allready known how to fix this. The problem is that when the computer attacks it often runs away after the first hit which is kind of rediculous.

I'm also having a lot of other problems with the map; stuff like random crashing, Computer not using custom spells (or so it seems) and expierience being divided evenly reguardless of range (even after changing this in the gameplay constants window -->Hero XP - Global Distribution = False) and finally I cant figure out whats stopping me from playing this map (or any other with my custom object data imported on it) over a LAN.

I might try attatching the file if anyone wants to test it out and see whats causing it to crash. Just I need to condense the file a lot before i upload it. And just so you know theres a few triggers in there that i just left unedited that are pretty much useless (the coding is all wrong) but I keep them there to remember what I once wanted to do.

Edit: It failed to upload...could not upload the file types (.zip .wai .w3o .wtg or .wct) =( if you want them I can email them to you though.

Edit: the crashes definently seem to be related to the AI because when I play single player it hardly ever crashes. Only when the enemy does something (I'm not sure what) the game will crash without any error report or anything. I have tried saving and reloading but it gets to a point where when i load and play for about 5 seconds the game will crash every time i try to load. And it's allways after the exact same amount of time.

Imorting

i am having trouble importing models im not sure if i need a newer version of world editor or something but ive read a ton of tutorials and they all say to go to the import manager but i cant find it. ive looked everywhere even module where its supposed to be but its not there :/ plz help|||Perhaps you can specify what you are trying to import so we can help you a bit better.|||i am trying to import a skin|||sry not a skin a model but the import manager doesnt show on in the world editor|||When u press the green arrow it does not show or you dont find the import manager button?|||hotkey for that is F12 on default, when you import a model check the specifications of the models, sometimes you have to import an additional texture next to the model, and you might have to change the texture path of that texture import.|||btw i have RoC not frozen throne

How could I slim this trigger down? (jass)

hello i've got this trigger i think i could slim down using one of those kind of functions which you declare at the start of the map, for example if you have a lot of messages to display you could just call that function and then the message instead of writing the whole function. I think you guys know what i mean...

Anyways, that's what I would like to do with this beast:


Code:
function Trig_Init_Func001C takes nothing returns boolean
if ( not ( GetPlayerSlotState(Player(0)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return false
endif
return true
endfunction

function Trig_Init_Func002C takes nothing returns boolean
if ( not ( GetPlayerSlotState(Player(1)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return false
endif
return true
endfunction

function Trig_Init_Func003C takes nothing returns boolean
if ( not ( GetPlayerSlotState(Player(2)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return false
endif
return true
endfunction

function Trig_Init_Func004C takes nothing returns boolean
if ( not ( GetPlayerSlotState(Player(3)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return false
endif
return true
endfunction

function Trig_Init_Func005C takes nothing returns boolean
if ( not ( GetPlayerSlotState(Player(4)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return false
endif
return true
endfunction

function Trig_Init_Func006C takes nothing returns boolean
if ( not ( GetPlayerSlotState(Player(5)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return false
endif
return true
endfunction

function Trig_Init_Func007C takes nothing returns boolean
if ( not ( GetPlayerSlotState(Player(6)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return false
endif
return true
endfunction

function Trig_Init_Func008C takes nothing returns boolean
if ( not ( GetPlayerSlotState(Player(7)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return false
endif
return true
endfunction

function Trig_Init_Actions takes nothing returns nothing
if ( Trig_Init_Func001C() ) then
call SetPlayerStateBJ( Player(0), PLAYER_STATE_RESOURCE_GOLD, 100 )
call CreateNUnitsAtLoc( 1, 'Hpal', Player(0), GetRectCenter(gg_rct_Red), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_Init_Func002C() ) then
call SetPlayerStateBJ( Player(1), PLAYER_STATE_RESOURCE_GOLD, 100 )
call CreateNUnitsAtLoc( 1, 'Hpal', Player(1), GetRectCenter(gg_rct_Blue), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_Init_Func003C() ) then
call SetPlayerStateBJ( Player(2), PLAYER_STATE_RESOURCE_GOLD, 100 )
else
call CreateNUnitsAtLoc( 1, 'Hpal', Player(2), GetRectCenter(gg_rct_Teal), bj_UNIT_FACING )
call DoNothing( )
endif
if ( Trig_Init_Func004C() ) then
call SetPlayerStateBJ( Player(3), PLAYER_STATE_RESOURCE_GOLD, 100 )
call CreateNUnitsAtLoc( 1, 'Hpal', Player(3), GetRectCenter(gg_rct_Purple), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_Init_Func005C() ) then
call SetPlayerStateBJ( Player(4), PLAYER_STATE_RESOURCE_GOLD, 100 )
call CreateNUnitsAtLoc( 1, 'Hpal', Player(4), GetRectCenter(gg_rct_Yellow), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_Init_Func006C() ) then
call SetPlayerStateBJ( Player(5), PLAYER_STATE_RESOURCE_GOLD, 100 )
call CreateNUnitsAtLoc( 1, 'Hpal', Player(5), GetRectCenter(gg_rct_Orange), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_Init_Func007C() ) then
call SetPlayerStateBJ( Player(6), PLAYER_STATE_RESOURCE_GOLD, 100 )
call CreateNUnitsAtLoc( 1, 'Hpal', Player(6), GetRectCenter(gg_rct_Green), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_Init_Func008C() ) then
call SetPlayerStateBJ( Player(7), PLAYER_STATE_RESOURCE_GOLD, 100 )
call CreateNUnitsAtLoc( 1, 'Hpal', Player(7), GetRectCenter(gg_rct_Pink), bj_UNIT_FACING )
else
call DoNothing( )
endif
endfunction

//===========================================================================
function InitTrig_Init takes nothing returns nothing
set gg_trg_Init = CreateTrigger( )
call TriggerAddAction( gg_trg_Init, function Trig_Init_Actions )
endfunction

i know it's probably not THAT huge but I think i could learn something from this.|||You need a For Loop and those regions placed into an array. After that, it should be pretty simple.|||Quote:






View Post

You need a For Loop and those regions placed into an array. After that, it should be pretty simple.




okay ^^ thanks|||Code:
function Trig_FireTrucks_Trigger_Actions takes nothing returns nothing
local integer i = 0
local integer iend = 7
loop
exitwhen i > iend
if ( GetPlayerSlotState(ConvertedPlayer(i)) == PLAYER_SLOT_STATE_PLAYING ) then
call SetPlayerStateBJ( ConvertedPlayer(i), PLAYER_STATE_RESOURCE_GOLD, 100 )
call CreateNUnitsAtLoc( 1, 'Hpal', ConvertedPlayer(i), udg_RegionPoint[i], bj_UNIT_FACING )
else
endif
set i = i + 1
endloop
endfunction

Here's an example of how your trigger probably should look, since I wasn't specific. You'd need a point variable array where each point has been assigned (center of region for the player) at map initialization using the JASS enumeration of the player (i.e. Player 1 = 0). As you can see, I collapsed the player codes all down to one line each using a For Loop and collapsed the condition down to a single in-line condition, since I wanted to switch the loop over to a local variable instead of the For Loop integer global.

If you are going to convert from GUI, make good GUI first (e.g. use For Loops and variable arrays for player-related stuff). Also, your original code was leaking points for the region references, so switching to a global variable array for points will make it easy to clean those up if you aren't using center of the players' regions again.

As a very side note, you can make the function part of this code even a little tighter if you are an obsessed code-monkey. For example, the functions that end with BJ (example: SetPlayerStateBJ) usually just call the native function, which is identical except the arguments are arranged in a less straight-forward manner. By using the non-BJ form your code makes fewer function calls. It's really not worth the effort, but code-monkeys are obsessed and obsession usually interferes with effort exerted vs. results. There's also a native function that CreateNUnits calls, which creates each unit one at a time, for example. You should probable work your way into that level of obsession slowly, though.|||ok, thanks again.


Quote:




so switching to a global variable array for points will make it easy to clean those up if you aren't using center of the players' regions again.




hmm, kk but i wonder why globals are easier to clean up / nullify than locals. would be nice if you or someone else could tell me. also, from what i've learned 0.00 / 0 nullifies a real / integer, right? if so, why is 0 easier for a computer to keep in mind than for example 3?

edit: i tried that out, but I stumbled upon trouble imediatley (<- spelling?)... im not sure how to declare a region array variable. I tried searching for it on google but didnt find it. Im thinking something like
Code:
set udg_region array [0]

but im not sure whether to put 0 or 7 in the "[x]"(min or max?) also, should there be a " = y" after the
Code:
set udg_region array [x]

? and if so, what should it say instead of y? Im guessing 0?

edit2: okay, i came this far on my own:


Code:
    local integer i = 0
set udg_regions[i] = gg_rct_0

i renamed the regions to 0,1,2,3,4,5,6 and 7. i was foolish enough to think that i could just use
Code:
gg_rct_i

and that would give all the regions. But, no. and that's why i need some moar help :P for short: how to declare that region array variable thing, and what how come (following is from your code)
Code:
 udg_RegionPointt[i]

works. I mean, how did you get the
Code:
i

in there?

edit3: the trigger atm:


Code:
function Trig_Init2_Actions takes nothing returns nothing
local integer i = 0
set udg_regions[i] = GetRectCenter(gg_rct_0)
loop
exitwhen i > 7
if ( GetPlayerSlotState(ConvertedPlayer(i)) == PLAYER_SLOT_STATE_PLAYING ) then
call SetPlayerStateBJ( ConvertedPlayer(i), PLAYER_STATE_RESOURCE_GOLD, 100 )
call CreateNUnitsAtLoc( 1, 'Hpal', ConvertedPlayer(i), udg_regions[i], bj_UNIT_FACING )
call DisplayTimedTextToForce(GetPlayersAll(), 2, "you have gained 100 gold!" ) //<- just 4 testing
else
endif
set i = i + 1
endloop
endfunction



//===========================================================================
function InitTrig_init2 takes nothing returns nothing
set gg_trg_init2 = CreateTrigger( )
call TriggerAddAction( gg_trg_init2, function Trig_Init2_Actions )
endfunction

if i disable / enable this one, the editor finds no problems at all, but when I run the map, i get a FATAL ERROR. oh well|||Quote:






View Post

but i wonder why globals are easier to clean up / nullify than locals. would be nice if you or someone else could tell me.




They aren't. You weren't making any attempt to clean leaks in the initial trigger - my point was just that if you made them globals (instead of just letting them leak) they would be easier to clean.


Quote:






View Post

from what i've learned 0.00 / 0 nullifies a real / integer, right? if so, why is 0 easier for a computer to keep in mind than for example 3?




Whoever told you that doesn't know what they are talking about. Integers and reals don't leak and therefore they don't need to be "nullified". I don't get why it is still such a mystery to people what leaks are and why things leak. Leaks are created by referencing objects that haven't been created yet. Since integers and reals aren't objects, they are numbers, there is nothing being created - they are just values being set. Your question exemplifies the point exactly - why would it be any easier for a computer to remember 0 or 3? It wouldn't be.


Quote:






View Post

im not sure how to declare a region array variable.




How about going into the variable editor and creating the variable and clicking on array... like every other time you have ever made a global variable?


Quote:






View Post

im not sure whether to put 0 or 7 in the "[x]"(min or max?)




You don't need to set the initial size of region or point arrays. There are very few variable types that require you to set their size at initialization.

If you had read my post a little more closely, you would have realized that I am recommending point variable arrays (not regions) and that somewhere else (i.e. not in this trigger, but at map initialization) you should fill the value of these points with 'center of region' values.


Quote:






View Post

how did you get the
Code:
i

in there?




I typed it in there. In this case "i" is the same as IntegerA in a For Loop (GUI), except I replaced it with a local variable that I declared.

You could make this entire trigger without JASS - and I think you should try that before you try the JASS version, since you seem to be having so much trouble with the fundamentals (like creating a global variable) and basic argument types - for example, you are trying to create a unit at a region instead of a point, which is probably why you got a fatal.

One of the primary reasons they made the GUI, instead of just forcing all map-makers to learn the underlying language, is because it keeps track of the argument types for you and it's harder to screw things up that way. I'm not sure if you are just trying to learn JASS to learn it or if there is something you think you might accomplish with JASS that you wouldn't be able to with GUI. Just because someone thinks JASS is cooler doesn't mean you should be using it - you should use whatever you are most comfortable with, unless there is something you feel you just can't do with GUI. Sometimes that's the case, but it's fairly rare.|||Quote:




Whoever told you that doesn't know what they are talking about. Integers and reals don't leak and therefore they don't need to be "nullified". I don't get why it is still such a mystery to people what leaks are and why things leak. Leaks are created by referencing objects that haven't been created yet. Since integers and reals aren't objects, they are numbers, there is nothing being created - they are just values being set. Your question exemplifies the point exactly - why would it be any easier for a computer to remember 0 or 3? It wouldn't be.




ok. thanks for clearing that up :) sry 4 the joke, couldnt resist.


Quote:




You don't need to set the initial size of region or point arrays. There are very few variable types that require you to set their size at initialization.

If you had read my post a little more closely, you would have realized that I am recommending point variable arrays (not regions) and that somewhere else (i.e. not in this trigger, but at map initialization) you should fill the value of these points with 'center of region' values.




yes, i know, sry. I noticed that later. my bad.. (3 minutes of thinking later)... oh! i get it! im not using a variable to declare the points, i should use a variable to referance the points. So i type
Code:
set udg_regions[0] = GetRectCenter(<region0>)


Code:
set udg_regions//just the name of the variable, this is indeed a point variable[1] = GetRectCenter(<region1>)

and so on... and then when i want to referance these points I type
Code:
call CreateNUnitsAtLoc( 1, 'Hpal', ConvertedPlayer(i), udg_RegionPoint[i], bj_UNIT_FACING )

...I hope for both our sanity's sake i've got it right now.


Quote:




One of the primary reasons they made the GUI, instead of just forcing all map-makers to learn the underlying language, is because it keeps track of the argument types for you and it's harder to screw things up that way. I'm not sure if you are just trying to learn JASS to learn it or if there is something you think you might accomplish with JASS that you wouldn't be able to with GUI. Just because someone thinks JASS is cooler doesn't mean you should be using it - you should use whatever you are most comfortable with, unless there is something you feel you just can't do with GUI. Sometimes that's the case, but it's fairly rare.




for a number of reasons....

1 for future mapmaking - i might need it later if not now

2 i figure not forcing the program to translate GUI triggers to jass (not sure if they have to, if im wrong please correct me) would reduce lag and make the map smoother overall?

3 i'm kind of a perfectionist and want my maps to be as well done as possible

4 i'm curious and fascinated.

edit: solved the fatal error.|||Quote:






View Post

i figure not forcing the program to translate GUI triggers to jass (not sure if they have to, if im wrong please correct me) would reduce lag and make the map smoother overall?




When you hit "save" on any map in GUI, the map compiles that code into JASS. Unless you mean you don't want to wait as long while the map saves after you hit the save button, then you aren't forcing anything to convert.

In other words, all maps "play" in JASS, regardless of how they are originally encoded. The letters GUI stand for guided user interface - they are just that - a user interface for JASS. This concept that programming in GUI somehow makes a map slower is based on programming nerds who are running hundreds or thousands of actions in a second and watching to see how the two differ in terms of fractions of seconds. The only people who should care about those sorts of things are people with crap computers who probably can barely run WC3 (and even then, it's debatable).

Using JASS to write the code is slightly cleaner (fewer functions are called to perform the same actions) if you do it well - but writing something in JASS doesn't inherently make it better or faster. Code monkeys care, but the people playing your map won't notice any difference in almost every case. And since you should be making maps for people to play rather than as abstract works of code, it only matters to you how you make something work (and that it actually works how you intend it to). For a lot of people, who are used to programming languages, writing stuff in JASS is more natural or faster - but that doesn't make it better.

I'm not trying to discourage you - I think it is useful to know JASS (obviously). I just sometimes wonder why people would struggle with it so much that they become discouraged when it usually doesn't provide an equivalent measure of utility for them.


Quote:






View Post

i'm kind of a perfectionist and want my maps to be as well done as possible




Trust me when I say that it is more important for your map to be "done" than "well-done". The number of maps that code monkeys (or anyone for that matter) start but fail to complete is massive. You put yourself into a much better position if you "complete" a map and then revise the coding efficiency than you ever would trying to make the coding perfect first and try to complete a map. Some of the best maps are made by people with no understanding of JASS. Like I said before, good design is hard - good coding is (relatively) easy.|||ok, chunk ill definately absorb that and see where it goes. im not promising anything though! :P

anyways, i think i've definately learned something from this thread|||lol I just read my posts in here and it's a wonder you even come close to understanding what i mean. I'm not making myself clear at all xD