Jump to content

tracy_t

Member
  • Content Count

    330
  • Joined

  • Last visited

  • Medals

Posts posted by tracy_t


  1. Hi all. Thank you for your comments.

    If you want zombies that attack anyone in West, I can program that quite easily. I already have the script to do it; I publish the attack script below.

    The only reason I didn't do that for you already is that I thought you would want to do that sort of scripting yourself. Do you want all zombies to behave in a uniform way?

    Remember: if I make my zombies attack West soldiers automatically, you can forget about making zombies follow waypoints, or any other fancy stuff biggrin_o.gif

    Regards,

    Scott

    PS:

    I am now working on the zombie textures. So far I have Dr. Tongue and Bub semi-ready (ie: untested).

    I can't include the pictures here as they would be considered GORE, but I will give you the URLs (WARNING: ADULT CONTENT) :

    Dr Tongue:

    http://www.homepageofthedead.com/films/day/zomb3_thumb.jpg

    Bub:

    http://www.homepageofthedead.com/films/day/bub4s_thumb.jpg

    I include the code for movezombie.sqs. Zombies using this code will automatically attack WEST and RESISTANCE soldiers.

    Call from your zombie unit's initialisation:

    [this, id of target] exec "movezombie.sqs"

    e.g.

    [MyZombie, Player] exec "movezombie.sqs"

    and your zombie will attack the player. If the zombie is 1000m away from the player, the zombie will disappear - no point in chasing someone that far away.

    NB:

    Make sure a trigger called westsoldiers covers your whole island, and is activated ONCE by WEST.

    Make sure a trigger called resistancesoldiers covers your whole island, and is activated ONCE by RESISTANCE.

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

    ; movezombie.sqs

    _z = _this Select 0

    _t = _this Select 1

    #Main

    ~1

    ?(!alive _z) : goto "End"

    ?(_t != objNULL) && (alive _t) goto "move"

    _tig = false

    _t = player

    _pt = (list resistancesoldiers) + (list westsoldiers)

    _y = 0

    _uc = count _pt

    #loop

    ~2

    ? _y>= _uc: goto "premove"

    _u = _pt select _y

    ? (!alive _u) : goto "nextunit"

    ? _z distance _u < _z distance _t: _t = _u

    #nextunit

    _y=_y+1

    goto "loop"

    #premove

    ? _t in units group player: _tig = true

    _z dowatch _t

    #move

    _d = _z distance _t

    ? _d > 1000 : Goto "end"

    ? _d > 5 : goto "walk"

    ? _d < 6 : goto "engage"

    Goto "Main"

    #walk

    _z domove getpos _t

    ~2

    goto "Main"

    #engage

    ? !alive _z: goto "end"

    _z removeMagazines "StrokeFist"

    _z setPos getpos _t

    _z addMagazine "StrokeFist"

    _z fire "StrokeFist"

    ~3

    _t setDammage (getDammage _t + 0.2)

    ~1

    goto "Main"

    #End

    ~5

    DeleteVehicle _z

    exit


  2. When can you download it?

    Well if you want it *right now* you could compile the source code yourself from the BREATHE section of these forums (the crap way) or I could try to find a host - most likely Geoshitties. I'll try and get a account set up in the next hour or so...

    Scott


  3. Hi Fubar:

    Well, I don't have time to create a campaign (I'm a grown man with a pub next door. Why am I into zombies at 31? lol) but hopefully others will make the time smile_o.gif

    I hope the likes of Karillon and D. Murphy man can use the addon, or modify it for their needs.

    Cheers,

    Scott "Tracy" T.


  4. Dear all,

    as promised:

    Zombies in OFP. Copy both config.cpp and initzombie.sqs to a directory called ScottsAddon. Use MakePbo or StuffPbo to compile the directory into a Pbo file (which must also be called ScottsAddon.)

    Yes, scott is my first name, lol!

    Please, if you use this code, credit me, Scott "Tracy" T (and D. Murphy Man, who's original zombie code I nicked originally)!

    I realise it may not be the done thing to release code on this forum, but I hope this code can help budding addon makers (and zombie fans.)

    Note: This is a work in progress, and I will be updating the code as I go along. I will replace hard-coded values with the #defines in due course - don't panic, I'm a C++ programmer by trade, lol  (Visual C++ 6 IDE rules for creating config.cpp files.)

    Any questions? Feel free to PM me.

    Config.cpp:

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

    #define TEast 0

    #define TWest 1

    #define TGuerrila 2

    #define TCivilian 3

    #define TSideUnknown 4

    #define TEnemy 5

    #define TFriendly 6

    #define TLogic 7

    #define true 1

    #define false 0

    // type scope

    #define private 0

    #define protected 1

    #define public 2

    class CfgPatches

    {

           class ScottT_Zombies

           {

           units[]={Zombie, Zombie2, Zombie3, Zombie4, Zombie5, Zombie6, Zombie7, ZombieWoman1,ZombieWoman2,ZombieWoman3, ZombieWoman4, ZombieWoman5};

           requiredversion=1.750000;

           };

    };

    class CfgVehicles

    {

    class All {};

    class AllVehicles: All {};

    class Land: AllVehicles{};

    class Man: Land{};

       class Civilian: Man{};

       class Civilian1: Civilian {};

    class Civilian2: Civilian {};

    class Civilian3: Civilian {};

    class Civilian4: Civilian {};

    class Civilian5: Civilian {};

    class Civilian6: Civilian {};

    class Civilian7: Civilian {};

    class Civilian8: Civilian {};

    class Civilian9: Civilian {};

    class Civilian10: Civilian {};

    class Civilian11: Civilian {};

    class Woman1: Civilian{};

    class Woman2: Civilian{};

    class Woman3: Civilian{};

    class Woman4: Civilian{};

    class Woman5: Civilian{};

    class Zombie: Civilian

    {

           side=0;

    armor=100;

    armorhead=0.2;

    armorbody=500.0;

    armorhands=500.0;

    armorlegs=500.0;

           scope=2;

    glasses="None";

    displayName="Zombie";

           class eventhandlers

       {

               init = [_this select 0] exec {\scottsaddon\initzombie.sqs};

               

       };

    };

    class Zombie1: Civilian1

    {

    armor=100;

    armorhead=0.2;

    armorbody=500.0;

    armorhands=500.0;

    armorlegs=500.0;

           scope=2;

    glasses="None";

    displayName="Zombie 1";

    side=0;

           class eventhandlers

       {

               init = [_this select 0] exec {\scottsaddon\initzombie.sqs};

       };

    };

    class Zombie2: Civilian2

    {

    armor=100;

    armorhead=0.2;

    armorbody=500.0;

    armorhands=500.0;

    armorlegs=500.0;

           scope=2;

    glasses="None";

    side=0;

    displayName="Zombie 2";

           class eventhandlers

       {

               init = [_this select 0] exec {\scottsaddon\initzombie.sqs};

       };    

       };

    class Zombie3: Civilian3

    {

    armor=100;

    armorhead=0.2;

    armorbody=500.0;

    armorhands=500.0;

    armorlegs=500.0;

           scope=2;

    side=0;

    glasses="None";

    displayName="Zombie 3";

           class eventhandlers

       {

               init = [_this select 0] exec {\scottsaddon\initzombie.sqs};

       };

       };

    class Zombie4: Civilian4

    {

    armor=100;

    armorHead=0.2;

    armorbody=500.0;

    armorhands=500.0;

    armorlegs=500.0;

           scope=2;

    glasses="None";

    side=0;

    displayName="Zombie 4";

           class eventhandlers

       {

               init = [_this select 0] exec {\scottsaddon\initzombie.sqs};

       };

       };

    class Zombie5: Civilian5

    {

    armor=100;

    armorhead=0.2;

    armorbody=500.0;

    armorhands=500.0;

    armorlegs=500.0;

           scope=2;

    glasses="None";

    side=0;

    displayName="Zombie 5";

           class eventhandlers

       {

               init = [_this select 0] exec {\scottsaddon\initzombie.sqs};

       };

       };

    class Zombie6: Civilian6

    {

    armor=100;

    armorhead=0.2;

    armorbody=500.0;

    armorhands=500.0;

    armorlegs=500.0;

           scope=2;

    glasses="None";

    side=0;

    displayName="Zombie 6";

           class eventhandlers

       {

               init = [_this select 0] exec {\scottsaddon\initzombie.sqs};

       };

       };

    class Zombie7: Civilian7

    {

    armor=100;

    armorhead=0.2;

    armorbody=500.0;

    armorhands=500.0;

    armorlegs=500.0;

           scope=2;

           glasses = "None";

           side=0;

       displayName="Zombie 7";

           

           class eventhandlers

       {

               init = [_this select 0] exec {\scottsaddon\initzombie.sqs};

       };

       };

    class ZombieWoman1: Woman1

    {

    armor=100;

    armorhead=0.2;

    armorbody=500.0;

    armorhands=500.0;

    armorlegs=500.0;

           scope=2;

           side=0;

           displayName="Zombie Woman 1";

           class eventhandlers

       {

               init = [_this select 0] exec {\scottsaddon\initzombie.sqs};

       };

    };

    class ZombieWoman2: Woman2

    {

    armor=100;

    armorhead=0.2;

    armorbody=500.0;

    armorhands=500.0;

    armorlegs=500.0;

           scope=2;

       side=0;

       displayName="Zombie Woman 2";

           class eventhandlers

       {

               init = [_this select 0] exec {\scottsaddon\initzombie.sqs};

       };

       };

    class ZombieWoman3: Woman3

    {

    armor=100;

    armorhead=0.2;

    armorbody=500.0;

    armorhands=500.0;

    armorlegs=500.0;

           scope=2;

       side=0;

       displayName="Zombie Woman 3";

           class eventhandlers

       {

               init = [_this select 0] exec {\scottsaddon\initzombie.sqs};

       };

       };

    class ZombieWoman4: Woman4

    {

    armor=100;

    armorhead=0.2;

    armorbody=500.0;

    armorhands=500.0;

    armorlegs=500.0;

           scope=2;

       side=0;

       displayName="Zombie Woman 4";

           class eventhandlers

       {

               init = [_this select 0] exec {\scottsaddon\initzombie.sqs};

       };

       };

    class ZombieWoman5: Woman5

    {

    armor=100;

    armorhead=0.2;

    armorbody=500.0;

    armorhands=500.0;

    armorlegs=500.0;

       scope=2;

           side=0;

           displayName="Zombie Woman 5";

           class eventhandlers

       {

               init = [_this select 0] exec {\scottsaddon\initzombie.sqs};

       };

    };

    };

    class CfgGroups

    {

      class East

      {

         name="East"

         class Scott_T_Zombies

         {

            name="Zombies";

            class ZombieGroup

            {

               name="Group of zombies";

    class Unit0{name="1";side=0;vehicle="Zombie1";rank="Lieutnant";position[]={0,0,0};};

    class Unit1{name="2";side=0;vehicle="Zombie2";rank="Sergeant";position[]={-8,-3,0};};

    class Unit2{name="3";side=0;vehicle="Zombie3";rank="Sergeant";position[]={-6,-3,0};};

    class Unit3{name="4";side=0;vehicle="Zombie4";rank="Corporal";position[]={-4,-3,0};};

    class Unit4{name="5";side=0;vehicle="Zombie5";rank="Corporal";position[]={-2,-3,0};};

    class Unit5{name="6";side=0;vehicle="ZombieWoman1";rank="Corporal";position[]={0,-3,0};};

    class Unit6{name="7";side=0;vehicle="Zombie6";rank="Private";position[]={2,-3,0};};

    class Unit7{name="8";side=0;vehicle="ZombieWoman2";rank="Private";position[]={4,-3,0};};

            class Unit8{name="9";side=0;vehicle="Zombie7";rank="Private";position[]={6,-3,0};};

    };

         };

       };

    };

    Initzombie.sqs

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

    _zombie = _this select 0

    _zombie setdamage 0.8

    _zombie SetBehaviour "CARELESS"

    _zombie DisableAI "TARGET"

    _zombie DisableAI "AUTOTARGET"

    _zombie allowfleeing 0

    _zombie SetMimic "Agresive"

    exit


  5. Dear all.

    I have made a zombie addon which includes 12 types of zombies. Each zombie can only be immediately killed by a headshot. Would anyone like to host the WIP .pbo file?

    Each zombie inherits from a civilian model, but has setdammage set to 0.8 on initialisation, for that "gore" look; however, the armor level of each zombie class was upped significantly so that the zombies wouldn't be killed with one shot.

    I will post the addon's config.cpp in mission editing & scripting so that other zombie mission makers can use my code (e.g. perhaps Karillion, or D.Murphy man) and produce better works!

    EDIT: Have just put source code in BREATHE section. Feel free to take a look.


  6. Off top of my head:

    _unit = <id of unit you want to rotate left>

    _destangle = (GetDir _unit) - 30

    ? _destangle < 0: _destangle = 360 + _destangle

    #loop

    ; change unit facing by 1 degree

    _newangle = (GetDir _unit) - 1

    ? _newangle < 0: _newangle = 360 + _newangle

    ? _newangle >= _destangle: _unit SetDir _newangle

    ? _newangle == _destangle: goto "end"

    ~1

    goto "loop"

    #end

    exit


  7. Actually Karillion,

    your zombieplayercheck.sqs file has given me an idea on how to improve performance in my game... !

    Probably will speed it up by a significant factor lol! Just goes to show an old dog like me can learn new tricks smile_o.gif

    I will of course credit you appropriately.

    In return, would you like any help with Sound FX, or music? I have just about every well-known zombie movie ever made to hand, so I'm yer man for getting desired FX...

    Cheers,

    Scott


  8. Dear all,

    I would like my civilian addon (a subclass of resistance 1.85 "woman1" class) to have an injured appearance, yet have a damage level of 0.  (ie: GetDamage unit == 0)

    I have overridden the wounds[] array in my addon's class in config.cpp so that all textures are of the "wounded" type but the civilian object is unchanged.

    Am I overriding the correct member variable or is there anything else I need to do?

    PS: Addon works & acts fine otherwise.

    Already searched forum and google'd - found JS. smile_o.gif

    Cheers,

    Tracy


  9. Hi Karillion, I looked at your scripts before (I unpbo'd the Nogova virus mission to see how the zombies were created), but they weren't suited to what I needed.

    Anyway, here's how I get 100 + zombies on screen at once.

    Monitorarea.sqs: monitors a resistance player in a spawn area. To be replaced by more optimal code soon.

    group1 - group20 are individual EAST soldiers, hidden away on a secluded part of the island. They are only there so zombies can join the EAST group and be shot at by West, although since I created my zombie addon they are pretty much redundant.

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

    _trig = _this select 0

    _opos = getpos _trig

    #sp

    ? count list (_trig) > 0: goto "az"

    ~2

    goto "sp"

    #az

    _gc=1

    #fg

    ?_gc==1:_gp = group1

    ?_gc==2:_gp = group2

    ?_gc==3:_gp = group3

    ?_gc==4:_gp = group4

    ?_gc==5:_gp = group5

    ?_gc==6:_gp = group6

    ?_gc==7:_gp = group7

    ?_gc==8:_gp = group8

    ?_gc==9:_gp = group9

    ?_gc==10:_gp = group10

    ?_gc==11:_gp = group11

    ?_gc==12:_gp = group12

    ?_gc==13:_gp = group13

    ?_gc==14:_gp = group14

    ?_gc==15:_gp = group15

    ?_gc==16:_gp = group16

    ?_gc==17:_gp = group17

    ?_gc==18:_gp = group18

    ?_gc==19:_gp = group19

    ?_gc==20:_gp = group20

    _nu = count units _gp

    ? _nu < 10: goto "cz"

    ~2

    _gc = _gc+1

    ? _gc < 15: goto "fg"

    exit

    #cz

    _zi = random(1) * 10

    _zType = ZombieTypes select _zi

    [_zType, _opos, _gp] exec "createzombie.sqs"

    ~5

    goto "sp"

    Createzombie.sqs:

    First parameter is type of zombie to create;  I specially created a zombie addon for operation flashpoint which up-armors the zombies leg, body, arms etc (but not the head). You can have it if you like.

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

    _zType = _this select 0

    _opos = _this select 1

    _group = _this select 2

    _zType createunit [_opos,_group,"Zombie = this;"]

    zombie SetBehaviour "CARELESS"

    zombie DisableAI "TARGET"

    zombie DisableAI "AUTOTARGET"

    zombie allowfleeing 0

    zombie SetMimic "Agresive"

    dostop zombie

    _group = Group _zombie

    _group SetSpeedMode "FULL"

    [zombie] exec "movezombie.sqs"

    exit

    movezombie.sqs:

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

    _z = _this Select 0

    _t = _this Select 1

    #Main

    ~1

    ?(!alive _z) : goto "End"

    ?(_t != objNULL) && (alive _t) goto "move"

    _tig = false

    _t = player

    _pt = (list resistancesoldiers) + (list westsoldiers)

    _y = 0

    _uc = count _pt

    #loop

    ~2

    ? _y>= _uc: goto "premove"

    _u = _pt select _y

    ? (!alive _u) : goto "nextunit"

    ? _z distance _u < _z distance _t: _t = _u

    #nextunit

    _y=_y+1

    goto "loop"

    #premove

    ? _t in units group player: _tig = true

    _z dowatch _t

    #move

    _d = _z distance _t

    ? _d > 1000 : Goto "end"

    ? _d > 5 : goto "walk"

    ? _d < 6 : goto "engage"

    Goto "Main"

    #walk

    _z domove getpos _t

    ~2

    goto "Main"

    #engage

    ? !alive _z: goto "end"

    _z removeMagazines "StrokeFist"

    _z setPos getpos _t

    _z addMagazine "StrokeFist"

    _z fire "StrokeFist"

    ~3

    _t setDammage (getDammage _t + 0.2)

    ~1

    goto "Main"

    #End

    ~5

    DeleteVehicle _z

    exit

    PS: I see we've both re-used D-Murphy man's zombie code in parts smile_o.gif

    S.


  10. Oh God, shorten variable names? That reminds me of C64 BASIC years ago...

    I got 100 zombies moving right now and I have ~30fps. There are about 50-70 west soldiers in the melee too.

    Not quite as responsive as I'd like, but better than nothing.

    My benchmark is 5639, so you lot will be able to guess how this will run on your PC.

    Mind you, I have a Radeon 9700 Pro, soz....

    PS: if.. then only works in a function, does it not. So putting it in a for..each in an SQS (as I have now) won't work.

    Would anyone like a copy of the work "as-is" ?


  11. Why not have the trigger remain static, but cover a large area, but set the "activation condition"  to when player is NOT inside a chopper?

    For example

    (!Player In Chopper1) && (SecondPartOfTheGame == true)

    where Chopper1 is the helicopter you fly and secondpartofthegame is a bool flag you set.

    Also you could use arrays e.g. put the following code in a script, and exec it from a "WEST PRESENT" trigger:

    _vehiclearray = [chopper1, chopper2]

    _count = count _vehiclearray

    _y = 0

    #loop

    ? _y == _count: goto "end"

    _vehicle = _vehiclearray select _y

    ? Player In _vehicle: SetAFlagForTriggerToPickUp = true

    ? SetAFlagForTriggerToPickUp: goto "end"

    _y = y+1

    goto "loop"

    #end

    exit

    Makes more sense to me.

    Also, you can group a unit with a trigger in the editor (via the group menu)

    Finally for your second question, simplest way is to use:

    trigger condition:

    !alive (vehicle1) && !alive (vehicle2) && ! alive (vehicle3)

    which should then fire the "win game sequence"

    etc etc.

×