Home   Help Search Login Register  

Author Topic: How to put Object on table?  (Read 1833 times)

0 Members and 1 Guest are viewing this topic.

Offline ahmed117

  • Members
  • *
  • The 3d!t0R -=I.S.I=-
How to put Object on table?
« on: 16 Jan 2012, 09:24:35 »
Hi guys,
          I was wondering that how object are placed on tables such as a radio in official campaigns. I tried it several time but the object falls down the table, as shown in the picture.If any one knows how to put radio on table so please help me.

Ahmed 117 (A.rogers)
The 3d!t0R            -=O.F.P.E.C=-                                                         -=I.S.I=-

Re: How to put Object on table?
« Reply #1 on: 16 Jan 2012, 09:36:28 »
This is easy, man!
Just put this in the "init" field of your object:

Code: [Select]
this setPos [(getPos this select 0), (getPos this select 1), x]
and change the x with number... Try putting 0.5 and item should appear right above table; if you don't get right height of object at first try, you may need a few more attempts by little increasing that value in order to find correct height.
« Last Edit: 16 Jan 2012, 19:27:43 by Guido89 »
? (this == thinkable) : this = scriptable

Offline Aldo15

  • OFP-addict
  • Former Staff
  • ****
    • My OFP missions
Re: How to put Object on table?
« Reply #2 on: 16 Jan 2012, 23:49:52 »
I agree with Guido, but I'll suggest you, don't write 'this' because you'd have to place it yourself, but if you change it for 'name of table' for example if your table is called 'tableone'. You will need the following command
Code: [Select]
this setpos [getpos tableone select 0 , getpos tableone select 1 , 1]
1, it's the correct heigh, for the table.
« Last Edit: 16 Jan 2012, 23:52:54 by Aldo15 »
My OFP stuff
FMF Project by Aldo15. Coming soon.
If in the high school or university, Teachers add a new subject about how to make scripts, missions, for ofp. I'd be number one of my classroom

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: How to put Object on table?
« Reply #3 on: 20 Jan 2012, 20:02:38 »
Got to be careful with naming objects in OFP. Only name objects that scripts will interact with so that you keep the number of global variables to a minimum. Otherwise you risk an encounter with the savegame bug. For something as simple as setting an object atop another, no names are needed, just the setpos command.