Not entirely sure what you're trying to do. Can you just use "run trigger" in your other trigger? Or make your new trigger an action definition instead?
I don't know. Maybe I could.
The thing is, I'm used to the WC3 editor, and it's (obviously) not the same thing as the SC2 editor.
Maybe there's a better/easier/more efficient way to do this, but this is the way I'm used to do it:
Step 1. Create a Unit Group
Step 2. Add units to <Unit_Group>
3. For every unit in <Unit_Group>, do...
4. Add (Picked Unit) to event: "TriggerAddEventUnitRange"
What this will do is: Whenever ANOTHER (matching condition) unit comes within range of a unit from <Unit_Group> - something will happen.
Why would I do all this, you may ask? In case I decide to add many, many units to <Unit_Group>, this is an efficient way to add each and every one of them to the trigger.
Like I said: maybe there's an easier way to do this in the new editor which I don't know about. In that case feel free to inform me, I would love to learn. =)
It is called "Veiw Script" under the Data menu and shows you the entire map script. It is built 1 second after you make any change to GUI so no need to save.
Yes that should work. Do remember that "1.0" is 1 tile. Also it will fire when any unit enters range of the unit returned by UnitGroupLoopCurrent which depending on how many units receive this event could possibly lead to performance problems.
How many (ish) are we talking about for performance issues? 10? 100? 1000? 10000?
I know every little thing adds up and all that, but I would like to get a basic idea of how much I've got to work with. :P
Dynamic event attachment is not supported by GUI. You will need to use "custom script" features to directly call the event attachment natives. You could also write a GUI wrapper for them but this still requires understanding the custom script feature.
I have a basic understanding. I used to do a lot of map editing in Warcraft III, but the editor in SC2 is so different.
You call it like you would any other native function. This is similar to a classic c function call (tutorials how to make such calls litter the internet as C is a major language).
I need to know some of the data. Such as the name of the trigger that I want to add this event to. In WC3 there used to be a function "convert trigger to custom text" - which allowed me to find out these kind of things. I haven't seen any function like that in SC2, though.
Of important note is that u is a unit reference so you will need to wrap a unit as a unit reference when passing it as an argument. Use null to represent any unit however you probably need to define the origin unit as some unit for the event to work. Quote:
I figured one of the units would be the specific unit I'm checking for, and the other unit would be the one that comes within range?
EDIT:
I found ctrl+F11 which fits my need for "convert to custom script".
UPDATE:
Here's what I want to do:
In Map init:
-add a bunch of units (manually) to a unit group
-loop through the unit group
-throw in this script:
Hello.
I'm trying to create a trigger without an event.
I want to add an event from another trigger.
Here's what I want to do:
Pick a unit group. Loop through the group. Add each of the units in that unit group to an event doing: 'A unit gets within X range of (Picked unit)'.
I can't find any action that suits my purpose, though.
I found this on google:
native void TriggerAddEventUnitRange (trigger t, unitref u, unit fromUnit, fixed range, bool state);
I think this is what I'm looking for, but I don't know how to use it.
EDIT: I don't have Heart of the Swarm, if that matters.
I am currently working on a map that is a rip-off of the FF-series.
Why? -Because I love the old games in the series and think the newer ones are crap, so I wanted to make a "new FF game old school style." (Mostly inspired by FFVII.)
I haven't done much, there's still a lot to be done. Here's what I've done so far, gathered in a short youtube clip:
I want to hear your thoughts on the clip.
Does it look promising? Would you want to play a map like this, once it's done?
Does anything look weird? (Keep in mind that this map is still very early in development.)
I am mostly focusing on re-creating the old school combat system that FFVII had. Thoughts on the combat system is much appriciated.
I'm trying to make a menu (using dialogs) with an inventory (and other stuff).
My first idea was to make some sort of a list so that I can easily add/remove items from the list and use data from the list to populate the dialog windows.
The problem is I don't know how to make a list like that, or if it's even possible?
How can I make such a list? If it's impossible: how would you suggest I make my inventory?
1. When an Ursadak dies on my map, it leaves a big pile of junk (death animation - explode). This is all very nice and funny, but since I use and kill a lot of Ursa's, it gets cluttered easily.
Is there any simple way to clean up this bloody mess? (I've tried waiting a few seconds and "Remove unit", but it doesn't work, for some reason.)
2. I need a unit that looks like a projectile. -Preferably a spiky cannonball.
I haven't been able to find any unit/model like this, and need help in doing so.
(A rocket/missile could work as well, I guess.)
The object of the "cannonball" is to travel straight forward and explode, killing anything it touches.
(Custom value 0 of Hero[i]) != 1.0 Hero[i] != No Unit
Basically you are saying to the editor that No unit has a custom value of 1.. You must have a unit there. You also have a function that moves a unit, and it will only run if Hero[i] = No Unit, so it does not execute.
Second, create the following AFTER the If/Then/Else: Set i = 0, otherwise, i will increase by 4 every time the trigger runs (4, 8, 12, etc).
You need to learn how triggers work.
The condition:
Hero[i] != No Unit
means:
if Hero[i] is Not equal to No Unit (null)
meaning:
if Hero[i] is Actually a unit (any unit)
then... Do actions..
I agree that checking the custom value is a bit off, but it's the easiest way I can work around checking terrain texture at point. (Since it's missing in SC2, for some weird reason..)
Since i is a local variable it will create a new one for each trigger, every time the trigger runs.
i is initialized as 0. So no, it won't increase everytime a trigger runs. (It can even run two triggers at the same time, without interfering with each other, since it's local. Unlike global.)
So anyway. I fixed my debug message by changing the trigger a bit (it now works better with my map, so it was a win-win.)
My real problem still remains, however; the units still spin around in circles for no apparent reason.
Pausing the units is sadly not an option, since they are "heroes" and the players has to be able to move them around.
EDIT: Why does these forums fuck up my text when I press enter?
(The Custom value check is there to see if the unit is not in a certain area - as comparing terrain at point isn't available in SC2.)
First of all: This trigger gives me debug messages. Saying "try again". I imagine this message appears every 0.1 seconds, so it doesn't go away.
I figured this was because I only have 1 Hero assigned, but I thought my 'Hero[i] != No Unit' -condition would take care of that.
Secondly: My hero goes straight forward for a random amount of time (ie working as intended.) Then, all of a sudden (completely random) the hero turns on it's own. Some times it ends up spinning around in a very tight circle, round and round.
I figured this might be because the hero's idle animation makes it turn and look left and right. -Any way to prevent this?
Bonus question:
Is there a way to draw terrain using triggers?
Thanks in advance.
EDIT: Actually, it seems like everytime I order the unit to move while sliding, it starts spinning when it reaches it's destination. No idea why.
0
I don't know. Maybe I could. The thing is, I'm used to the WC3 editor, and it's (obviously) not the same thing as the SC2 editor. Maybe there's a better/easier/more efficient way to do this, but this is the way I'm used to do it:
Step 1. Create a Unit Group Step 2. Add units to <Unit_Group> 3. For every unit in <Unit_Group>, do... 4. Add (Picked Unit) to event: "TriggerAddEventUnitRange"
What this will do is: Whenever ANOTHER (matching condition) unit comes within range of a unit from <Unit_Group> - something will happen.
Why would I do all this, you may ask? In case I decide to add many, many units to <Unit_Group>, this is an efficient way to add each and every one of them to the trigger.
Like I said: maybe there's an easier way to do this in the new editor which I don't know about. In that case feel free to inform me, I would love to learn. =)
EDIT:
Thanks. =)
How many (ish) are we talking about for performance issues? 10? 100? 1000? 10000? I know every little thing adds up and all that, but I would like to get a basic idea of how much I've got to work with. :P
0
I have a basic understanding. I used to do a lot of map editing in Warcraft III, but the editor in SC2 is so different.
I need to know some of the data. Such as the name of the trigger that I want to add this event to. In WC3 there used to be a function "convert trigger to custom text" - which allowed me to find out these kind of things. I haven't seen any function like that in SC2, though.
I figured one of the units would be the specific unit I'm checking for, and the other unit would be the one that comes within range?
EDIT: I found ctrl+F11 which fits my need for "convert to custom script".
UPDATE: Here's what I want to do: In Map init: -add a bunch of units (manually) to a unit group -loop through the unit group -throw in this script:
TriggerAddEventUnitRange (gt_TradingStationRange, null, UnitGroupLoopCurrent(), 1.0, true);
Will this work? "null" represents "Any Unit gets within range of ...", right? Will gt_<trigger_name"> suffice?
0
Hello. I'm trying to create a trigger without an event. I want to add an event from another trigger.
Here's what I want to do: Pick a unit group. Loop through the group. Add each of the units in that unit group to an event doing: 'A unit gets within X range of (Picked unit)'.
I can't find any action that suits my purpose, though.
I found this on google: native void TriggerAddEventUnitRange (trigger t, unitref u, unit fromUnit, fixed range, bool state); I think this is what I'm looking for, but I don't know how to use it.
EDIT: I don't have Heart of the Swarm, if that matters.
0
Hi.
I am currently working on a map that is a rip-off of the FF-series. Why? -Because I love the old games in the series and think the newer ones are crap, so I wanted to make a "new FF game old school style." (Mostly inspired by FFVII.)
I haven't done much, there's still a lot to be done. Here's what I've done so far, gathered in a short youtube clip:
I want to hear your thoughts on the clip. Does it look promising? Would you want to play a map like this, once it's done? Does anything look weird? (Keep in mind that this map is still very early in development.) I am mostly focusing on re-creating the old school combat system that FFVII had. Thoughts on the combat system is much appriciated.
Thanks in advance.
0
Hi.
I want to prevent certain units from responding when I select them, using triggers. Does anyone know how to do this?
Thanks.
0
Hi.
I'm trying to make a menu (using dialogs) with an inventory (and other stuff). My first idea was to make some sort of a list so that I can easily add/remove items from the list and use data from the list to populate the dialog windows. The problem is I don't know how to make a list like that, or if it's even possible?
How can I make such a list? If it's impossible: how would you suggest I make my inventory?
Thanks in advance.
0
I would love to be able to compare texture at certain points. (To be used to kill units when they enter a certain texture, for example lava.)
0
I can't say it good enough, so I'm gonna let Anakin say it for me:
Thank you very much. =)
0
I do hide and show game UI, but not World.
0
I have no idea what you're talking about.
I just want to change the model of any existing unit to that of a missile. In WC3 this was done in 3 seconds.
0
1. Problem solved. Thank you very much. =)
2. I have no idea how to change the model of a unit. =/
0
Hi.
I have two questions:
1. When an Ursadak dies on my map, it leaves a big pile of junk (death animation - explode). This is all very nice and funny, but since I use and kill a lot of Ursa's, it gets cluttered easily. Is there any simple way to clean up this bloody mess? (I've tried waiting a few seconds and "Remove unit", but it doesn't work, for some reason.)
2. I need a unit that looks like a projectile. -Preferably a spiky cannonball. I haven't been able to find any unit/model like this, and need help in doing so. (A rocket/missile could work as well, I guess.)
The object of the "cannonball" is to travel straight forward and explode, killing anything it touches.
0
You need to learn how triggers work.
The condition: Hero[i] != No Unit
means:
if Hero[i] is Not equal to No Unit (null)
meaning:
if Hero[i] is Actually a unit (any unit)
then... Do actions..
I agree that checking the custom value is a bit off, but it's the easiest way I can work around checking terrain texture at point. (Since it's missing in SC2, for some weird reason..)
Since i is a local variable it will create a new one for each trigger, every time the trigger runs. i is initialized as 0. So no, it won't increase everytime a trigger runs. (It can even run two triggers at the same time, without interfering with each other, since it's local. Unlike global.)
So anyway. I fixed my debug message by changing the trigger a bit (it now works better with my map, so it was a win-win.)
My real problem still remains, however; the units still spin around in circles for no apparent reason. Pausing the units is sadly not an option, since they are "heroes" and the players has to be able to move them around.
EDIT: Why does these forums fuck up my text when I press enter?
0
Hi.
I'm having a bit of problem with my sliding trigger. First off, here's the trigger:
(The Custom value check is there to see if the unit is not in a certain area - as comparing terrain at point isn't available in SC2.)
First of all: This trigger gives me debug messages. Saying "try again". I imagine this message appears every 0.1 seconds, so it doesn't go away. I figured this was because I only have 1 Hero assigned, but I thought my 'Hero[i] != No Unit' -condition would take care of that.
Secondly: My hero goes straight forward for a random amount of time (ie working as intended.) Then, all of a sudden (completely random) the hero turns on it's own. Some times it ends up spinning around in a very tight circle, round and round. I figured this might be because the hero's idle animation makes it turn and look left and right. -Any way to prevent this?
Bonus question: Is there a way to draw terrain using triggers?
Thanks in advance.
EDIT: Actually, it seems like everytime I order the unit to move while sliding, it starts spinning when it reaches it's destination. No idea why.
0
I can tell you all right now that it's not a trigger error. What I need help with is those damned Game Variants. =/