Home   Help Search Login Register  

Author Topic: Fencebuilder script  (Read 527 times)

0 Members and 1 Guest are viewing this topic.

Offline Blanco

  • Former Staff
  • ****
Fencebuilder script
« on: 14 May 2004, 17:14:10 »
I would like a script to place fences easier via scripting.

Like this :

1th param : position (a gamelogic or marker, position array...)
2th param : The classname of the fence
3th param : The lenght of the fence
4th param : The direction
5th param : How many fences (parts)

eg : [position, "AAA821",3.2,0,5] exec "scriptname.sqs"

This should create 5 fences (lenght 3.2m) at the position, facing north, perfectly alined.

Offcourse the lenght is different for every fence...
"AAA821" is just an example...

Is this do-able?






Search or search or search before you ask.

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Fencebuilder script
« Reply #1 on: 14 May 2004, 19:42:06 »
That would seem easy enough to do. I would suggest doing the params like this though:

STARTING POSITION
ENDING POSITION
CLASSNAME OF FENCE
DIRECTION OFFSET (true/false, see below)
LENGTH OF EACH FENCE SEGMENT

Internally, the script would figure out the direction between the two positions, the distance between them, and divide that by the length of the fence segment, to give the number of segments to make. You also might make a sort of 'database' internally in the program, that would have pre-recorded values for the length of various fence segments from the EU; fences not included in this 'database' would still need you to enter in a value.

Since some fences run east-west when they are set at 0 direction, and some run north-south when at 0 direction, you would need a variable to tell the script which one of these the fence does.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline Blanco

  • Former Staff
  • ****
Re:Fencebuilder script
« Reply #2 on: 14 May 2004, 20:28:44 »
That's even better! It sounds like you had the same idea, general :)

This could be a very usefull script and save you lots of time.

Search or search or search before you ask.

DBR_ONIX

  • Guest
Re:Fencebuilder script
« Reply #3 on: 15 May 2004, 17:27:58 »
I've attached the script :)
It's from the Pathfinders mission (Comes with the C47)
It's in the ed depot too, I think

Only improvement it needs in a setpos type thing (If I remeber) to change the direction

Oh, and you need the class name for the fence :)
- Ben

Offline Blanco

  • Former Staff
  • ****
Re:Fencebuilder script
« Reply #4 on: 17 May 2004, 21:21:40 »
Isn't that a script to create carpetbombing?
Can I use this script as template for a fencebuilding script?
I'm missing 2 functions... Relposcoord & Getrelpos

Ok, I found them...


« Last Edit: 17 May 2004, 21:22:15 by Blanco »
Search or search or search before you ask.

DBR_ONIX

  • Guest
Re:Fencebuilder script
« Reply #5 on: 22 May 2004, 14:39:50 »
Yeah, it guess it could be used to make carpet bombing *Eyes widen :D*
But I'll look for the readme-d version of ofpec just now
I hadn't really looked at the script until lastnight (To make the fence thing for a DDay mission I'm making).. And noticed how confusing it iss ::)

Here : http://www.ofpec.com/editors/resource_view.php?id=525

- Ben
BTW, dunno if that gives a nolink page, if so, search for chain in the editors depot :)