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.

Spawning an Entity Set

3 posters

Go down

Spawning an Entity Set Empty Spawning an Entity Set

Post by TheGeneral Mon 17 Dec 2012, 22:09

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.

Spawning an Entity Set Select10
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.

Spawning an Entity Set Placin11


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.

Spawning an Entity Set Level_10
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"

Spawning an Entity Set Vehicl10
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:

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.

Spawning an Entity Set Spawne10
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.

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.

Spawning an Entity Set Sets_s10
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.
TheGeneral
TheGeneral
Admin

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

http://maniacaldog.wix.com/keepdralive

Back to top Go down

Spawning an Entity Set Empty Re: Spawning an Entity Set

Post by nepgeargo Thu 21 Mar 2013, 16:01

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 Very Happy
nepgeargo
nepgeargo

Points : 62
Reputation : 0
Join date : 2013-03-20

Back to top Go down

Spawning an Entity Set Empty Re: Spawning an Entity Set

Post by TheGeneral Thu 21 Mar 2013, 20:15

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.
TheGeneral
TheGeneral
Admin

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

http://maniacaldog.wix.com/keepdralive

Back to top Go down

Spawning an Entity Set Empty Re: Spawning an Entity Set

Post by nepgeargo Fri 22 Mar 2013, 00:11

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
nepgeargo

Points : 62
Reputation : 0
Join date : 2013-03-20

Back to top Go down

Spawning an Entity Set Empty Re: Spawning an Entity Set

Post by TheGeneral Fri 22 Mar 2013, 00:15

checkout the new activeplaceables thread I've posted up.

Are you using the EDX?
TheGeneral
TheGeneral
Admin

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

http://maniacaldog.wix.com/keepdralive

Back to top Go down

Spawning an Entity Set Empty Re: Spawning an Entity Set

Post by nepgeargo Fri 22 Mar 2013, 00:18

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
nepgeargo

Points : 62
Reputation : 0
Join date : 2013-03-20

Back to top Go down

Spawning an Entity Set Empty Re: Spawning an Entity Set

Post by TheGeneral Fri 22 Mar 2013, 00:19

its ok I'm admin I get to see your email
TheGeneral
TheGeneral
Admin

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

http://maniacaldog.wix.com/keepdralive

Back to top Go down

Spawning an Entity Set Empty Re: Spawning an Entity Set

Post by fentanes96 Fri 12 Jul 2013, 09:41

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
fentanes96

Location : Brazil, São Paulo
Points : 10
Reputation : 2
Join date : 2013-07-11
Age : 27

Back to top Go down

Spawning an Entity Set Empty Re: Spawning an Entity Set

Post by TheGeneral Fri 12 Jul 2013, 11:13

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
TheGeneral
TheGeneral
Admin

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

http://maniacaldog.wix.com/keepdralive

Back to top Go down

Spawning an Entity Set Empty Re: Spawning an Entity Set

Post by fentanes96 Sat 13 Jul 2013, 00:28

Thank you! It's helping a lot!
fentanes96
fentanes96

Location : Brazil, São Paulo
Points : 10
Reputation : 2
Join date : 2013-07-11
Age : 27

Back to top Go down

Spawning an Entity Set Empty Re: Spawning an Entity Set

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

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