Author Topic: Respawning nonplayable AI troops/vehicles and randomised waypoint scr (ACCEPTED)  (Read 1863 times)

0 Members and 1 Guest are viewing this topic.

Offline norrin

  • Tutorial Writer
  • **
I've been working on this for some time now and posted the latest version on the BI forums yesterday.  So far I haven't received any feed back and I guess this could mean a few things, for instance no ones interested :) or its got a bit lost in the various posts on that thread.

Anyway, I have written a range of new scripts that are implemented in an example mission you can get from here(version 12_jip)

The mission involves two respawning AI Hummers manned by respawning unplayable AI troops and two groups of respawning unplayable AI foot sloggers attacking a OPFOR defended cross roads.  Once the cross roads are taken the spawn points update and the units attack the town. 

The scripts are designed so that when a member of one of the groups of AI ground troops respawns it waits until the rest of the group respawns and then moves onto the waypoints. The same happens for the vehicle based troops. The mission also uses a one way progressive respawn point that moves spawn locations of the units forward and updates the WPs for the new objective which is in the centre of the town. 

I also have modified KaRRaLLioN's vrs.sqf script so that it is compatible with respawning nonplayable AI. You can d/l a more generalised version of my vrs_AI.sqf script than the version that appears in the example mission from here.

For the ground troops I've also set it up so that each time the group respawns they approach the target via one of three randomly selected paths (couldn't be bothered setting it up for the vehicles but its just the same principle).

The AI troops also respawn with whatever weapons they were carrying at the start of the mission (their maybe a couple of bugs with this though) but if you want to add extra playable units on either side it should still work.

You can play this mission from the perspectives of a BLUFOR unit or as a civilian friendly to both sides so you can watch the action unfold.

It all seems to be working quite nicely on a local server but on a dedicated server although it works there are couple of problems, 

Firstly, it takes a much longer time before the vehicles move on a dedicated server compared to a local server ie. it takes minutes before they move to their first waypoint on a dedi whereas on a local server it takes only seconds.

Secondly the unplayable AI units for some reason take much longer to respawn on a dedicated server.

As I am running both the dedicated server and client on the same box and I wonder whether it's putting too much strain on my processor. 

If any one has any ideas on how to fix these problems or any other suggestions please let me know.

EDIT:  Just tested this mission on ver 1.05 dedicated server and the delay with the AI vehicles moving seems to have disappeared in 1.05.  So this mission is now working very well on both dedicated and local servers I just need to tidy up the init.sqs so that it works with JIP in progress and Bobs your uncle. This method can then be used for missions that need many respawning unplayable AI unit controlled vehicles :)

EDIT EDIT: Edited sample mission you can now play with a buddy and join in progress seems to be working.  Get new version here.  Also updated previous links.

Please let me know if you run into any problems

« Last Edit: 19 Sep 2007, 23:02:03 by Mandoble »