Home   Help Search Login Register  

Author Topic: Creating Fightposistion  (Read 4715 times)

0 Members and 4 Guests are viewing this topic.

Robinhansen

  • Guest
Re:Creating Fightposistion
« Reply #15 on: 14 Feb 2005, 15:32:33 »
The addaction works ;D tnx for that...

The posistions are still a bit random but it's the best so far... ;D
I dont think its getting any better by now. :)

Cheers to all hwo helped me solving this... ;)

Robinhansen

  • Guest
Re:Creating Fightposistion
« Reply #16 on: 16 Feb 2005, 11:35:22 »
Look who's back, lol. I've an additional question. Is there a way to remove what the player just created again? But only when the player is within aprox. 1m. from the item. Then the script would be a great cargoscript as well...
 :P :P

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Creating Fightposistion
« Reply #17 on: 16 Feb 2005, 22:06:32 »
give it an action to delete it
when the player gets close to it the action will be given to him

Robinhansen

  • Guest
Re:Creating Fightposistion
« Reply #18 on: 16 Feb 2005, 22:12:38 »
I've allready thought of that ;) but the only eraser script I could find is this one made by shark attack, but I can't make it work >:(

http://www.ofpec.com/editors/browse.php?searchopts=&start=125

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Creating Fightposistion
« Reply #19 on: 17 Feb 2005, 22:33:18 »
when you create it give it an action to delete it

here is the script you'll need:
Code: [Select]
delectevehicle (_this select 0)
thats it

actions can't have arguments in with the script, so there are only a few things you can get when you use actions

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Creating Fightposistion
« Reply #20 on: 17 Feb 2005, 23:58:17 »
I'm not too good at this type of thing, but couldn't you de-pbo the 'hold montignic' mission from the Red Hammer campaign and see what script was used there, when you could place a tank trap in front of you using the action menu?  :P
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Robinhansen

  • Guest
Re:Creating Fightposistion
« Reply #21 on: 18 Feb 2005, 13:08:36 »
I know what you mean. Hold Montinac is my inspiration, no doubt about that  ;) But that mission only allow the player to create limited tankbarreirs, due to the fact that they allready are placed on the map (I guess some kind of a "teleportation" script are used here).
The script I whant is the player is able to create several items out of "nothing" and beeing able to erase it again when near it.
 :D

Robinhansen

  • Guest
Re:Creating Fightposistion
« Reply #22 on: 22 Feb 2005, 17:31:15 »
No matter what I try this sentence: delectevehicle (_this select 0) is not enough to delete the item again. At least I don't konw how to. :(
Sorry for being a scripting noob :-\

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Creating Fightposistion
« Reply #23 on: 22 Feb 2005, 22:59:48 »
in the script that makes the object, put this line:
_fightpos addaction ["get rid of this crap!", "delete_it.sqs"]

then put this in a script called delete_it.sqs
deletevehicle (_this select 0)
(_this select 0) removeaction (_this select 2)

when a player walks up to it, he will get the action "get rid of this crap!"
when used, it gets deleted
ok? ok :P
« Last Edit: 22 Feb 2005, 23:01:09 by Triggerhappy »

Robinhansen

  • Guest
Re:Creating Fightposistion
« Reply #24 on: 22 Feb 2005, 23:33:36 »
I'm really pleased about all the work that you have putted in this script, so I'm sad to announce that the delete_it script doesen't work. I been trying the whole day with something simular, wich did'nt work either by the way... :'(

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Creating Fightposistion
« Reply #25 on: 23 Feb 2005, 04:33:52 »
that should work, always has, always will, either syntax problems or... i don't know what else
perhaps you get error messages? or maybe you accidentally saved the script as delete_it.sqs.txt?
or some other silly mistake?

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Creating Fightposistion
« Reply #26 on: 23 Feb 2005, 04:55:36 »
in fact, i just did it
attached are 2 create delete actions (one of each) and you get to sit on desert isle and make a jeep then delete it and then destroy it again.

at first the action doesn't seem to register, but just wait a second, and it will show up (on the jeep you make) then you can delete it and make a new somewhere else.
it also setsthe jeeps pos/direction in relation to the player
problem solved now?
« Last Edit: 23 Feb 2005, 04:56:40 by Triggerhappy »

Robinhansen

  • Guest
Re:Creating Fightposistion
« Reply #27 on: 23 Feb 2005, 15:49:38 »
This is so mutch it!! :D

I really suggest that you send this to the Editors Depot, and take full credit for it.

Can't explain enough how much I like this script!!!

 ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D

Robinhansen

  • Guest
Re:Creating Fightposistion
« Reply #28 on: 14 May 2005, 02:17:35 »
So, after playing around with this script for aprox 3 month now, I've commed to the conclution that it's to inaccurate. When creating fightposistions it works fine, but when creating barbwire and sandbags it useless :-[! How can I create the wire'n sandbags excactly 2 meters in front of the player in an angle of 90 degrees? (Just like in the SP-game Iron Wall and mission 18 - Ambush in Red Hammer...

P.S I've tried aprox 1000 solutions, so this forum is my last chance... ;)

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Creating Fightposistion
« Reply #29 on: 14 May 2005, 10:52:43 »
not having followed this thread i'm not sure what solutions you're working with. however, i'll offer my tuppenceworth of advice ;)

firstly, decide which method you're using to create the sandbags and/or wire - are they created somewhere secret on the map and then called into position, or are they created out of thin air with the camcreate command...

either way, the objects need a name.

to answer the first part of your question - "wire'n sandbags excactly 2 meters in front of the player..."

Code: [Select]
_x = getpos player select 0
_y = getpos player select 1
_dir = getdir player

object_name setpos [_x + (2*sin(_dir)), _y + (2*cos(_dir))]


now when you say "in an angle of 90 degrees" i assume you mean you want the sandbag/wire to be at 90 degrees to the player.

Code: [Select]
object_name setdir _dir+90
will do the trick. now this all works if you have the objects already on the map and named. if you're using camcreate it's a little different. you'll need the name of wire and sandbags that the editor will recognise - i think it's something like "Fence" and "Wire".

so it would look something like this:

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


that's not tested, but i'm 99% sure it'll work. hope it helps.

EDIT - now tested, see attached missionette....
« Last Edit: 14 May 2005, 11:08:58 by bedges »