OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Rytuklis on 19 Jun 2011, 22:09:44

Title: Question regarding objects
Post by: Rytuklis on 19 Jun 2011, 22:09:44
Hey, i have a question once again. How do i make a unit to spawn INSIDE the house for example in the room?
and another:

I spawn radio and the table, how do i put radio on the table?
Title: Re: Question regarding objects
Post by: bedges on 20 Jun 2011, 08:34:57
The answers to these and all of the questions you've asked recently can be found very quickly and easily by searching the forum (http://www.ofpec.com/forum/index.php?action=search). The advanced search option even lets you select only the OFP editing boards.

For example, a quick search for "spawn inside building" reveals this thread (http://www.ofpec.com/forum/index.php?topic=20884.msg138790#msg138790).

Your turn: try searching for "object on table" and read the third thread in the result list.

OFPEC is here to help you, but you need to help yourself first.
Title: Re: Question regarding objects
Post by: Rytuklis on 20 Jun 2011, 09:31:30
Well, i tried searching object on table but found nothing ... Those search results isnt even related to what i need to find..
Title: Re: Question regarding objects
Post by: Walter_E_Kurtz on 20 Jun 2011, 13:50:02
Aren't they? Because the answer does involve setPos (http://www.ofpec.com/COMREF/index.php?action=details&id=313&game=All).

As an aside, are you sure you need to spawn these objects? It would be much easier to place them in the mission editor - then they'd need only to be setPos'd one above the other, and you could easily change their orientation.


Step 0
   Know where the table will be, either its position OR place something invisible. For this illustration that will be a marker called table_point.

Step 1
   Generate the table.
         table1 = "Table" createVehicle (http://www.ofpec.com/COMREF/index.php?action=details&id=86&game=All) getMarkerPos "table_point"

Step 2
   Generate the radio.
         wasteofspace = "Radio" createVehicle getMarkerPos "table_point"

Step 3
   Position the radio atop the table. The third entry in the array is what raises it off the ground.
         wasteofspace setPos [(getPos table1) select 0, (getPos table1) select 1, ((getPos table1) select 2) + 1]


If you need to rotate them, use setDir (http://www.ofpec.com/COMREF/index.php?action=details&id=293&game=All).
Title: Re: Question regarding objects
Post by: bedges on 20 Jun 2011, 23:58:52
Okay. Here's what I did:
Quote
The advanced search option even lets you select only the OFP editing boards.
and
Quote
try searching for "object on table" and read the third thread in the result list.

The opening post in that thread post says this:

Quote
How do I place an object (like a telephone, computer, or radio) on top of a table.

The second post in that thread has the answer.

* * *

Now, I have just spent the best part of 10 minutes doing all that and typing it here. I do not consider it a waste of time though, because if it makes clear to you that the answers are all there - especially to such basic questions as the ones you've been asking - and if it shows you just how simple it is to find the answers, then maybe you'll stop wasting your time - and ours - by expecting us to lay these answers in front of you when they've been answered many times before.

Quote
Those search results isnt even related to what i need to find..

Uh huh.  :dry: