Welcome, Guest Thursday 24th April 2014, 04:13:36
   Home   Help Search Login Register  

OFPEC Forum

Author Topic: How to put Object on table?  (Read 189 times)
0 Members and 1 Guest are viewing this topic.
ahmed117
*
Offline Offline


The 3d!t0R -=I.S.I=-


« 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)


* ColdWarAssault 2012-01-16 13-10-31-71.JPG (88.78 KB, 1024x768 - viewed 10 times.)
Logged

The 3d!t0R            -=O.F.P.E.C=-                                                         -=I.S.I=-
Doktor Headshot
*
Offline Offline



WWW
« Reply #1 on: 16 Jan 2012, 09:36:28 »

This is easy, man!
Just put this in the "init" field of your object:

Code:
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 » Logged

? (_this == thinkable) : _this == scriptable
Aldo15
OFP-addict
Missions Depot Staff
*****
Offline Offline



WWW
« 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:
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 » Logged

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
savedbygrace
Intel Depot
Administrator
*****
Offline Offline


Be swift to hear...slow to speak...slow to wrath.


« 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.
Logged
Pages: [1]   Go Up
  Send this topicPrint  
 
Jump to: