Organizing your various scripts to one dir

ArmA editing, missions, modeling, textures, terrains

Moderators: Lone Wolf, Snake Man

Post Reply
Snake Man
Commander-In-Chief
Posts: 9338
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC
Contact:

Organizing your various scripts to one dir

Post by Snake Man » 2009-04-05 10:46:53

Organizing your various scripts is smart thing to do.

I've used a common scripts dir long time for my campaigns, for example the PMC Real War is heavily using PMC\ scripts dir setup as all the campaign missions call the various scripts from this dir.

Now I recently realized that when I'm making missions, I hardly do anymore those "dumb editor" missions where you place units and save... For me now its pretty much few units in editor and then init.sqf launches PMC\PMC_war.sqf script which starts to cause horrible war/mission to happen :)

So for example I have millions of missions with these common script names:

PMC_airsupport.sqf - A10/AH1 air support script.
PMC_artillery.sqf - fake ass artillery script, nothing special.
PMC_BLUFOR_convoy.sqf - looping BLUFOR convoy for PMC_targets locations.
PMC_corpses.sqf - neverending loop to slowly go through the corpses array and when we have reached corpse limit, delete the first corpse.
PMC_killed.sqf - is ran for all killed units, it places the dead body into an corpses array.
PMC_Mandoble_VTE.sqf - VTE suitable setting varibles for Mandoble bombs.
PMC_mlrs.sqf - fake ass MLRS script, nothing special.
PMC_mortars.sqf - fake ass mortars script, nothing special.
PMC_objectives.sqf - creates objective markers/triggers from the PMC_targets array randomly.
PMC_OPFOR_convoy.sqf - looping BLUFOR convoy for PMC_targets locations.
PMC_plotWaypoints.sqf - Plots long distance (>6km) waypoints.
PMC_targets.sqf - creates targets array from "PMC_?" gamelogics.
PMC_weather.sqf - random weather.
PMC_weatherForecast.sqf - weather forecast.

etc the list continues...

Now it would be foolish to keep many mission dirs with these exact same scripts, what if you modify one... how the hell can you remember which mission dir then contains the latest edits, it would be insane to keep track of them as you never would remember to copy the edited mission to all the other dirs. Of course you need to copy the scripts from the common dir, into the mission dir when you release the mission for other people or MP server to use.

So its very good to have the common scripts dir and place my commnly used scripts there.

Now, okay so whats the point here? The point of this topic is how to organize your scripts even more so that one script only is like a function performing one specific task. Its little difficult to explain without any practical example... but lets say you have a helo creation script, well you should not hardcode the starting/spawning location into the script, but to pass it as parameter instead. This way you can launch the helo creation script like:

Code: Select all

[startLocation, targetLocation] execVM "PMC\PMC_Helo_BLUFOR.sqf";
In a nutshell one script would be like a small efficient function.

Anyone have any idea what I'm babbeling about here? :)

Would anyone have any suggestions or feedback, anykind of ideas etc to improve this method, or tell a story how you organize your scripts?

Reference: Root\Scripts\ directory topic.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Re: Organizing your various scripts to one dir

Post by T_Rex » 2009-04-06 01:01:24

Feedback:
I can't wait to see the workflow suggestions on this.

In my n00bishness, all my scripts are in the root directory of the mission I'm working on. As that gets bigger and bigger, I'm realizing what a bad idea that is....
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9338
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC
Contact:

Re: Organizing your various scripts to one dir

Post by Snake Man » 2009-04-06 01:24:30

You can move them any time into the mentioned scripts directory. Only weird thing is that apparently description.ext stuff like Mandoble bombs dialog will not work from this dir, so I have to put mando_bombs/ dir into each of my mission dirs which use the bomb dialog. Perhaps I should start to use the cmd line started script to ease this, hmm anyways.

Just try it out, move all your mission root dir scripts into the <users>\<yourname>\scripts\ dir and see how they run from there :)
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Re: Organizing your various scripts to one dir

Post by T_Rex » 2009-04-06 04:11:55

What happens when you pbo them, though? I mean, how does the game know which scripts are referenced?
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9338
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC
Contact:

Re: Organizing your various scripts to one dir

Post by Snake Man » 2009-04-06 04:36:48

Well then its not much "mission script" thing anymore if you make addon out of your scripts.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Re: Organizing your various scripts to one dir

Post by T_Rex » 2009-04-06 13:22:10

Ooops- I used the wrong phrase. :)

When I'm in the mission editor, and I save as a single player mission (or, I presume, a MP mission), it makes a .pbo of the mission. But, if the scripts aren't co-located in that folder, then how will it work?

Or is it a situation that you have to remember to transfer all your scripts to a \scripts folder within the mission directory before building the mission for release?

(It is strange to me how I can be so familiar with some parts of ArmA, but so lost as to even simple things.) :)
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9338
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC
Contact:

Re: Organizing your various scripts to one dir

Post by Snake Man » 2009-04-06 14:09:40

Yes in my excitement I left out that part in my first post, its updated now.

Yes of course you need to copy the common mission dir contents (scripts used) into your mission dir when you release it to other people or MP server use.

The idea is to have 1 directory for all your latest script developments, then when its release time you naturally package the missions accordingly not need to have to worry about which of those 200 dirs your latest helo/killed script is located.

So to get back on track; any ideas how to further improve script development to the "general function" style for more efficiency?
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests