Spawning an Entity Set
3 posters
Operation Flashpoint Dragon Rising OFDR Forums :: OPERATION FLASHPOINT: DRAGON RISING :: OFDR EDITING :: TUTORIALS
Page 1 of 1
Spawning an Entity Set
Previous:Creating an Entity Set
If you have already used the Creating an Entity Set tutorial you are now probably be wandering how to see them in your game. This can be acheived in a few ways: Timers, using distances, or the most common practice for it is using Triggerzones, which is what you are now going to do.
So the next step then:
Selecting a triggerzone
1. Click on your create tab in the UI(user interface)
2. Select "systems" at the top of the window pane.
3. Then select Missions. This will drop down a list of the items you can place on the map from objectives to waypoints and the one you need which is, Triggers.
Placing the Triggerzone
Once you have selceted the triggerzone you can place it anywhere on the map in one of two shapes, a circle or a square. You can change this in the properties of the triggerzone once you have selected it. You will also notice a "From Sea Level" and "From Ground" pair of buttons. Leave your triggers on "From Sea Level" unless you are trying something alittle bit more advanced.
You will notice that the triggerzone is highlighted in the image. This is to show you that each corner has a node and these are movable so you can change the shape of your square. You can move one by itself or you can drag you cursor over two or three and move just those. Play around with it until you are happy with the shape you want.
If you want to resize the whole zone so it covers a larger area, you can use the resize tool in the toolbar between the rotate and hand icons.
(note: you can also rename the zone if you want in the modify window, the same way the player characters can be named. Remember though, keep it simple and you can't go wrong.)
Writing the Process
Ok, so we have our set made, we have our trigger selected and placed on the map. Now comes the code writing for the spawning process.
1. Go back to the systems tab and select Scripting
2. select "Level script( can handle events)".
3. Now place the Level lua icon anywhere on the map. This has now created a new tab above the map, abit like a page for you to write on basically.
What you are going to do now is place a Hummvee/jeep into a set in the explorer tab just the same way you did for your fireteam. You will find it in the vehicles list in either the USMC or PLA tabs. Name your set what ever you like, I am calling mine "HumVset"
Once you have made that set for your vehicle, go to your Level.lua tab and delete the first line there in green.
Replace it with:
Once you test it you should have something like this straight away when you go into the game.
You will see when you test the game that as soon as the game starts the vehicle will appear in game exactly where you placed it on the map.
Now you only have one humvee in game and only four guys can fit inside it. You may want to think about placing another on the map, anywhere you like, then when the rest of your team spawns in you have enough room to transport them all anywhere on the map. Keep it in the same set and place it nearby.
Now the next part we are going to apply the code for using the triggerzone to bring our fireteam in on the action.
place this code in the Level.lua underneath the previous part of code.
Then test the game again. This time you have to walk into the triggerzone. If all is correct and the code is exactly as it is on this page then you should have a fireteam and a jeep spawned in front of you.
This is as basic as it gets but there are other ways to bring units into the game that revolve around alot more complex code. This so far is enough to get you started. check out the next tutorial which will cover attaching a unit/fireteam so you can give them orders to do things.
If you have already used the Creating an Entity Set tutorial you are now probably be wandering how to see them in your game. This can be acheived in a few ways: Timers, using distances, or the most common practice for it is using Triggerzones, which is what you are now going to do.
So the next step then:
Selecting a triggerzone
1. Click on your create tab in the UI(user interface)
2. Select "systems" at the top of the window pane.
3. Then select Missions. This will drop down a list of the items you can place on the map from objectives to waypoints and the one you need which is, Triggers.
Once you have selceted the triggerzone you can place it anywhere on the map in one of two shapes, a circle or a square. You can change this in the properties of the triggerzone once you have selected it. You will also notice a "From Sea Level" and "From Ground" pair of buttons. Leave your triggers on "From Sea Level" unless you are trying something alittle bit more advanced.
You will notice that the triggerzone is highlighted in the image. This is to show you that each corner has a node and these are movable so you can change the shape of your square. You can move one by itself or you can drag you cursor over two or three and move just those. Play around with it until you are happy with the shape you want.
If you want to resize the whole zone so it covers a larger area, you can use the resize tool in the toolbar between the rotate and hand icons.
(note: you can also rename the zone if you want in the modify window, the same way the player characters can be named. Remember though, keep it simple and you can't go wrong.)
Writing the Process
Ok, so we have our set made, we have our trigger selected and placed on the map. Now comes the code writing for the spawning process.
1. Go back to the systems tab and select Scripting
2. select "Level script( can handle events)".
3. Now place the Level lua icon anywhere on the map. This has now created a new tab above the map, abit like a page for you to write on basically.
Replace it with:
- Code:
function onMissionStart()
OFP:activateEntitySet("humvset")
end
Once you test it you should have something like this straight away when you go into the game.
You will see when you test the game that as soon as the game starts the vehicle will appear in game exactly where you placed it on the map.
Now the next part we are going to apply the code for using the triggerzone to bring our fireteam in on the action.
place this code in the Level.lua underneath the previous part of code.
- Code:
function onEnter(zoneName, unitName)
OFP:activateEntitySet("testset")
end
Then test the game again. This time you have to walk into the triggerzone. If all is correct and the code is exactly as it is on this page then you should have a fireteam and a jeep spawned in front of you.
Re: Spawning an Entity Set
Thankx mate! I always wondered why couldnt i spawn ppl cuz i was uskng spawnEntityAtWatpoint xD can u explain how to use this command too? And how do u launch the game in windowed mode? Cheers
nepgeargo- Points : 62
Reputation : 0
Join date : 2013-03-20
Re: Spawning an Entity Set
to open in a windowed version you press the live link button at the top of the editor.
I can send you a pdf Manual tutorial if you like. I made it a few months back and no one seemed to be interested in it so I shelved it.
It is handy for what you want to do as a basic mission start of. Big word of advice, think small then go big once you have the nack of programming this game.
There is always the EDx which doesn't involve alot of coding, but it does require a basic understanding of how to code for the game.
If you haven't got it, GET IT! I can't stress how advantageous it is for the newcomer to DR now and mission editing.
The modules that are available are all named in the EDx forum, so give me a shout and I can send you what you like as long as it is recently updated.
TJdagger has been busy of late and hasn't had chance to do the tutorial video for quite a lot of them.
Its good to see you playing around in the editor though, DON'T GIVE UP IF THINGS PISS YOU OFF WITH IT!. ITS VERY REWARDING IN THE END.
I can send you a pdf Manual tutorial if you like. I made it a few months back and no one seemed to be interested in it so I shelved it.
It is handy for what you want to do as a basic mission start of. Big word of advice, think small then go big once you have the nack of programming this game.
There is always the EDx which doesn't involve alot of coding, but it does require a basic understanding of how to code for the game.
If you haven't got it, GET IT! I can't stress how advantageous it is for the newcomer to DR now and mission editing.
The modules that are available are all named in the EDx forum, so give me a shout and I can send you what you like as long as it is recently updated.
TJdagger has been busy of late and hasn't had chance to do the tutorial video for quite a lot of them.
Its good to see you playing around in the editor though, DON'T GIVE UP IF THINGS PISS YOU OFF WITH IT!. ITS VERY REWARDING IN THE END.
Re: Spawning an Entity Set
Thanks for the advise.. actually, ive been messing with this for a while.. if it pisses me off ill play a bit of armas sp, get some ideas, then go back to it on the next day =P
nepgeargo- Points : 62
Reputation : 0
Join date : 2013-03-20
Re: Spawning an Entity Set
checkout the new activeplaceables thread I've posted up.
Are you using the EDX?
Are you using the EDX?
Re: Spawning an Entity Set
No, i just found the edx last night and haddnt got time to try it.. btw, can u send me the pdf tutorial? Ill pm u my email
nepgeargo- Points : 62
Reputation : 0
Join date : 2013-03-20
Re: Spawning an Entity Set
Thanks for the tutorials, i really appreciated them! I'm a newcomer to OPF: Dragon Rising, and I know I'm a little "late" for this game, but when I played This Is War, Island War i fell in love with It. I'm very high-minded to start doing my own missions, and learn how to program on LUA. So Mdog, can you please send me this PDF Tutorial, If you still have It? I would like to read It.
fentanes96- Location : Brazil, São Paulo
Points : 10
Reputation : 2
Join date : 2013-07-11
Age : 27
Re: Spawning an Entity Set
Yeah can do that for you bud! I'll email it too you. I also have two other mssn files that I have yet to compile to a tutorial for the forum.
These involve using another method of spawning in entities and random spawing of entities. When I get round to it I'll put it up here. I tend to not bury myself in the game so much at the moment. I get a little obsessive.
Anyway, PDF is on its way.
Cheers
MD
These involve using another method of spawning in entities and random spawing of entities. When I get round to it I'll put it up here. I tend to not bury myself in the game so much at the moment. I get a little obsessive.
Anyway, PDF is on its way.
Cheers
MD
Re: Spawning an Entity Set
Thank you! It's helping a lot!
fentanes96- Location : Brazil, São Paulo
Points : 10
Reputation : 2
Join date : 2013-07-11
Age : 27
Similar topics
» Creating an Entity Set
» Spawning and Controlling Spawned Units TemplarGFX
» Entity Database Parameters Explained
» Spawning a set of props so they keep their shape
» Random amount spawning
» Spawning and Controlling Spawned Units TemplarGFX
» Entity Database Parameters Explained
» Spawning a set of props so they keep their shape
» Random amount spawning
Operation Flashpoint Dragon Rising OFDR Forums :: OPERATION FLASHPOINT: DRAGON RISING :: OFDR EDITING :: TUTORIALS
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|