So I am trying to understand these and how to know when I should do one over the other? Some questions:
1. Can the trigger code do anything the event code can do? I was noticed some of the predefined effect functions are not listed in the trigger functions.
2. Can I set something in an effect that run a trigger? Flag field or something?
3. I get confused often in the effects because I can get them to do one thing like play animation from a specific frame or pause animation but how do I get them to do both? If I say to play animation from certain frame but then say also to pause, the pause takes effect and it never plays the animation from
the specific frame? How would I say to play the animation and when it is done THEN pause the animation?
4. Triggers, the default ones that set up things like stale mate. If I want to change these do I copy them from the top left section to the bottom left section and change them to fit my needs or do I change the default ones?
5. Triggers, I have gotten triggers to do certain things to a unit but in doing so I had to select that exact unit in the code. I don’t understand how I could get the same code to work for whatever unit was selected versus picking a specific unit on the map.
6. In general can someone give me an overview of when and why I would attempt something in the data editor versus using triggers?
2. No, but you can use the "unit uses ability" event.
3. This is a tough one. You are going to need to go into actor data to get something like this to work properly and consistently, not just an effect.
4. I do not understand the question. Are you talking about the raw code for the melee init triggers? If so, just modify them. It is harder than you would think though to do correctly.
5. Use variables and referenced like "triggering unit" or "created unit", depending on what you need. If you are trying to use something like "any unit does blank", and change the any unit, don't. Make a condition that checks if the unit is what you want it to be.
6. This is almost 100% preference. If you like triggers, use triggers. If you like data, use data. However there are cases where one makes more sense than the other. Picking each unit in a region and killing it is better done with triggers. Having a unit cast an ability is better done with data. An example could be Tug of War. You can make a trigger that picks each building in a certain location and then makes a unit at it. Or you could give each building a behavior that periodically makes a unit. That is preference. Ordering those units to attack the other team would be a trigger job, and then setting up the autocast system of the units would be a data job.
So I am trying to understand these and how to know when I should do one over the other? Some questions: 1. Can the trigger code do anything the event code can do? I was noticed some of the predefined effect functions are not listed in the trigger functions.
2. Can I set something in an effect that run a trigger? Flag field or something?
3. I get confused often in the effects because I can get them to do one thing like play animation from a specific frame or pause animation but how do I get them to do both? If I say to play animation from certain frame but then say also to pause, the pause takes effect and it never plays the animation from the specific frame? How would I say to play the animation and when it is done THEN pause the animation?
4. Triggers, the default ones that set up things like stale mate. If I want to change these do I copy them from the top left section to the bottom left section and change them to fit my needs or do I change the default ones?
5. Triggers, I have gotten triggers to do certain things to a unit but in doing so I had to select that exact unit in the code. I don’t understand how I could get the same code to work for whatever unit was selected versus picking a specific unit on the map.
6. In general can someone give me an overview of when and why I would attempt something in the data editor versus using triggers?
1. What?
2. No, but you can use the "unit uses ability" event.
3. This is a tough one. You are going to need to go into actor data to get something like this to work properly and consistently, not just an effect.
4. I do not understand the question. Are you talking about the raw code for the melee init triggers? If so, just modify them. It is harder than you would think though to do correctly.
5. Use variables and referenced like "triggering unit" or "created unit", depending on what you need. If you are trying to use something like "any unit does blank", and change the any unit, don't. Make a condition that checks if the unit is what you want it to be.
6. This is almost 100% preference. If you like triggers, use triggers. If you like data, use data. However there are cases where one makes more sense than the other. Picking each unit in a region and killing it is better done with triggers. Having a unit cast an ability is better done with data. An example could be Tug of War. You can make a trigger that picks each building in a certain location and then makes a unit at it. Or you could give each building a behavior that periodically makes a unit. That is preference. Ordering those units to attack the other team would be a trigger job, and then setting up the autocast system of the units would be a data job.
Great to be back and part of the community again!