Home   Help Search Login Register  

Author Topic: A radio on the table  (Read 708 times)

0 Members and 1 Guest are viewing this topic.

Egwal

  • Guest
A radio on the table
« on: 17 Jul 2003, 20:08:50 »
Im making a mission where you establish a small guard post, and i want to create a lv217-radio on the table, in the post.
So far IÂ've managed to get the radio to appear but it always misses the table with several meters.
i have a trigger named Radio, with the On Act.  wh1 = "SecondaryWeaponHolder" createvehicle (getpos Radio); wh1 addweaponcargo ["FDF_lv217",1] and i have placed the trigger right on top of the table where I want it to be. but it never is there.

So my 2 questions are:

1. How to get the radio to appear RIGHT on the trigger spot?

2. Now the radio is on the ground, but how can i get it on the table+ Its got somethin to do with getpos and setpos I think.

Thanks anyway

Kaliyuga

  • Guest
Re:A radio on the table
« Reply #1 on: 17 Jul 2003, 20:42:10 »
name your trigger..   t


then put this in the init of your radio:


this setpos [getpos t select 0, getpos t select 1,x]

x= height above ground
usually right about 1m for tabletop placement if I'm not mistaken ;)


Egwal

  • Guest
Re:A radio on the table
« Reply #2 on: 17 Jul 2003, 21:51:24 »
hat didnt work the way it was supposed...  >:(

you see tha redio I used isnt the one from empty->objects->radoiblabla. It was made by the weaponholder command. But i still tried it.

So i had a trigger with a On act:
wh1 = "SecondaryWeaponHolder" createvehicle (getpos Radio); wh1 addweaponcargo ["FDF_lv217",1]; this setpos [getpos Radio select 0, getpos Radio select 1,1]

It was on Radio Alpha, that when I pressed 0-0-1 the radio appeard on the ground, ON THE GROUND, not 1m from the ground. But the funny thing in this is that something lifted up... In the mission, in a nearby house i had a few chairs. And when i called the radio alpha the chair was teleported to the radio and it was on the radio, with 1m distance. It looked very funny. Take a look at the attachment pic with this post to see.

So that didnt work. Has someone got any idea how to get a weapon (with wh) on a table?

deaddog

  • Guest
Re:A radio on the table
« Reply #3 on: 18 Jul 2003, 04:07:14 »
Try using the name of the table instead of the name of the trigger.  

Also,
Quote
So i had a trigger with a On act:
wh1 = "SecondaryWeaponHolder" createvehicle (getpos Radio); wh1 addweaponcargo ["FDF_lv217",1]; this setpos [getpos Radio select 0, getpos Radio select 1,1]

You can't set the height of a trigger.  It doesn't mean anything.  Even if it did, in your example you are setting the height of the trigger after the radio is created, which won't move the radio at all.

name the table something like "table" (original, huh)  :) and do this:

wh1 = "SecondaryWeaponHolder" createvehicle [getpos table select 0, getpos table select 1, (getpos table select 2)+1]; wh1 addweaponcargo ["FDF_lv217",1]

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:A radio on the table
« Reply #4 on: 18 Jul 2003, 07:03:01 »
nd dont forget 2 addmagazinecaro ;) - b4 u do addweaponcargo

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Egwal

  • Guest
Re:A radio on the table
« Reply #5 on: 18 Jul 2003, 10:08:04 »
Try using the name of the table instead of the name of the trigger.  

Also,You can't set the height of a trigger.  It doesn't mean anything.  Even if it did, in your example you are setting the height of the trigger after the radio is created, which won't move the radio at all.

name the table something like "table" (original, huh)  :) and do this:

wh1 = "SecondaryWeaponHolder" createvehicle [getpos table select 0, getpos table select 1, (getpos table select 2)+1]; wh1 addweaponcargo ["FDF_lv217",1]


Still didnt work. I named the table, and copypasted the code straight from your post(so no errors). Then I set the trigger to Anybody - Present, so it would go off right when the mission started. And still the radio was on the ground and about 3 meters from the table(see on the attachment pic).

The radio was supposed to be on the table without the map, but instead it was behind the house, on the ground.

This really shouldnt be so difficult, since Ive heard many ppl ask how to get a pistol on the table. This is practicly the same thing, execpt with a radio(which counts as a heavy weapon eg. law or stinger, since u can pick up the radio).

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:A radio on the table
« Reply #6 on: 18 Jul 2003, 10:20:48 »
Here is something I've found when using createvehicle:

OFP will not put the object exactly where you want it. It's position will be effected by the other objects around it, and it will tend to end up in the nearest 'free' space.

Sometimes this is fine, as the object isn't being placed right in the middle of things. But if it is (and it ends up in strange places, like in this case), here's how you fix it...

Create your object at any old position. (eg. [0,0,10]). Now use setpos to put your object where you actually want it...
You can put things inside of walls with setpos, as it doesn't seem to have a clipping function like createvehicle has...

So to summarise, try this line here:

wh1 = "SecondaryWeaponHolder" createvehicle [0,0,10]; wh1 setpos [getpos table select 0, getpos table select 1, (getpos table select 2)+1]; wh1 addweaponcargo ["FDF_lv217",1]

Hope that helps you out ;)

Egwal

  • Guest
Re:A radio on the table
« Reply #7 on: 18 Jul 2003, 11:17:06 »
Thanks Sui, that worked perfectly.