OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Blanco 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?
-
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.
-
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.
-
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
-
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...
-
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 :)