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 23-10-2009, 11:08 AM   #1 (permalink)
Member
 
Join Date: Oct 2009
Posts: 34
Default This is Driving me Mad!!!!! HELP!!!!

Basically iv managed to get spwaned AI to move to a waypoint, and iv managed to end a mission when Objectives are complete, however, i cant seem to get the 2 to work together, its driving me mad please help.

I have the 1st group of enemies spawn when i enter a trigger, 1st objective is Take them out, once they are all dead the 2nd wave should spawn and run to the waypoint, 2nd objective is take them out and the mission should end, but basically that aint happenin, and its driving me insane,

Heres the Script:

-- Script

function onEnter(triggerzone, player)
EnemySpawn = OFP:activateEntitySet("enemy");
OFP:addTimer("waiting", 2000)
end

function onTimer()
OFP:move("Echelon", "wp", "OVERRIDE")
end

function onDeath(victim, killer)
if OFP:isAlive("Echelon")== false then
OFP:destroyEntitySet("Enemy");
OFP:activateEntitySet("Enemy2");
OFP:addTimer("waiting", 2000)
end

function onTimer()
OFP:move("Echelon1", "wp1", "OVERRIDE")
end
end

Objstate = 0;
function onMissionStart()
OFP:setObjectiveState("obj","IN_PROGRESS")
OFP:setObjectiveState("obj2","IN_PROGRESS")
end

function onDeath(victim, killer)
if OFP:isAlive("Echelon")== false then
OFP:setObjectiveState("obj", "COMPLETED");
objstate =1;
end
end

function onDeath(victim, killer)
if OFP:isAlive("Echelon1")== false then
OFP:setObjectiveState("obj2", "COMPLETED");
objstate =1;
end
end

function onObjectiveCompleted(obj, obj2)
if OFP:getObjectiveState("obj") == "COMPLETED" and
OFP:getObjectiveState("obj2") == "COMPLETED" then
OFP:missionCompleted()
end
end
Adamdf is offline   Reply With Quote
Old 23-10-2009, 01:30 PM   #2 (permalink)
Senior Member
 
Join Date: Oct 2009
Posts: 300
Default

you have two timers and both the onTimer events dont specify the timer they relate too and i think you wern't spawning and despawning them properly.

also you might want to specify who activates the triggerzone "onEnter_ZONENAME_UNITNAME()" because the way you have it, if anyone enters the triggerzone not just you, the enemy will spawn.

also your onObjectiveCompleted function is not correct I think.

Code:
function onTimer()
OFP:move("Echelon", "wp", "OVERRIDE")
end
I get the timers workin using

Code:
function onTimer_TIMERNAME()

try copy and pasting this I think it should work..


Code:
 function onMissionStart()
 
objstate = 0;
EnemySpawn = 0;
EnemySpawn2 = 0;


 OFP:setObjectiveState("obj","IN_PROGRESS")
 OFP:setObjectiveState("obj2","IN_PROGRESS")
 end

function onEnter(triggerzone, player)
EnemySpawn=OFP:activateEntitySet("enemy");
OFP:addTimer("waiting", 2000)
end
 
function onTimer_waiting()
OFP:move("Echelon", "wp", "OVERRIDE")
end
 
function onDeath(victim, killer)
if OFP:isAlive("Echelon")== false then
OFP:destroyEntitySet(EnemySpawn);
EnemySpawn2=OFP:activateEntitySet("Enemy2");
OFP:addTimer("waiting2", 2000)
end
 
function onTimer_waiting2()
OFP:move("Echelon1", "wp1", "OVERRIDE")
end
end
 

function onDeath(victim, killer)
if OFP:isAlive("Echelon")== false then
objstate=objstate +1; 
OFP:setObjectiveState("obj", "COMPLETED");
end
end

function onDeath(victim, killer)
if OFP:isAlive("Echelon1")== false then
objstate=objstate +1; 
OFP:setObjectiveState("obj2", "COMPLETED");
end
end
 
function onObjectiveCompleted_obj()
if objstate==2 then
OFP:missionCompleted()
end
end


function onObjectiveCompleted_obj2()
if objstate==2 then
OFP:missionCompleted()
end
end

Last edited by RIKKI_B; 23-10-2009 at 02:04 PM.
RIKKI_B is offline   Reply With Quote
Old 23-10-2009, 01:41 PM   #3 (permalink)
Senior Member
 
Join Date: Oct 2009
Posts: 172
Default

EnemyspawnEtc is giving that variable a value. You want a variable that will give +1 on Echelon death.
__________________
Download the Improved AI mod by TemplarGFX
Cellus is offline   Reply With Quote
Old 23-10-2009, 01:50 PM   #4 (permalink)
Senior Member
 
Join Date: Oct 2009
Posts: 300
Default

Is that not what i put in his script for him cellus? I think it might be corrct but your more experienced then me
RIKKI_B is offline   Reply With Quote
Old 23-10-2009, 01:55 PM   #5 (permalink)
Senior Member
 
Join Date: Oct 2009
Posts: 172
Default

No, I mean - you're giving that variable a value, but that variable is never referenced. I would write an example, but I'm struggling with my keyboard at the moment...


Oh - and you really need to title your threads properly so others can search the problem easily.
__________________
Download the Improved AI mod by TemplarGFX

Last edited by Cellus; 23-10-2009 at 01:58 PM.
Cellus is offline   Reply With Quote
Old 23-10-2009, 02:03 PM   #6 (permalink)
Senior Member
 
Join Date: Oct 2009
Posts: 300
Default



you mean the objstate variable? or the EnemySpawn one?
RIKKI_B is offline   Reply With Quote
Old 23-10-2009, 02:05 PM   #7 (permalink)
Senior Member
 
Join Date: Oct 2009
Posts: 172
Default

Latter. So hard to type. Soryy, speak poorly right now.
__________________
Download the Improved AI mod by TemplarGFX
Cellus is offline   Reply With Quote
Old 23-10-2009, 02:08 PM   #8 (permalink)
Senior Member
 
Join Date: Oct 2009
Posts: 300
Default

no problem i'm just trying to steal some of your knowlege I'm interested about that too when you are capable of typing. Because when I read that in a post it worked for me, but i thought that it was never being referenced too, so wonderd why it worked, or if i was doing it slightly wrong, because the despawns wouldnt work properly without it :S
RIKKI_B is offline   Reply With Quote
Old 23-10-2009, 02:17 PM   #9 (permalink)
Senior Member
 
Join Date: Oct 2009
Posts: 172
Default

obj1 must come before obj2. Redundant. Sloppy.

Multiple onDeath - bad medicine. sometime not so bad, usually break code all.
__________________
Download the Improved AI mod by TemplarGFX
Cellus is offline   Reply With Quote
Old 23-10-2009, 03:43 PM   #10 (permalink)
Member
 
Join Date: Oct 2009
Posts: 34
Default

Cheers for all the help lads, i usually do name my threads accordingly mate, i kinda put this one up in a fit of rage after spending the whole night trying to get this to work, hope to steal some knowledge of you as well Cellus when your up and running, thanks again guys.
Adamdf is offline   Reply With Quote
Reply

Bookmarks

Tags
complete, objective, player, spawn

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 04:10 PM.


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