Home   Help Search Login Register  

Author Topic: fence naming and placing  (Read 887 times)

0 Members and 1 Guest are viewing this topic.

Offline 456820

  • Contributing Member
  • **
fence naming and placing
« on: 21 Jun 2005, 16:54:54 »
okay im trying to simulate the player creating a small fence just one of those sand bag walls wich are about knee high.
but i dont know the name for it or how do i create it so its flat where the player is looking at it 2m infrom of the player
for example the player is the 2dots and the sand bag is the line and thats how i want it to be
 ----
  ..

okay you might not get this but i cant really explaing very well

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:fence naming and placing
« Reply #1 on: 21 Jun 2005, 17:40:13 »
Code: [Select]
"FenceWood" camCreate [(position player select 0)+2*sin(direction player),(position player select 1)+2*cos(direction player),0]
should work unless I typoed something ::)

Of course you would need some setDir stuff also to get the fence to face the right way...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline 456820

  • Contributing Member
  • **
Re:fence naming and placing
« Reply #2 on: 21 Jun 2005, 17:44:28 »
okay thanks alot ill have a go at that hopefeully i can get it the right way
thanks ill have a go now

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:fence naming and placing
« Reply #3 on: 21 Jun 2005, 18:05:30 »
read this, my post at the bottom of the page...

Offline 456820

  • Contributing Member
  • **
Re:fence naming and placing
« Reply #4 on: 21 Jun 2005, 18:48:58 »
hey bedges i looked at that thread and found your post it works but it always seems to bury the object into the ground
Code: [Select]
_x = getpos player select 0
_y = getpos player select 1
_dir = getdir player

w1 = "wire" camcreate [_x + (2*sin(_dir)), _y + (2*cos(_dir))]
w1 setdir _dir+90  

thats the code and it seems half in the ground but it does create it in the right place and everything
but im also having trouble on being able to pick it up im using this as a script to take it

Code: [Select]
? player distance w1 <= 2 : goto "next"
EXIT

player playmove "CombatToPutDown"
~0.25
deletevehicle w1
~0.50
player playmove "Crouch"
~0.25
action1 = false
player addaction ["Place sandbag wall", "fence.sqs"]
#exit
EXIT

the player just doesn do anything when he should bend down and it should delete the fence or is it wrong using deletevehicle also he doesnt bend down so theres something wrong there
EDIT - I think ive done it just need to test
« Last Edit: 21 Jun 2005, 18:49:14 by 456820 »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:fence naming and placing
« Reply #5 on: 21 Jun 2005, 18:58:56 »
the code was written before i made the missionette, which corrects the buried-object problem. open it up and take a look...

as for the second question, you have a goto "next" command, wihtout a corresponding '#next' marker...  ::)

Offline 456820

  • Contributing Member
  • **
Re:fence naming and placing
« Reply #6 on: 21 Jun 2005, 18:59:16 »
okay thanks bedges for that thread i fixed the distance problem with snYpirs distance function and it works great now apart from the fence being half in the ground

EDIT - We were posting at the same time i will have a look and thanks for it
« Last Edit: 21 Jun 2005, 19:00:05 by 456820 »

Offline 456820

  • Contributing Member
  • **
Re:fence naming and placing
« Reply #7 on: 21 Jun 2005, 19:02:41 »
i looked in the mission and copied the code but the fence is still under the ground ?

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:fence naming and placing
« Reply #8 on: 21 Jun 2005, 19:31:04 »
works fine on my machine, running terrain detail at normal. i do recall having to place objects about 0.5m up to fix the buried problem.

Offline 456820

  • Contributing Member
  • **
Re:fence naming and placing
« Reply #9 on: 21 Jun 2005, 19:36:14 »
ill try slightly higher see if that helps