Jump to content
Sign in to follow this  
Cytreen

Triggers and Spawn

Recommended Posts

Ok i have a little problem and i dont know how to go about solving it. I have a mission ware i have lots of AI. My problem is that there are to many AI and bogs down. I already have all the AI placed on the map and are scripted using HousePatrol and UPSMON. Here is My Idea on how to solve the problem but i have no clue on how to actually do it or if its even possible.

At the start of the mission i only want a the AI in the near by towns to spawn. Then once the player gets through the populated town and moves onto the desert roads. I was thinking a trigger could get rid of the dead bodies and the still standing Civilians. Then another trigger would spawn the AI in the town that the player will be approaching but i need the newly spawned AI To retain there position and scripting that i placed in the editor. I plan on having it do this 3 times during the mission. I am really stuck on this one. I was thinking that a trigger could just turn the already placed AI condition of presence from False to True but as another thred from 2009 stated this is not possible. There solution to spawn AI will not work as my AI need to keep there current positions and scripts.

I would really love to hear Ideas on how to accomplish this. Also i can not find a wiki of a list of commands that triggers are capable of.

Share this post


Link to post
Share on other sites

how about: instead of letting them spawn, set the groups to hold until player is inside the trigger-area.

That will save a lot of recources for the active part of your mission.

If thats still too much, think about harder AI. Often Quality over Quantity does the job.

Greetz.

Share this post


Link to post
Share on other sites

Im not sure how to do that sense the AI uses a script. As far as Number of AI that wont really work. Most of the AI are scripted UPSMON Civilians. I set it so that the script only calls every 60 sec. The majority of the Enemy AI uses HousePatrol script on Aware. The Enemy are Insurgents in Civilian Populated Areas. So far the mission is really good with 6 players. Just need to free everything up so it does not get so bogged down.

If there is a way to tell all the AI to Hold there position tell activate by trigger and still use AI routine scripts i will defiantly give it a go but i dont know how to do that. Im still learning but i have yet to find a refrence guide For all the commands available in the initialization and on activation and on deactivation fields of triggers and units.

Share this post


Link to post
Share on other sites

You could call the script when the player/s is/are within a trigger-area. the rest should stay the same. just be sure to disable the AI "move" when the players arent present..

Share this post


Link to post
Share on other sites

i dont know how to do this. This is why i am asking. Im still a noob at this so bear with me. Iv ben looking at how other do things in there missions but i have yet to see anything like you are suggesting.

Edited by Cytreen

Share this post


Link to post
Share on other sites

Ok iv worked out A trigger to make the AI call a script but i can only do 1 unit per trigger.

The spawned AI have nothing in there Init fields.

Trigger

init this

on Acctivation is

guard = [civ1, "AWARE"] execVM "HousePatrol.sqf";

Now if i do this in the trigger on act nither of the unite activate the script.

guard = [civ1, civ2, "AWARE"] execVM "HousePatrol.sqf";

Having to have a trigger per unit will eat up more resources than just letting the scripts run in the first place. So what i was thinking was that place 1 trigger to call upon a new script that will tell each unit name to call another script but have no scue on how to write such a script.

Share this post


Link to post
Share on other sites

Iv figured out a way to do this but its through a trigger that will activate AI to more to a waypoint and then the way point will activate the scripts for the individual units when they reach the waypoint.

The cash scrip i do not believe will work sense that usies the units init field but you could posably do that allong with the waypoint script activation. I will be doing it by the way of the waypoint activation if it run smoothly enoughf. If it doesnt i will try the cash script and have the units activate upon the waypoints. Give me a few days to test everything out and ill let you know of my findings.

Share this post


Link to post
Share on other sites

Hi guys! Im trying to find a good solution to me and my frind's clan-server(coop/pvp). We decided to do things themselves(script's) instead of going ''the Domination way''. We have copied and use some scripts course, which occasionally from Xeno's projects(the best! respect). All is done, without a simple action menu to set view distance and some other stuff(markers on map etc.etc.) that we're working on at the moment, think it will go smoothly that part.

