Why doesn't this work?
Operation Flashpoint Dragon Rising OFDR Forums :: OPERATION FLASHPOINT: DRAGON RISING :: OFDR EDITING :: EDITING Q+A
Page 1 of 1
Why doesn't this work?
Need some help with a bit of code not working as it should.
Basically, when the plaarm_set spawns (an armoured group of 8 vehicles), they're supposed to S&D at the player's location to force a retreat back to his base. This completes the mission. They spawn with no problems but fail to carry out the S&D order, just sitting at their spawn point.
Any ideas???
Thank
RC
- Code:
function onDeath(victim, killer)
if OFP:wasInGroup("plaset1group") then
local grp_size = OFP:getGroupSize("plaset1group")
if grp_size == 0 and plaspawn == true then
OFP:destroyEntitySet(pla_set)
OFP:disableEvent("spawnEntitySetAtEntityPosition_plaset_plaspawn1")
OFP:despawnEntity("mitsutrigger")
OFP:setObjectiveState("obj1", "COMPLETED")
OFP:setObjectiveState("obj2", "IN_PROGRESS")
OFP:setObjectiveVisibility("obj2", true)
objstate = 1
if OFP:isInTrigger("plyr", "mitsuzone") and plaspawn == true then
plaarm_set = OFP:spawnEntitySetAtEntityPosition("plaarmset", "plaspawn2")
OFP:displaySystemMessage("HQ: All AAA infantry neutralised")
OFP:displaySystemMessage("Tracking multiple Armoured units advancing on MITSULEVKA.")
OFP:displaySystemMessage("Advise you get the **** out of Dodge")
OFP:displaySystemMessage("and RTB immediately - OUT")
OFP:disableEvent("spawnEntitySetAtEntityPosition_plaarmset_plaspawn2")
onSpawnedReady(setName, setID, tableOfEntities, errorCode )
if setID == plaarm_set then
OFP:searchAndDestroy(tableOfEntities[1], "armobj", 100, false, "ADDTOFRONT")
end
OFP:activateRVChain("extractrvpath")
OFP:setRVChainVisibility("extractrvpath", true)
end
end
elseif OFP:wasInGroup("usmcgroup") then
local usgrp_size = OFP:getGroupSize ("usmcgroup")
if usgrp_size == 0 then
OFP:destroyEntitySet("usmcset")
OFP:disableEvent("activateEntitySet_usmcset")
OFP:setObjectiveState("obj1", "FAILED")
OFP:missionFailed()
end
end
end
Basically, when the plaarm_set spawns (an armoured group of 8 vehicles), they're supposed to S&D at the player's location to force a retreat back to his base. This completes the mission. They spawn with no problems but fail to carry out the S&D order, just sitting at their spawn point.
Any ideas???
Thank
RC
Guest- Guest
Re: Why doesn't this work?
OFP:wasInGroup(victim,"plaset1group")
onSpawnedReady is a separate function.
You cannot disable a spawn. Remove that line. I'm typing this on my cell or I'd post fixed code.
onSpawnedReady is a separate function.
You cannot disable a spawn. Remove that line. I'm typing this on my cell or I'd post fixed code.
Guest- Guest
Re: Why doesn't this work?
OK... easier to type on a real keyboard.
This is untested, but should work in the context of your code.
Cheers and Merry Christmas!
- Code:
function onDeath(victim, killer)
if OFP:wasInGroup(victim, "plaset1group") then
local grp_size = OFP:getGroupSize("plaset1group")
if grp_size == 0 and plaspawn == true then
OFP:destroyEntitySet(pla_set)
OFP:disableEvent("spawnEntitySetAtEntityPosition_plaset_plaspawn1")
OFP:despawnEntity("mitsutrigger")
OFP:setObjectiveState("obj1", "COMPLETED")
OFP:setObjectiveState("obj2", "IN_PROGRESS")
OFP:setObjectiveVisibility("obj2", true)
objstate = 1
if OFP:isInTrigger("plyr", "mitsuzone") and plaspawn == true then
plaarm_set = OFP:spawnEntitySetAtEntityPosition("plaarmset", "plaspawn2")
OFP:displaySystemMessage("HQ: All AAA infantry neutralised")
OFP:displaySystemMessage("Tracking multiple Armoured units advancing on MITSULEVKA.")
OFP:displaySystemMessage("Advise you get the **** out of Dodge")
OFP:displaySystemMessage("and RTB immediately - OUT")
end
end
elseif OFP:wasInGroup(victim, "usmcgroup") then
local usgrp_size = OFP:getGroupSize ("usmcgroup")
if usgrp_size == 0 then
OFP:destroyEntitySet("usmcset")
OFP:setObjectiveState("obj1", "FAILED")
OFP:missionFailed()
end
end
end
function onSpawnedReady(setName, setID, tableOfEntities, errorCode )
if setID == plaarm_set then
OFP:searchAndDestroy(tableOfEntities[1], "armobj", 100, false, "ADDTOFRONT")
end
OFP:activateRVChain("extractrvpath")
OFP:setRVChainVisibility("extractrvpath", true)
end
This is untested, but should work in the context of your code.
Cheers and Merry Christmas!
Guest- Guest
Similar topics
» Statements and how they work.
» Why don't work Numpad?
» How does the command setAiInaccuracy (OFF, NORMAL, FORCED) work?
» Why don't work Numpad?
» How does the command setAiInaccuracy (OFF, NORMAL, FORCED) work?
Operation Flashpoint Dragon Rising OFDR Forums :: OPERATION FLASHPOINT: DRAGON RISING :: OFDR EDITING :: EDITING Q+A
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|