Operation Flashpoint Dragon Rising OFDR Forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Randomising objectives

Go down

Randomising objectives Empty Randomising objectives

Post by TheGeneral Sat 22 Jun 2013, 16:29

Is it possible to randomise objectives in the editor, I've been trying to do something that was suggested to me about a set of objectives that need to be done but you don't know what they are until you go in game and the info is made clear at that point.

here is what I have tried using the basic randomisation code.


Code:
function onMissionStart()
     objectives = {"objset1","objset2","objset3","objset4"}
     obj_points = {"obj","obji1","obji2","obji3"}
    EDX:simpleTimer("objtimer", 3000)

end

function objtimer()
        local random_obj = math.random (1,#objectives)
        local random_pts = math.random (1,#obj_points)
        objspawn = OFP:spawnEntitySetAtEntityPosition(objectives[random_obj],obj_points[random_pts])
end

Each objective is placed into a set in the objectives table above in onMissionStart(). In theory this should work, but unless I have something spelt wrong or the objectives are not able to be spawned in (I can't remember!) be great if someone can solve this.

Possible solution would be to make the objectives invisable, then get them randomly visable.

The plan is to have four locales on the map, once you start, you don't know what, where you have to go until one pops up in game after a timed delay. Once you get there, it could be a case of assault, defend, recon, destroy, etc etc.

Cheers

MD
TheGeneral
TheGeneral
Admin

Points : 780
Reputation : 35
Join date : 2012-12-15

http://maniacaldog.wix.com/keepdralive

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum