Page 1 of 2 12 LastLast
Results 1 to 10 of 17

  Click here to go to the first Developer post in this thread.  

Thread: check for civilian casualties with civilian module activated?

  1. #1

    Question check for civilian casualties with civilian module activated?

    hey there.
    to all of my missions i wanna add a loss trigger if civilian casualties are to high.
    without the civilian module i would place some civilians within the area of a trigger with settings:
    activation: civilians
    not present (not sure if thats the exact word in the english editor)
    type: loss

    but with the civilian module, how would i do that? afaik the civilan life is created around the player within a certain range, and deleted when not being in that range. so cheking for alive civilans with a trigger wouldnt work. any ideas?

  2. #2
    Sergeant Major ])rStrangelove's Avatar
    Join Date
    Jan 24 2002
    Location
    Rainy, foggy, begins with G
    Posts
    1,760
    I'd try to use a script for that.

    With "allGroups" we have the possibility to get a reference on all existing civilian objects currently existing in a mission.

    I would filter out all groups of side "civilian" and start a KILLED evenhandler for all units. All eventhandlers would increase a global counter variable if a civilian was killed by the player.

    In case the trashcollector would delete the civilian the eventhandler would be stopped, too.


    Dunno how many EHandlers can be used at once performance wise though - too many civilians would surely lag even more because you'd have 1 EH for everyone of them.

    Just an idea.

    Spoiler:

  3. #3
    Staff Sergeant
    Join Date
    Jun 2 2009
    Location
    Germany
    Posts
    244
    Author of the Thread
    what u wrote is a total mystery to me i have no idea of scripting, eventhandlers and stuff like that. thx anyway
    but i guess it wont take long until a script is available, as this is a very important thing to have in missions

  4.   This is the last Developer post in this thread.   #4
    No need to add eventhandlers to all units. You can set special init for every civilian created by Ambient Civilians module:
    Code:
    [
    	bis_alice_mainscope,
    	"ALICE_civilianinit",
    	[{
    		_this addeventhandler ["killed",{civ_casaulties = civ_casaulties + 1}]
    	}]
    ] call bis_fnc_variablespaceadd;
    This will rise global variable civ_casaulties by 1 every time civilian is killed.

    More info on Biki
    Alpha is alpha.

  5. #5
    Quote Originally Posted by Gaia View Post
    No need to add eventhandlers to all units. You can set special init for every civilian created by Ambient Civilians module:
    Code:
    [
    	bis_alice_mainscope,
    	"ALICE_civilianinit",
    	[{
    		_this addeventhandler ["killed",{civ_casaulties = civ_casaulties + 1}]
    	}]
    ] call bis_fnc_variablespaceadd;
    This will rise global variable civ_casaulties by 1 every time civilian is killed.

    More info on Biki

    DOH! I just made an Serialkiller map but have not found a way to get a civi kill counter so i wrote my own populationscript (my own alice, but not so good as the BIS one) ARGH!

    @Gaia, you posted this 2 days to late....
    Last edited by NeoArmageddon; Jun 12 2009 at 13:57.

  6. #6
    Second Lieutenant Kremator's Avatar
    Join Date
    Jun 8 2007
    Location
    Cambridge, UK
    Posts
    4,970
    me wants SerialKiller mission for arma2 !!

  7. #7
    Betatesting already started. Works great, just the support for two killer isnt ready yet. Release the next week

    BTW Looking for testers-> ICQ 168566281

  8. #8
    Staff Sergeant
    Join Date
    Jun 2 2009
    Location
    Germany
    Posts
    244
    Author of the Thread
    Quote Originally Posted by Gaia View Post
    No need to add eventhandlers to all units. You can set special init for every civilian created by Ambient Civilians module:
    Code:
    [
    	bis_alice_mainscope,
    	"ALICE_civilianinit",
    	[{
    		_this addeventhandler ["killed",{civ_casaulties = civ_casaulties + 1}]
    	}]
    ] call bis_fnc_variablespaceadd;
    This will rise global variable civ_casaulties by 1 every time civilian is killed.

    More info on Biki
    thx for the info

    how do i use that in a mission? 4 dead civilans = mission failed

    or hey much better the civilans run into their houses, get arms, and fight back that would be cool. i think thats not possible is it?
    but maybe a workaround, lets say guerillias come out of houses(spawn at the doors or spawn inside buildings if possible, so players can not see them just popping up out of nowhere) and fight the enemies (players). is that possible?

  9. #9
    Anything is possible in ARMA sorta. You just gotta learn how to do it - or grease someone up to do it for you. But its sure possible to do what you want. I dont know how though.


  10. #10
    Quote Originally Posted by Gaia View Post
    No need to add eventhandlers to all units. You can set special init for every civilian created by Ambient Civilians module:
    Code:
    [
    	bis_alice_mainscope,
    	"ALICE_civilianinit",
    	[{
    		_this addeventhandler ["killed",{civ_casaulties = civ_casaulties + 1}]
    	}]
    ] call bis_fnc_variablespaceadd;
    This will rise global variable civ_casaulties by 1 every time civilian is killed.
    Gaia-

    I attempted to use this structure to add an init to every ALICE civilian, but got a zero divisor error. It didn't say where, though, although it looks like it is associated with approximately line 17 of the fnc_civilianinit, where
    Code:
    _logic = BIS_alice_mainscope;
    I tried this:
    Code:
    [bis_alice_mainscope, "ALICE_civilianinit",[{if ((random 1) < .4) then {[_this] execVM "JTD_ambientCivTraffic.sqf"};}]] call bis_fnc_variablespaceadd;
    Now, I tried MANY different combinations of things. Oh - and this was in the initialization portion of the editor-placed module. Is it more properly in the init of the mission? Ideally, I would like a way for a mission designer to just place the code in an init box (or have it as an addon module/game logic... but one step at a time).

    Thanks,
    T

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •