![]() |
|
|
||||||
| 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. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
11-11-2009, 03:39 AM
|
#1 (permalink) |
|
Member
Join Date: Oct 2009
Location: USA - GA
Posts: 61
|
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
- 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 |
|
|
11-11-2009, 06:04 AM
|
#4 (permalink) |
|
Senior Member
Join Date: Oct 2009
Posts: 2,652
|
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
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! |
|
|
12-11-2009, 12:18 AM
|
#5 (permalink) | |
|
Member
Join Date: Oct 2009
Location: USA - GA
Posts: 61
|
Quote:
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
__________________
MAKE YOUR OWN ZOMBIE MISSIONS! http://community.codemasters.com/for...54#post5850554 |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|