Go Back   Codemasters Forums > Action, RPG and Strategy Games > Operation Flashpoint: Dragon Rising > English > Operation Flashpoint: Dragon Rising - Mission Editing and Modding Chat Zone
Sign In
Register on CodeM

Operation Flashpoint: Dragon Rising - Mission Editing and Modding Chat Zone A little area for all you mission editors and modders to chat and discuss ideas.

Reply
 
LinkBack Thread Tools Display Modes
Old 11-11-2009, 03:39 AM   #1 (permalink)
Member
 
DemonFire's Avatar
 
Join Date: Oct 2009
Location: USA - GA
Posts: 61
Default How to make a zombie (Alpha)

So I've been trying to make a "zombie plague" mission where if you are "bitten" by a zombie you become a zombie. I'm leaving the code to the public so that anyone can use or modify it. But please, if you find fixes to problems that are found please post them.

Here is how I did it:
Code:
 function onMissionStart()
 --------you have to set all the nonzombies to invul so the zombifacation process doesn't kill the victim---------------
 OFP:setInvulnerable("all non zombie units",true)
 end
 
 ---------here is the zombifacation process (alpha)---------
 function onHit(victim, attacker)
 if (OFP:getSide(attacker) == 1) then 
 if (OFP:getSide(victim) == 0) then 
 OFP:setArmy(victim,1)
 OFP:setAmmoCount(victim,0)
 OFP:setInvulnerable(victim,false)
 OFP:setMood(victim,"EMoodAggressive","OVERRIDE")
 end
 end
 end
=====This code only works on the following conditions:=====

- all zombies must be PLA and all non zombies much be UMSC

- You have to set all non zombies invulnerable or they will die when a zombie attacks them. (the code removes the invulnerability after the marine becomes a zombie)

- all the PLA zombies must have their ammo taken away. (haven't found code to remove all the ammo an AI carries yet)

- all marines must only have one clip of ammo for only one weapon. (ex: 1 clip for assault rifle and no clips for pistol or rocket launcher or whatever) When the code setAmmoCount goes off it only empties the current clip that the AI are on but doesn't do anything about the extra clips the AI are carrying.

========Know Issues:=======

- Each marine can only have one clip of ammunition right now. The setAmmoCount code doesn't work for this code but its the only code I know atm that will empty ammo from an AI. (if anyone knows any other way of emptying ammo or making the AI drop their weapons please post)

- The zombie AI aren't very aggressive. They can be easily outrun and don't move very fast. (If anyone can get a zombie to run or sprint to its victim instead of walking it would make it so much better.)

Well thats the Alpha of the code. I look forward to hearing your opinions and thoughts.

I will post a sample mission later tonight (I'll edit it into this post)
__________________
MAKE YOUR OWN ZOMBIE MISSIONS!

http://community.codemasters.com/for...54#post5850554
DemonFire is offline   Reply With Quote
Old 11-11-2009, 05:35 AM   #2 (permalink)
Junior Member
 
Join Date: Oct 2009
Posts: 22
Default

Looking forward to the results. I enjoyed the other zombie mods/maps.
JasonFMX is offline   Reply With Quote
Old 11-11-2009, 05:35 AM   #3 (permalink)
Senior Member
 
VengefulSpirit's Avatar
 
Join Date: Oct 2009
Location: New Jersey
Posts: 229
Default

That is very Interesting i shall take a look at it
VengefulSpirit is offline   Reply With Quote
Old 11-11-2009, 06:04 AM   #4 (permalink)
Senior Member
 
TemplarGFX's Avatar
 
Join Date: Oct 2009
Posts: 2,652
Default

what about :

Code:
enemy = OFP:getNearestEnemy("zombie",1);
if OFP:getDistance("zombie",enemy) > 2 then
  OFP:rapidMove("zombie",enemy,"OVERRIDE");
else
  OFP:assault("zombie",enemy,"OVERRIDE");
end
that would make em run at you, problem is though that would need to be done with each zombie/zombie echelon

I love OFP:getDistance if you didnt notice
__________________
PAYPAL DONATE
----------------------------------------
Island War 2.0 - Fight Along side the USMC as they take over Skira
The ENTIRE Island is at your feet! Your objective is to capture all of Skira. IN ONE MISSION
----------------------------------------
Templar's Completely Awesome Entity Database
Real Muzzle Velocity, Rate Of Fire, Effective Range, Recoil. Better Aimed Position. No zooming on iron sights!
TemplarGFX is online now   Reply With Quote
Old 12-11-2009, 12:18 AM   #5 (permalink)
Member
 
DemonFire's Avatar
 
Join Date: Oct 2009
Location: USA - GA
Posts: 61
Default

Quote:
Originally Posted by TemplarGFX View Post
what about :

Code:
enemy = OFP:getNearestEnemy("zombie",1);
if OFP:getDistance("zombie",enemy) > 2 then
  OFP:rapidMove("zombie",enemy,"OVERRIDE");
else
  OFP:assault("zombie",enemy,"OVERRIDE");
end
that would make em run at you, problem is though that would need to be done with each zombie/zombie echelon

I love OFP:getDistance if you didnt notice
Thanks Templar I think maybe that could be modded in a way like this:

Code:
function onEnter_triggerzone(zoneName, unitName)
if OFP:isInTrigger(unitName, "triggerzone") then
    if (OFP:getSide(unitName) == 1) then 
    enemy = OFP:getNearestEnemy(unitName,1);
    if OFP:getDistance(unitName,enemy) > 2 then
    OFP:rapidMove(unitName,enemy,"OVERRIDE");
    else
    OFP:assault(unitName,enemy,"OVERRIDE");
end
end
end
end
Or something of the sorts. Just need a way to continuously execute the code on everyone and then weed out the zombies and make em move.
__________________
MAKE YOUR OWN ZOMBIE MISSIONS!

http://community.codemasters.com/for...54#post5850554
DemonFire is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:22 PM.


Powered by vBulletin®
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.