Hey guys. I have a trigger that spawns terran buildings, and then lowers their health percent into the red. They make fire noises, but no visible fire is seen.
I've tried using "Actor - Send message "AnimPlay {} Fire" to actor (Actor for (Last created unit))"
Also tried attacking the building with a regular unit while it was in the red.
What I want to happen in map: Player comes to the entrance of a base of an ally of which he has shared vision. The buildings are created with their low health, as well as some zerg units who are attacking the base.
Edit: Btw, I'm using "Unit - Set (Last created unit) Life (Percent) to (Random real between 10.0 and 40.0)" for the building damage.
For flames on terran buildings you should look into State Monitor actors, which are connected to Unit validators to monitor the unit they are created on and change states based on these validators at a set interval. To add new units to go up in flames while on low health go into the Events field of the correct State Monitor (for terran there are for example 3 different monitors for building size, small/medium/large) and add a new UnitCreation.YourUnit -> Create event.
Another relevant actor type that you can look into is the Queried actor type, although it's not entirely necessary if you aren't using custom built models or models that aren't already used with low HP flames etc.
edit:
I know this is the Trigger forum. Since all you have to do is to add one Actor Event per building into the already existing State Monitors I don't care about that though. Don't do it with Triggers.
After taking a look at the monitor actors, I came up with this, "Actor - Send message "Create TerranFlameSetFire" to actor (Actor for (Last created unit))". It seems to word just fine. It even does smoke instead of fire on the buildings that aren't that far down on health. Even healing and destruction of the building works properly as far as fire goes.
I'm probably around a beginner level when it comes to data, and intermediate with triggers, so I'm wondering, why would this approach be considered worse? It's just one line (used in a loop).
Hmm, in general it doesn't really matter whether you use triggers or data. If you are more comfortable using triggers and you get to the result that you want then everything is fine. By using the "Send Actor Message" action you are already basically using the Data Editor though, it is pretty much the same thing as adding Actor Events, Trigger and Data Editor overlap in this area quite a bit.
When I said "don't do it with triggers" I thought about making the whole thing with triggers by attaching flame model actors at semi-random attachment points. Which is what the actors already are built for, and it would be redundant to make the whole thing with Triggers.
I'm surprised that using the Queried type TerranFlameSetFire works for getting smoke to show around half health before flames show up though, as far as I understand it that shouldn't happen. But again, as long as you get to the result that you wanted with little effort everything is fine.
i disagree. Data seems to be faster with repetitive actions like players health. the creation of the fire inst an issue its the event needed to achieve it will add more to the lag of the game than data.
Well, there's already going to be an event that spawns the buildings (probably will end up being a simple enter region event). Also it's a single player map, so lag is usually less of an issue.
I have seen posts about creating efficient code/triggers though... It's pretty hard for me to figure out since I don't have any experience in coding.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hey guys. I have a trigger that spawns terran buildings, and then lowers their health percent into the red. They make fire noises, but no visible fire is seen.
I've tried using "Actor - Send message "AnimPlay {} Fire" to actor (Actor for (Last created unit))" Also tried attacking the building with a regular unit while it was in the red.
What I want to happen in map: Player comes to the entrance of a base of an ally of which he has shared vision. The buildings are created with their low health, as well as some zerg units who are attacking the base.
Edit: Btw, I'm using "Unit - Set (Last created unit) Life (Percent) to (Random real between 10.0 and 40.0)" for the building damage.
@MaskedImposter: Go
This is an actor issue. it should be posted in data. but you can do a work around in triggers but its sloppy
you can create terrain building fire at possition of the unit when the health is low using triggers.
For flames on terran buildings you should look into State Monitor actors, which are connected to Unit validators to monitor the unit they are created on and change states based on these validators at a set interval. To add new units to go up in flames while on low health go into the Events field of the correct State Monitor (for terran there are for example 3 different monitors for building size, small/medium/large) and add a new UnitCreation.YourUnit -> Create event.
Another relevant actor type that you can look into is the Queried actor type, although it's not entirely necessary if you aren't using custom built models or models that aren't already used with low HP flames etc.
edit:
I know this is the Trigger forum. Since all you have to do is to add one Actor Event per building into the already existing State Monitors I don't care about that though. Don't do it with Triggers.
After taking a look at the monitor actors, I came up with this, "Actor - Send message "Create TerranFlameSetFire" to actor (Actor for (Last created unit))". It seems to word just fine. It even does smoke instead of fire on the buildings that aren't that far down on health. Even healing and destruction of the building works properly as far as fire goes.
I'm probably around a beginner level when it comes to data, and intermediate with triggers, so I'm wondering, why would this approach be considered worse? It's just one line (used in a loop).
Hmm, in general it doesn't really matter whether you use triggers or data. If you are more comfortable using triggers and you get to the result that you want then everything is fine. By using the "Send Actor Message" action you are already basically using the Data Editor though, it is pretty much the same thing as adding Actor Events, Trigger and Data Editor overlap in this area quite a bit.
When I said "don't do it with triggers" I thought about making the whole thing with triggers by attaching flame model actors at semi-random attachment points. Which is what the actors already are built for, and it would be redundant to make the whole thing with Triggers.
I'm surprised that using the Queried type TerranFlameSetFire works for getting smoke to show around half health before flames show up though, as far as I understand it that shouldn't happen. But again, as long as you get to the result that you wanted with little effort everything is fine.
@Bommes: Go
i disagree. Data seems to be faster with repetitive actions like players health. the creation of the fire inst an issue its the event needed to achieve it will add more to the lag of the game than data.
Well, there's already going to be an event that spawns the buildings (probably will end up being a simple enter region event). Also it's a single player map, so lag is usually less of an issue.
I have seen posts about creating efficient code/triggers though... It's pretty hard for me to figure out since I don't have any experience in coding.