![]() |
|
|
||||||
| 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 |
23-10-2009, 11:08 AM
|
#1 (permalink) |
|
Member
Join Date: Oct 2009
Posts: 34
|
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 |
|
|
23-10-2009, 01:30 PM
|
#2 (permalink) |
|
Senior Member
Join Date: Oct 2009
Posts: 300
|
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
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. |
|
|
23-10-2009, 01:41 PM
|
#3 (permalink) |
|
Senior Member
Join Date: Oct 2009
Posts: 172
|
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 |
|
|
23-10-2009, 01:55 PM
|
#5 (permalink) |
|
Senior Member
Join Date: Oct 2009
Posts: 172
|
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. |
|
|
23-10-2009, 02:05 PM
|
#7 (permalink) |
|
Senior Member
Join Date: Oct 2009
Posts: 172
|
Latter. So hard to type. Soryy, speak poorly right now.
__________________
Download the Improved AI mod by TemplarGFX |
|
|
23-10-2009, 02:08 PM
|
#8 (permalink) |
|
Senior Member
Join Date: Oct 2009
Posts: 300
|
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
|
|
|
23-10-2009, 02:17 PM
|
#9 (permalink) |
|
Senior Member
Join Date: Oct 2009
Posts: 172
|
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 |
|
|
23-10-2009, 03:43 PM
|
#10 (permalink) |
|
Member
Join Date: Oct 2009
Posts: 34
|
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.
|
|
|
![]() |
| Bookmarks |
| Tags |
| complete, objective, player, spawn |
| Thread Tools | |
| Display Modes | |
|
|