BUT the challenge we face now is that we have too much stuff / Enemy AI's spread out on the map(Chernarus). I'm trying to find a way to get trigged areas that are activated when the players penetrate them. Search'ed around, both here and on other forums, but can not find a good solution we can use to this problem. The best thing i think will be to alsow manage to get a type of timer in the very area where the trigger is placed so that if one chooses not to play there anymore, the things one wants to appear through the trigger, disappear. Say after 30 min or so. Will work on it over the weekend and il give u guys a message here if I find any good solution.

Sry my English, hope you guys understand..

Cheers

Edited by Logitrust

Share this post


Link to post
Share on other sites

Ok i think i know what you are wanting to do and its basically the same way im doing it now. Id love to see how you got the action menu out of domination as i have ben trying that for some time with no luck. As far as the set view distance. In my map you can set it from the Radio on your in game Map or go over to the bilbord and use the mousewheel and select what setting you want. Hears how to set a Trigger to activate a scripted AI. the AI will spawn but will not run the script untill the trigger is activated.

Place a Unit on the map. (will call him Civ1 for this exercise)

dont touch the unit init field.

Create the first Waypoint with move as its command and its completion radius to 1

Next create a 2nd Waypoint as move and compleation radius to 1. (the further away it is from waypoint 1 the longer it will take the unit to reach waypoint 2 and activation of the script)

Add the script activation command to the ON ACT of waypoint 2.

In the ON ACT. after you script comman add your script command ; hint "trigger activated"

Create a Trigger and place it ware you want the activation to occure.

Set the trigger setting to activate blufor, present, and its activation to once.

Now select the Synchronisation from the edditor menu on the Right.

Click on the new trigger so that it is selected

Now with synchronisation tool active click and drag from the trigger to the first waypoint of the Unit Civ1.

Run a test.

When arma runs Civ1 will move to waypoint 1 and hold untill the Trigger has ben activated by Bluefor.

When activated

Civ1 will move to the Waypoint 2 (ware we have put the script execution script in waypoint 2 Init Field)

When Civ1 reaches the destination of waypoint 2. it will then activate the script. (you can sync the trigger to multiple units waypoints. You can also play around with the move speed of each unit so that they all reach the 2nd waypoint at an interval so the scripts do not activate all at the same time)

---------- Post added at 05:00 AM ---------- Previous post was at 04:43 AM ----------

One of the things i have ben trying to work out is how to spawn and despawn units with there waypoints and the triggers that are linked to there waypoints. As of now my mission is a 6 player Co-op. I have just about everything inplace. Just working on getting a loading screen picture on mission load. I have the intro Text that fades from text to text but at the end if will not go from all black with text to fade out into player spawn. it just goes from displaying black screen with text and pop into player body. Im thinking im going to have to do that through a camera trick but i want each player to fade into there own bodys. The other thing im working on is setting different enemy per difficulty setting.

Also i cant get the syntax correct for the ambient civilian module to spawn all Civs in the towns that i want and make it a higher population than default. Im thinking i could greatly reduce lag instead of having the close to 200 scripted Civilians walking around on the map not counting the scripted Enemy. Also looking for a good capture script so i can have make AI join my group and can order him to move and what not.

Edited by Cytreen

Share this post


Link to post
Share on other sites

I dont get this spawning thing. When I want to spawn on an already existing unit, its very simple, but otherwise its not working.

Heres my code in waypoint activation box:

komcsi1 = creategroup east; "RU_Soldier" createUnit [getMarkerPos "spawn", group komcsi1];

Share this post


Link to post
Share on other sites

deleteVehicle unit;

For vehicles you need to delete the crew first:

{deleteVehicle _x} forEach units crew vehicle; deleteVehicle vehicle;

Edited by kylania

Share this post


Link to post
Share on other sites

Dont forget that you also want to delete the group, if its empty (ie the group that the deleted units was in).

Share this post


Link to post
Share on other sites

I was having trouble deleting a man that was in cargo in a chopper. I am able to delete him when he isn't in the chopper, but not after he gets in. It's not a bog deal, I'm sure I will figure out a work around for it.

Share this post


Link to post
Share on other sites

Eject him from a great height for comedy value. :D

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×