Posted: Fri Sep 22, 2023 4:03 pm Post subject:
Check if specific unit is standing on a cell
Subject description: Similar to engineer "working" on a machine on missions
I'm trying to get a technician, once mindcontrolled, move to a construction site and build a Grinder. I've already tried Enter By... but that's house specific so Yuri Clones can activate the trigger. I think it's something similar to Engineer "fixing" machines on missions. QUICK_EDIT
as in you want the engineer to go to a certain place, and then dissapear as a building appears? _________________ visit my moddb profile for .shp downloads and stuff QUICK_EDIT
Both actually. But originally I was going to make the technician go to a tent and the tent disappears along with the technician but that got complicated since selling the tent just eject the technician outside.
That seemed simpler since I could just detect the technician going to a building but detecting specific units in a cell is a lot useful to know. QUICK_EDIT
That's what I did already. But I need the technician to specifically be the one to activate it but everything that the house specified owned can activate it including the Yuri Clones. That's the problem I have on another mission where I need only the units I need to save need to touch the cell but it could also be activated by any unit I have which is not good for the "mission complete".
If this is for the AI then you just need to design the AI & map so they wont go near the celltag until you want them too.
If this is for player controlled units then it's a lot more complicated as they have freedom of movement. The best option would probably be the tent idea you originally had. Make the technician an engineer & the tent captureable, then add a trigger that fires when it captures the tent. _________________
Giving the player engineer is gonna be a problem. Also, I need specific units to be detected since that is also a problem my first mission where specific units needed to be saved and not just reach the goal by any unit.
I remember a mission in Red Resurrection where you need to put the engineers near a machine to deactivate it. That is pretty much what I needed for both of my mission currently. QUICK_EDIT
You could also make a separate house just for the specific units, then the triggers will only fire then those units reach the target. That wont work if you want the unit to be mind controlled by Yuri tho... _________________
you could use the trigger event 'moves near waypoint', which is attached to the specific unit/team that you want to cause the trigger to fire.
i suggest doing this:
attach the 'move near' trigger to the engineer and also make it recruitable
make a recruiter=yes team consisting of just the engineer scripted to move to the tent, set a local variable, and delete itself
make the trigger that has the 'move near' event use action 4 to recruit the engineer into said team
make a trigger with the event being the local variable and the action being to remove the tent, build grinder
so when the engineer gets near the tent waypoint, it will automatically get recruited into a team and go to the tent and disappear giving
the image of entering the tent, in the process it will fire another trigger making the tent get destroyed and the grinder get created.
one note is that if the engineer is given another order after it gets recruited, the script will break. you can lock input, change engineer
house, or make the recruitment trigger repeat with a small time delay until the second trigger fires to solve this. _________________ visit my moddb profile for .shp downloads and stuff QUICK_EDIT
I see... So there's no way to check specific units. But how do you delete the engineer? Did you mean go inside the tent, commit suicide or destroy attached object? Is there a way to delete a unit, like just get removed from the game without being killed or dying?
If you meant the engineer capturing the tent then that is what I was trying to avoid. My original plan was to make the technician garrison the building and that gets detected and trigger to destroy the tent and build the Grinder but the technician just comes back out.
The reason why it was a technician in the first place was because I didn't want to use a unit that can capture buildings. QUICK_EDIT
the only way i can think of to check for specific units is the 'comes near waypoint' trigger attached to the unit. since you still want it to look like its going in the tent, you can
use the recruitment and scripting shenanigans i described to force the unit into a teamtype with a script that makes it look like it enters the tent and subsequently create your grinder. _________________ visit my moddb profile for .shp downloads and stuff QUICK_EDIT
I feel like a "change house" action could be handy in there...
Also in FA2 you should place walls using the "other overlay" sub-list under overlays instead of placing the buildings, you will get a fairly accurate representation of the final result then. Of course if you want to add damage to any sections, you'll have to do that manually selecting the frame of the overlay from the dropdown in the terrain pane. _________________ http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai QUICK_EDIT
with a script that makes it look like it enters the tent and subsequently create your grinder.
Yeah, but what script exactly that will make it look like it enters the tent? That was what I was wondering in my last reply. Is it 31 Suicide?
G-E wrote:
I feel like a "change house" action could be handy in there...
Also in FA2 you should place walls using the "other overlay" sub-list under overlays instead of placing the buildings, you will get a fairly accurate representation of the final result then. Of course if you want to add damage to any sections, you'll have to do that manually selecting the frame of the overlay from the dropdown in the terrain pane.
you can use 'delete team members' script action and it will just delete the unit right in front of the tent, basically making it look like it went inside.
using change house on the first script action of the team will prevent the player from moving the unit after the script starts and breaking
the script, but i found from a previous map i did that if the player is using waypoints on the unit at the moment of recruitment, it will
recruit but also break the script so i suggest instead adding a 2nd event 'elapsed time' with 10 or so to the event section of that
'comes near waypoint' trigger, and setting the trigger to repeat. then making the second trigger, the one that creates the grinder, disable
the first trigger. this way it will keep forcing the team to try and 'enter' the tent until it works even if something goes wrong. _________________ visit my moddb profile for .shp downloads and stuff QUICK_EDIT
Ah, that is useful! I thought that that would do something else, like only remove they're teamtype as in they will no longer be a part of any team. Did not know it could do something like that! QUICK_EDIT
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum