AmEyeBlind Posted November 28, 2008 Share Posted November 28, 2008 hi folks, there were allready some people asking me for help, to let ai respawn like in arsenic thrihydride. so heres a small tutorial how to do that. it is a bit different to the system i used in the arsenic, but i think this 1 is better. i m useing that on my new map. you place 1 squad in the editor and name it "run1w1" the "w" stands for wave. and just double it up in the world.xml file. for this example we have 1 squad spawning 10 times, so "run1w1" to "run1w10" 1st you need triggers. like you see below, killing a squad will trigger allways the same event. i do that to have controll over the respawn time. <user name="run1w1_killed" type="continuous"> <trigger type="EnemyGroup" name="run1w1"> <enemy group_id="run1w1" condition="all"/> </trigger> <event name="time_run1"/> </user> <user name="run1w2_killed" type="continuous"> <trigger type="EnemyGroup" name="run1w2"> <enemy group_id="run1w2" condition="all"/> </trigger> <event name="time_run1"/> </user> <user name="run1w3_killed" type="continuous"> <trigger type="EnemyGroup" name="run1w3"> <enemy group_id="run1w3" condition="all"/> </trigger> <event name="time_run1"/> </user> <user name="run1w4_killed" type="continuous"> <trigger type="EnemyGroup" name="run1w4"> <enemy group_id="run1w4" condition="all"/> </trigger> <event name="time_run1"/> </user> <user name="run1w5_killed" type="continuous"> <trigger type="EnemyGroup" name="run1w5"> <enemy group_id="run1w5" condition="all"/> </trigger> <event name="time_run1"/> </user> <user name="run1w6_killed" type="continuous"> <trigger type="EnemyGroup" name="run1w6"> <enemy group_id="run1w6" condition="all"/> </trigger> <event name="time_run1"/> </user> <user name="run1w7_killed" type="continuous"> <trigger type="EnemyGroup" name="run1w7"> <enemy group_id="run1w7" condition="all"/> </trigger> <event name="time_run1"/> </user> <user name="run1w8_killed" type="continuous"> <trigger type="EnemyGroup" name="run1w8"> <enemy group_id="run1w8" condition="all"/> </trigger> <event name="time_run1"/> </user> <user name="run1w9_killed" type="continuous"> <trigger type="EnemyGroup" name="run1w9"> <enemy group_id="run1w9" condition="all"/> </trigger> <event name="time_run1"/> </user> <user name="run1w10_killed" type="continuous"> <trigger type="EnemyGroup" name="run1w10"> <enemy group_id="run1w10" condition="all"/> </trigger> <event name="time_run1"/> </user> 2nd. are the events <!-- set the var id allways in the start game event, in case you play the map a 2nd round. --> <event name="start_game"> <element type="TriggerEvent" event="set_var" start_time="2"/> </event> <!-- creating a var id for the ai respawners --> <event name="set_var"> <element type="UseVar" id="run1" set="1"/> </event> <!-- respawntime that the ai will have --> on my new map the respawntime is changeing to the amount of players on the map. i wont explain that now, couse its a different story, and doesnt matter in the moment. you can also do a "triggerrandomevent" and make a variating spawntime. <event name="time_run1"> <element type="TriggerEvent" event="select_run1" start_time="10"/> </event> <!-- wave to be spawned, works by var id, 11 would be off --> all 10 waves are spawned from this event. just 1 at the time according to the var id <event name="select_run1"> <element type="ActivateEventIfVar" id="run1" equals="1" event="spawn_run1w1"/> <element type="ActivateEventIfVar" id="run1" equals="2" event="spawn_run1w2"/> <element type="ActivateEventIfVar" id="run1" equals="3" event="spawn_run1w3"/> <element type="ActivateEventIfVar" id="run1" equals="4" event="spawn_run1w4"/> <element type="ActivateEventIfVar" id="run1" equals="5" event="spawn_run1w5"/> <element type="ActivateEventIfVar" id="run1" equals="6" event="spawn_run1w6"/> <element type="ActivateEventIfVar" id="run1" equals="7" event="spawn_run1w7"/> <element type="ActivateEventIfVar" id="run1" equals="8" event="spawn_run1w8"/> <element type="ActivateEventIfVar" id="run1" equals="9" event="spawn_run1w9"/> <element type="ActivateEventIfVar" id="run1" equals="10" event="spawn_run1w10"/> </event> <!-- spawning of ai, and adding 1 to the var id that the script knows this group was spawned --> <event name="spawn_run1w1"> <element type="UseVar" id="run1" add="1" start_time="1"/> <element type="ActivateGroup" group_id="run1w1" start_time="2"/> </event> <event name="spawn_run1w2"> <element type="UseVar" id="run1" add="1" start_time="1"/> <element type="ActivateGroup" group_id="run1w2" start_time="2"/> </event> <event name="spawn_run1w3"> <element type="UseVar" id="run1" add="1" start_time="1"/> <element type="ActivateGroup" group_id="run1w3" start_time="2"/> </event> <event name="spawn_run1w4"> <element type="UseVar" id="run1" add="1" start_time="1"/> <element type="ActivateGroup" group_id="run1w4" start_time="2"/> </event> <event name="spawn_run1w5"> <element type="UseVar" id="run1" add="1" start_time="1"/> <element type="ActivateGroup" group_id="run1w5" start_time="2"/> </event> <event name="spawn_run1w6"> <element type="UseVar" id="run1" add="1" start_time="1"/> <element type="ActivateGroup" group_id="run1w6" start_time="2"/> </event> <event name="spawn_run1w7"> <element type="UseVar" id="run1" add="1" start_time="1"/> <element type="ActivateGroup" group_id="run1w7" start_time="2"/> </event> <event name="spawn_run1w8"> <element type="UseVar" id="run1" add="1" start_time="1"/> <element type="ActivateGroup" group_id="run1w8" start_time="2"/> </event> <event name="spawn_run1w9"> <element type="UseVar" id="run1" add="1" start_time="1"/> <element type="ActivateGroup" group_id="run1w9" start_time="2"/> </event> <event name="spawn_run1w10"> <element type="UseVar" id="run1" add="1" start_time="1"/> <element type="ActivateGroup" group_id="run1w10" start_time="2"/> </event> and this is basicly it. i got 1 good hint for you guys, if you really wanna do a map like that. script everything ready for 1 runner. and then make yourself a template out of that. then scripting is really easy, couse you can do it with the template, just need to rename the keywords and copy it over in the script. i hope this will explain how it works. if you still have questions just go ahead. Quote Link to comment Share on other sites More sharing options...
fishmonger Posted November 28, 2008 Share Posted November 28, 2008 same type of script I use, but since I have noticed that a lot of enemies will not step out of their safe spawn location evne if the orders in the editor are clear, I usually don't have my trigger condition set to "all" - that allows a respawn to happen before all enemies of that group are down. I set it to 75% of the enemy count usually. The reason is that by doing that, I avoid that enemies are sitting in a building spawn location waiting for you to advance. When you get there and shoot them, you'll be in a place where the respawn then may happen right in your face. Basially, plan ahead for the possibility that not all the enemies you spawn will be visible targets until you advance to the spawn location. I had that problem occur on cholesterol_hill and scumbags_noath. Quote Link to comment Share on other sites More sharing options...
AmEyeBlind Posted November 28, 2008 Author Share Posted November 28, 2008 its not really the same type of script you use fish. this script is for 1 squad, thats 4 bots. no need to set it on 75% there. if your ai isnt moveing, they have a bad spawnpoint(not enough space), a bad ai graph or the orders arent good. mass ai spawns on a small space can also make problems. thats the reason why mappers make testruns, just to find bugs like that, and correct them. as well i dont need to watch out that a spawn will happen in your face. i can have whatever trigger to stop the spawn. on this point you will see its nothing like your script. in arsenic it were areas where you walk in before you can see the ai spawning. Basially, plan ahead for the possibility that not all the enemies you spawn will be visible targets until you advance to the spawn location. I had that problem occur on cholesterol_hill and scumbags_noath. no dont plan ahead. just test if the ai works good, if not overwork em or the ai graph! if they still dont work good then, use a different position to spawn them in and try again. i had 2 squads like that on the arsenic, but they were easy fixed by changeing the ai graph and the spawnpoint. Quote Link to comment Share on other sites More sharing options...
Rocky Posted November 29, 2008 Share Posted November 29, 2008 Thanks for the script, nice one. You should add it to the modding wiki for easy reference. If you don't have time, I would do it for ya Quote Link to comment Share on other sites More sharing options...
AmEyeBlind Posted November 29, 2008 Author Share Posted November 29, 2008 hm, 1st time i see that wiki. but its for graw 2, dont know if this should be in there. never dealed with graw 2, dont know if this script would work for it. if you wanna put it up there, go ahead i dont mind. Quote Link to comment Share on other sites More sharing options...
Rocky Posted November 29, 2008 Share Posted November 29, 2008 hm, 1st time i see that wiki. but its for graw 2, dont know if this should be in there. never dealed with graw 2, dont know if this script would work for it. if you wanna put it up there, go ahead i dont mind. Woops my mistake, posting too quickly without reading properly! Quote Link to comment Share on other sites More sharing options...
AmEyeBlind Posted November 19, 2009 Author Share Posted November 19, 2009 Just to let you know, if got a new way to script the respawners. The squadsize is variating from 1 - 4 bots, depending on the multiplayer count. If 1 of you mapmonkeys is interested in it, reply here and i will try to post a tutorial here. But maybe it will be easier to meet on Teamspeak to explain it. Quote Link to comment Share on other sites More sharing options...
RDCNemesis Posted June 3, 2011 Share Posted June 3, 2011 (edited) Hi AmEyeBlind saw this and have tried it...no luck. identifiers must match error. Im trying to get the ai to spawn when i walk into area 2. but i have tried every combination of scripting and i cant get it to work. Well i thought i had tried every combination but i guess not. Script is posted <?xml version="1.0" encoding="ISO-8859-1"?> <World> <!-- World --> <load_scene file="/data/levels/custom_levels/continuous spawn/continuous spawn.diesel" use_lightset="true" materials="/data/levels/custom_levels/continuous spawn/materials.xml"> <object name="world_bb" hidden="true"/> <object name="room01" hidden="true"/> <object name="Plane01" hidden="true"/> <global_ambient color="60 60 40"/> </load_scene> <load_scene file="/data/objects/lens/normal_lens.diesel"> <object name="normal_lens" hidden="true"/> </load_scene> <load_scene file="/data/objects/lens/zoom_lens.diesel"> <object name="zoom_lens" hidden="true"/> </load_scene> <script_data> <xi:include href="/data/levels/common/common.xml#xpointer(/common/*)"/> <!-- ------------------------------------------ AREAS ----------------------------------------------------- --> <area_group name="area1" area_name="area1" group="mp_players" interval="0.1" condition="1"/> <area_group name="area2" area_name="area2" group="mp_players" interval="0.1" condition="1"/> <area_group name="area3" area_name="area3" group="mp_players" interval="0.1" condition="1"/> !-- ------------------------------------------ TRIGGERS ----------------------------------------------------- --> <user name="unit_in_area1" type="once"> <trigger type="UnitInArea" area="area1"/> <event name="start_area1"/> </user> <user name="unit_in_area2" type="once"> <trigger type="UnitInArea" area="area2"/> <event name="start_area2"/> </user> <user name="unit_in_area3" type="once"> <trigger type="UnitInArea" area="area3"/> <event name="start_area3"/> </user> <user name="run1w1_killed" type="continuous"> <trigger type="EnemyGroup" name="run1w1"> <enemy group_id="run1w1" condition="all"/> </trigger> <event name="time_run1"/> </user> <!-- ------------------------------------------ EVENTS ----------------------------------------------------- --> <event name="start_game"> <element type="UnitInArea" area="area1" state="activate" start_time="1"/> <element type="UnitInArea" area="area2" state="activate" start_time="1"/> <element type="UnitInArea" area="area3" state="activate" start_time="1"/> <element type="TriggerEvent" event="set_var" start_time="2"/> </event> <event name="set_var"> <element type="UseVar" id="run1" set="1"/> </event> <event name="time_run1"> <element type="TriggerEvent" event="select_run1" start_time="10"/> </event> <event name="select_run1"> <element type="ActivateEventIfVar" id="run1" equals="1" event="spawn_run1w1"/> <!-- ------------------------------------------ area1 events ----------------------------------------------------- --> <event name="start_area1"> <element type="UnitInArea" area="area1" state="deactivate"/> <element type="ActivateGroup" group_id="group1" start_time="0"/> <element type="ActivateGroup" group_id="gun1" start_time="0"/> <element type="ActivateGroup" group_id="gun2" start_time="0"/> </event> <!-- ------------------------------------------ area2 events ----------------------------------------------------- --> <event name="start_area2"> <element type="UnitInArea" area="area2" state="deactivate"/> <element type="ActivateGroup" group_id="group2" start_time="0"/> <event name="spawn_run1w1"> <element type="UseVar" id="run1" add="1" start_time="1"/> <element type="ActivateGroup" group_id="run1w1" start_time="2"/> </event> <!-- ------------------------------------------ area3 events ----------------------------------------------------- --> <event name="start_area3"> <element type="UnitInArea" area="area3" state="deactivate"/> <element type="ActivateGroup" group_id="group3" start_time="0"/> <element type="ActivateGroup" group_id="gun3" start_time="0"/> </event> <!-- ------------------------------------------ end ----------------------------------------------------- --> <player name="player1" mod_name="OnFoot"> <spawn unit_name="ghost_player" object="spawn_player1"/> </player> <player name="player2" mod_name="OnFoot"> <spawn unit_name="ghost_player" object="spawn_player2"/> </player> <player name="player3" mod_name="OnFoot"> <spawn unit_name="ghost_player" object="spawn_player3"/> </player> <player name="player4" mod_name="OnFoot"> <spawn unit_name="ghost_player" object="spawn_player4"/> </player> <gametype_info name="enemies_to_kill" value="180"/> <spawn_manager> <!--<xi:include href="/data/levels/merge_xml/common_spawn.xml#xpointer(/to_include/spawn/*)"/> --> </spawn_manager> </script_data> </World> Edited June 3, 2011 by RDCNemesis Quote Link to comment Share on other sites More sharing options...
Tinker Posted June 3, 2011 Share Posted June 3, 2011 <event name="start_game"> <element type="UnitInArea" area="area1" state="activate" start_time="1"/> <element type="UnitInArea" area="area2" state="activate" start_time="1"/> <element type="UnitInArea" area="area3" state="activate" start_time="1"/> <element type="TriggerEvent" event="set_var" start_time="2"/> </event> <event name="set_var"> <element type="UseVar" id="run1" set="1"/> </event> <event name="time_run1"> <element type="TriggerEvent" event="select_run1" start_time="10"/> </event> <event name="select_run1"> <element type="ActivateEventIfVar" id="run1" equals="1" event="spawn_run1w1"/> The end event has no closing tag? Should it be: <event name="start_game"> <element type="UnitInArea" area="area1" state="activate" start_time="1"/> <element type="UnitInArea" area="area2" state="activate" start_time="1"/> <element type="UnitInArea" area="area3" state="activate" start_time="1"/> <element type="TriggerEvent" event="set_var" start_time="2"/> </event> <event name="set_var"> <element type="UseVar" id="run1" set="1"/> </event> <event name="time_run1"> <element type="TriggerEvent" event="select_run1" start_time="10"/> </event> <event name="select_run1"> <element type="ActivateEventIfVar" id="run1" equals="1" event="spawn_run1w1"/> </event> Would be better to read and fault find if you had spaces inbetween the events like so: <event name="start_game"> <element type="UnitInArea" area="area1" state="activate" start_time="1"/> <element type="UnitInArea" area="area2" state="activate" start_time="1"/> <element type="UnitInArea" area="area3" state="activate" start_time="1"/> <element type="TriggerEvent" event="set_var" start_time="2"/> </event> <event name="set_var"> <element type="UseVar" id="run1" set="1"/> </event> <event name="time_run1"> <element type="TriggerEvent" event="select_run1" start_time="10"/> </event> <event name="select_run1"> <element type="ActivateEventIfVar" id="run1" equals="1" event="spawn_run1w1"/> </event> Quote Link to comment Share on other sites More sharing options...
RDCNemesis Posted June 3, 2011 Share Posted June 3, 2011 Tinker DOH didnt spot that, will try now thnxJust changed it, ran editor, exported and crash ville Crash in application version: grpcrc1.35 data\levels\custom_levels\continuous spawn\continuous spawn.xml (125): Identifiers must match SCRIPT STACK data\levels\custom_levels\continuous spawn\continuous spawn.dsf(26) Quote Link to comment Share on other sites More sharing options...
Tinker Posted June 3, 2011 Share Posted June 3, 2011 data\levels\custom_levels\continuous spawn\continuous spawn.xml (125): Identifiers must match Out of curiosity, does that say there is an error on line 125 in the script? Quote Link to comment Share on other sites More sharing options...
RDCNemesis Posted June 3, 2011 Share Posted June 3, 2011 I have changed the scritp in area 2 events and the game now loads to be able to play but still no spawn... <event name="start_area2"> <element type="UnitInArea" area="area2" state="deactivate"/> <element type="ActivateGroup" group_id="group2" start_time="0"/> </event> <event name="spawn_run1w1"> <element type="UseVar" id="run1" add="1" start_time="1"/> <element type="ActivateGroup" group_id="run1w1" start_time="2"/> </event> Whe placing the enemy the group id is set to run1w1, the name is set to none even when i rename it to run1 and save/export it still defaults back to none, is this the problem? data\levels\custom_levels\continuous spawn\continuous spawn.xml (125): Identifiers must match Out of curiosity, does that say there is an error on line 125 in the script? if counting script lines i assumme the blanks count then line 125 is blank! If it does not include blanks then there arent 125 lines of script theres only 90. Quote Link to comment Share on other sites More sharing options...
AmEyeBlind Posted June 4, 2011 Author Share Posted June 4, 2011 like tinker mentioned already have a free line after each event, that will make it a lot easier for you where an event is starting and where its ending. what program do you use for scripting? anyway i can just recommend that you use context or notepad++. both are free to download, just google for it. the error message should point to the line with the failure (not always but mostly) and the counter is including blank lines. the run1w1 surely wont spawn when you enter area 2. theres missing this line to activate them. <element type="TriggerEvent" event="select_run1" start_time="0"/> but i have to tell you, if its respawning ai you want, it wont work that way. it takes a lot more scripting than what you posted. take a look at these 2 scripts: the 1st one is with the script like in the 1st posting here. the 2nd is more advanced and based even more on players on the map. back on the road script operation humongous bravo script but be aware the respawn scripting is some advanced stuff. it will take some time to understand it, and even more time to make a map with it. but you will know what i mean when you see those scripts. Quote Link to comment Share on other sites More sharing options...
RDCNemesis Posted June 4, 2011 Share Posted June 4, 2011 (edited) Tinker and AmEyeBlind Many thanks, the error message has gone and GRAW loads. I didnt change anything just re-exported it twice and it loaded i will look at the scripts posted, thanks I guess your saying that i should have the ai at the beginning of the map so i dont need to script them to spawn at a set point, good point. fingers crossed i can get it to work Notepad for scripting Edited June 4, 2011 by RDCNemesis Quote Link to comment Share on other sites More sharing options...
RDCNemesis Posted June 4, 2011 Share Posted June 4, 2011 AmEyeBlind Sorry i didnt explain the re-spawning ai I am trying to get the ai to spawn or just start the run when i enter area2, i have a group in area3 called run1w1. My intention was to get the ai to run once a player entered area 2 not to respawn. Quote Link to comment Share on other sites More sharing options...
AmEyeBlind Posted June 4, 2011 Author Share Posted June 4, 2011 ohhh ok then you wont need any of the scripting from the 1st post, that would just make it more complicated. this element will spawn the ai, you can use it in any event you want. <element type="ActivateGroup" group_id="run1w1" start_time="0"/> in your case you will use it in the start_area2 event then. and dont have all your ai on the map start, i always tried to have no more than 40 ai running around at once. that still leaves some space for vehicles, more will just slow down your game. and i can just recommend again that you get context or notepad++ for the scripting. both tools use different colors inside the xml what makes it more comfortable to work with. Quote Link to comment Share on other sites More sharing options...
RDCNemesis Posted June 4, 2011 Share Posted June 4, 2011 (edited) Have spent too long trying to get this to work and still nothing I have decided my brain is not capable of scripting anything other than heli's and c4. might lead to boring maps but hey if you got all well and good, I havent. I obviously have no scripting talent so i have decided to GIVE UP Thanks to you and Tinker for the help but its still beyond my talentless scripting brain. <-------- my brain and scripting Edited June 4, 2011 by RDCNemesis Quote Link to comment Share on other sites More sharing options...
AmEyeBlind Posted June 4, 2011 Author Share Posted June 4, 2011 hm thats 2 bad, and strange. i would say helicopter scripting is more complicated than letting ai spawn ^^ would it help you if i send you 1 of my maps so you can take a look at it in the editor and in the script. maybe it would be a lot easier and make some things more clear for you. every one starts the same way like you. i also had a lot of trouble in the beginning, figuring out the stupid scripting. but once it makes click its easy. Quote Link to comment Share on other sites More sharing options...
RDCNemesis Posted June 4, 2011 Share Posted June 4, 2011 Well i am ok at normal groups spawning and following the ai graph but anything like this continuous spawn for multi groups has fraggeled my brain. I have hundreds of maps including the arsenic one if you tell me the names of the maps i will see if i have them. wasnt stairway to hell one of yours? maybe i will give it another go LOL thanks again Quote Link to comment Share on other sites More sharing options...
AmEyeBlind Posted June 4, 2011 Author Share Posted June 4, 2011 (edited) stairway was a cooperation from crosshair and me. script was written by me. worth a look, some nice stuff in there. the arsenic might not be the best to look inside the script, it was the 1st try with that respawn script, and is a bit confusing here and there. the operation humongous is definitely worth a look, i would say thats the best script i wrote, but the respawn stuff in there is even more complicated. and dont worry, there are not many who really understand the respawn ai script. Edited June 4, 2011 by AmEyeBlind Quote Link to comment Share on other sites More sharing options...
RDCNemesis Posted June 5, 2011 Share Posted June 5, 2011 Thanks I will look at Oh_bravo today at some point. And notepad ++ looks good i have copied a script into it and it looks like it should be a bit easier. Quote Link to comment Share on other sites More sharing options...
RDCNemesis Posted June 5, 2011 Share Posted June 5, 2011 (edited) still looking at your various scripts. one problem tho. my map is at the "player" level in the middle, north goes up and south goes down. when i place the human ai in the south part i get an error as the blue guard circle is not at ground level, it is above the human, arrow down/up and page down dont make the blue cirle move. how do i get it to move to ground level so i can think about the "wave re-spawn" didnt realise this was the error Edited June 6, 2011 by RDCNemesis Quote Link to comment Share on other sites More sharing options...
AmEyeBlind Posted June 6, 2011 Author Share Posted June 6, 2011 as far as i remember that wont crash a map, but anyway, to adjust the ai settings you use: for guards: "p" - to set the center of the guarding position, ai will move to that point after spawn. "middle mouse" - to adjust the radius of the guarding spot for patrols: "p" - to set the 1st waypoint "insert" - to activate or deactivate the waypoint layout, when active: --- "left mouse" to set new waypoint --- "right mouse" to delete last waypoint for snipers: "middle mouse" - to set watchpoint, be sure that you dont set it to far, sometimes the like to shot you outside view distance when you do. Quote Link to comment Share on other sites More sharing options...
RDCNemesis Posted June 6, 2011 Share Posted June 6, 2011 thanks, i get the crash everytime i put ai in maybe its something else. Will give it a go Quote Link to comment Share on other sites More sharing options...
Tinker Posted June 6, 2011 Share Posted June 6, 2011 Would it be usefull to have a basic stock map set up for mission help? A simple level that opens in the editor, or you can spawn into it in game. No enemy or any other scripting needed. From there it would be a lot easier to direct someone. Nominates AmEyeBlind. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.