Post Scripting ... the 15 minute mod (FAQ)

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Private Recruit
User avatar
Posts: 22
Joined: Wed Jun 17, 2009 10:53 am

Post Scripting ... the 15 minute mod (FAQ)

Postby SHOOT ME DEAD ! » Wed Jun 17, 2009 3:41 pm

OK I am a big big fan of post scripting teams..."Why make a side when you can load and code ?"

The shipped maps are very good and you can get alot of mileage out of reforming teams for the same old map. My first expansion pack was something like 24 versions of teams across my favorite shipped maps, and thats it. It was 8 MB to download. lol.

So post-scripted mods are just :

1) stating which classes are on which team and loading them into memory
2) setting your lua scripts to use a shipped map
3) using the SetClassProperty() function to change up the weapons, ammo, speeds, jumps, jets, and points to unlock for the units you have loaded into memory
4) deleting the world LVL file from your mod's addon folder

This will create a mod using only borrowed assets from the game and will zip into a tiny file that is quick to upload or email and share with your friends.

Post-scripted mods in alot of cases can take advantage of class inheritence. If I want my gungan to have the troopers automatic rifle, all i do is load up the trooper and the gungan, then use SetClassProperty() to give the rifle to the gungan. So by setting the class property "WeaponName1" to the name of the troopers rifle, a change can be made after the classes are loaded and before the game starts. But if the class for the troopers gun isnt already loaded into memory, then the gungan's call to SetClassProperty() will fail. The reason it works is because I loaded up the trooper and therefore any classes it uses, like the class for his gun.
Now the original gungan class only ever had two weapons, so if we want to give him three weapons, then we're stuck with making an odf for our gungan, and therefore a side. But most units have more than two weapons and so you often get away without making a side at all.

For example, if you have the default setup and wanted to give the rebel troopers gun to the imperial engie, its no trouble coz the rebel troopers gun is already loaded into memory, so you just add the line

SetClassProperty("imp_inf_engineer", "WeaponName1", "all_weap_inf_rifle")

but if the rebel trooper wasnt loaded this code wouldnt work.


So thats how to use post script and class inheritence to quickly knock up a kule mod you will enjoy with your friends at a moments notice. Hope it helps.

Master of the Force
User avatar
Posts: 4192
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Post Scripting ... the 15 minute mod

Postby Fiodis » Wed Jun 17, 2009 5:14 pm

I hope you realize there's tons that can't be done that way, especially ODFs and custom tga's and msh's and whatnot.

I do not believe in "Why make a side when you can load and code ?". There's tons you need to have a custom side for, and frankly for a lot of people it's a lot easier to make a side.

Private Second Class
User avatar
Posts: 60
Joined: Mon Dec 29, 2008 1:55 pm

Re: Post Scripting ... the 15 minute mod

Postby bhawkgoalie10 » Wed Jun 17, 2009 5:17 pm

personally i agree w/ fiodis.
although from a file-size standpoint this reduces the amount...but again it also reduces potential.

Jedi
User avatar
Posts: 1233
Joined: Wed Sep 12, 2007 3:13 pm

Re: Post Scripting ... the 15 minute mod

Postby Frisbeetarian » Wed Jun 17, 2009 5:36 pm

bhawkgoalie10 wrote:although from a file-size standpoint this reduces the amount...but again it also reduces potential.

How is it reducing the amount? Other than certain variations, you still have to load the new textures, weapons, etc. into your map. This way just does it more sloppily through the Lua file instead of through a dedicated side.

Another downside to not having a dedicated side is that it's much harder for anyone else to use your work. If person A makes a side, and person B wants to use it in their map, all person B has to do is reference the .lvl file person A made, instead of redoing person A's hackjob.

Space Ranger
User avatar
Posts: 2559
Joined: Sat Nov 22, 2008 1:50 pm
Location: Washington, US
Projects :: Life. Work.
Games I'm Playing :: League of Legends
xbox live or psn: No gamertag set

Re: Post Scripting ... the 15 minute mod

Postby RogueKnight » Wed Jun 17, 2009 5:41 pm

Or you can just munge the MSH separate from the ODF and REQ, and reduce the filesize by 1/10...... (If were talking about filesize)

Master of the Force
User avatar
Posts: 4192
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Post Scripting ... the 15 minute mod

Postby Fiodis » Wed Jun 17, 2009 5:50 pm

DarthRogueKnight wrote:Or you can just munge the MSH separate from the ODF and REQ, and reduce the filesize by 1/10...... (If were talking about filesize)

What? Don't reqs decide what gets munged in the first place?

Hoth Battle Chief
User avatar
Posts: 3352
Joined: Thu Jan 24, 2008 7:03 pm
Location:
Games I'm Playing :: sticking to rct3
xbox live or psn: fluffytherc

Re: Post Scripting ... the 15 minute mod

Postby Fluffy_the_ic » Wed Jun 17, 2009 6:19 pm

@Fiodis: A technique he knows part of. I assume that's all you know of it, Rogue? Rogue told me that the creator of the technique (who I'm going to leave anonymous) wants to keep it a secret ATM and didn't tell Rogue the whole thing.

@SMD: a 15-minute mod? Not only does ODFing and stuff make things turn out WAY better, but if something takes 15 minutes, then it's not going to turn out well at all in comparison to taking a while.

Private Recruit
User avatar
Posts: 22
Joined: Wed Jun 17, 2009 10:53 am

Re: Post Scripting ... the 15 minute mod

Postby SHOOT ME DEAD ! » Wed Jun 17, 2009 9:45 pm

with post scripting you can accomplish quite alot. no you cant use textures, but look at how many mods are out there that make you download tons of stuff that didnt need to be there.

This gives them options for shortcuts they may not have known about... ya know ... knowledge.

If you wanted to give the gungan a gun, you would never make a side. If you wanted to give him something you couldnt script, like an ugly new texture, then you would create a side.

You can get alot more out of my Dream Teams Expansion (35 MB, 32 jedis across 14 shipped maps with 27 games) than you can out of any 200 MB downloads I came across. Not trying to drag mav in, but Dark Times was a glorious 85 MB download, and look at the content. Its all from using shipped maps, and if you can use shipped maps then why not shipped units modified with post script?

This topic was intended to grab the attention of those modderz ready to throw everything into their mod tools folder, munge a 200 MB mod, and upload it to filefront.... and STOP THEM by hopefully showing them the front door to a world full of stable shortcuts you can do with lua, and failing that some sparse odfs.

(Keeps on trying to contribute to the community and ignoring people jumping all over him)

It must be coz im so good lookin, lol.

There is no sacrifice in flexibility or capability because a SIDE is something you can build up. As you come across stuff you cant script, you build up the side resorting to script were it can be done.

If any of you have tried to release an expansion pack, you know file size is an issue.
Last edited by SHOOT ME DEAD ! on Wed Jun 17, 2009 9:54 pm, edited 3 times in total.

Master Bounty Hunter
User avatar
Posts: 1622
Joined: Sun Jan 04, 2009 9:53 pm
Location: Brazil

Re: Post Scripting ... the 15 minute mod

Postby Nihillo » Wed Jun 17, 2009 9:50 pm

SHOOT ME DEAD ! wrote:(Keeps on trying to contribute to the communite and ignoring people jumping all over him)

It must be coz im so good lookin, lol


Your sarcasm is not helping...

Hoth Battle Chief
User avatar
Posts: 3352
Joined: Thu Jan 24, 2008 7:03 pm
Location:
Games I'm Playing :: sticking to rct3
xbox live or psn: fluffytherc

Re: Post Scripting ... the 15 minute mod

Postby Fluffy_the_ic » Wed Jun 17, 2009 9:55 pm

You know that textures aren't always ugly, right? Go look in the glamour skins topic. About 95% of those skins are great.
The dark times was a glorious 85mb, yes, but he did WAY more than you could ever do with post-scripting. Amazing skins and models, new era, new mode. Scripted some things to run differently based on SP or MP. Random heros, random skies that are amazing, name me one thing Mav did besides make new weapons and units that you can do with post-scripting.

Private Recruit
User avatar
Posts: 22
Joined: Wed Jun 17, 2009 10:53 am

Re: Post Scripting ... the 15 minute mod

Postby SHOOT ME DEAD ! » Wed Jun 17, 2009 10:07 pm

actually this wasnt a topic on how to be mav, it was a topic on how not to be wasteful, and my comment about dark times was "look at all the content for 85 MB", trust me.. mav was not wasteful. The comment wasnt, "hey this was done with post script!"

Also I think its ironic that im accused of promoting myself when I only uploaded a picture link, a link to a tutorial on mods, and a link to my chat site to help out a spammer. I havent uploaded any mods and gone "Hey check out my kule new mod". I have once said download my mod and that was to see how much you can do with just 35 MB.

Alas I think my time at gametoast has come to and end. I dont think things are working out here. It seems full of anti-topic aggression.

Anyways enjoy the technique of class inheritence at runtime, and check my tutorial Qunitessentials for a more detailed explanation and walk throughs. I wont post the link for it because apparently that would be promoting myself, so you must labour through the search engine and find the topic.

Droid Pilot Assassin
User avatar
Posts: 2086
Joined: Mon Feb 13, 2006 3:28 am

Re: Post Scripting ... the 15 minute mod

Postby Sky_216 » Thu Jun 18, 2009 12:09 am

SHOOT ME DEAD ! wrote:Alas I think my time at gametoast has come to and end. I dont think things are working out here. It seems full of anti-topic aggression.


Ermmm...no its not. For Heavens sake we don't allow swearing, most of the community here is very supportive and as far as I've been able to tell even saying "Oh My God" is fairly borderline because it can cause offence to the more religious among us.

We aren't full of anti-topic aggression. We just don't like people who tell us all that they "have the truth" when its clear they don't have a clue about most of what they're talking about and have just ripped off peoples work and done a few messy hackjobs.

Jedi Admin
User avatar
Posts: 7420
Joined: Mon Aug 21, 2006 11:03 pm

Re: Post Scripting ... the 15 minute mod

Postby Maveritchell » Thu Jun 18, 2009 12:29 am

Play nice, everyone.

It is important to recognize that everything has its place. It is important to learn how to use lua effectively, as mentioned in this topic - it can do a lot to cut down on filesize, and I use some kind of post-sides modification like this to a small degree in almost every mod I use. It is important.

However - and this is addressed to the original poster - it is oversimplifying things to overlook building a "real" side (which, whatever your intent might be, is how you come across). Once you start doing things like building in lots of new textures or models, or even some greater odf changes, it is simply most efficient to build a new side.

This discussion doesn't need to be an "A vs. B" discussion - if you don't try to learn to do everything, you will be cheating yourself and cheating what your mod can be.

Master of the Force
User avatar
Posts: 4192
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Post Scripting ... the 15 minute mod

Postby Fiodis » Thu Jun 18, 2009 9:04 am

look at how many mods are out there that make you download tons of stuff that didnt need to be there.

Define; "didn't need". I agree that some modders often leave things in that ought to be left out. Just the other day, for example, I found a rep.lvl and repshell.lvl sneaked into my map's Addon folder. Deleting it cut the post-zipped filesize from 75 mb to closer around 30.

Its all from using shipped maps, and if you can use shipped maps then why not shipped units modified with post script?

Indeed, why not? If you want to go through the bother of setting up hundreds of lines of SetClassProperty then this is clearly the way to go.

Most, though, don't have the stamina to sit for extended periods of time in front of a screen typing out variations of the same thing; they will instead create a new side, perhaps switch up textures a bit, munge it in and call for it via a minute's worth of LUA work.

There is no sacrifice in flexibility or capability because a SIDE is something you can build up. As you come across stuff you cant script, you build up the side resorting to script were it can be done.

Not a bad idea. The whole boring repetitiveness of the scripting process comes at me again, though. LUA can be fun, when you've got a challenge in mind and are trying to find ways to make it work. This is just spamming SetClassProperty. Not fun at all. And that's a major thing, when you consider that modding is above anything else a hobby and therefore should be at least mildly enjoyable.

I haven't gone "Hey check out my kule new mod".

You can get alot more out of my Dream Teams Expansion (35 MB, 32 jedis across 14 shipped maps with 27 games) than you can out of any 200 MB downloads I came across.

:?

Finally, and above all, you can't use ZeroEditor through LUA.

There, my thoughts. Take them as you will.

Command Sergeant Major
User avatar
Posts: 289
Joined: Sat Sep 27, 2008 5:58 pm
Location: Crifton

Re: Post Scripting ... the 15 minute mod

Postby Tourny » Sat Jul 04, 2009 3:10 am

Fiodis wrote:Most, though, don't have the stamina to sit for extended periods of time in front of a screen typing out variations of the same thing; they will instead create a new side, perhaps switch up textures a bit, munge it in and call for it via a minute's worth of LUA work.


Ever heard of "copy and paste"? *suddenly realizes he's probably bumping the topic* whoops...

Jedi High Council
User avatar
Posts: 2306
Joined: Sat Nov 15, 2008 1:57 pm
Projects :: I should probably start one...
Games I'm Playing :: TOR AC
xbox live or psn: ShadowScorch88

Re: Post Scripting ... the 15 minute mod

Postby Twilight_Warrior » Wed Feb 09, 2011 1:46 pm

Sorry for the bump, but I had a question concerning this topic...

Theorhetically, could one create a mod that edits the stock sides, adding a sort of... ghost unit at the bottom of the character selection (default settings, nothing special), tell the mod to refer to some script before loading the map, then use a graphical user interface to allow Average Joe to select what he wants that ghost unit to be equipped with (potentially even selecting which pre-defined texture he would like the unit to have), then have that interface write/rewrite the script when Average Joe clicks "Done"?

Essentially, could post scripting be used to create a single, customizable unit on the fly at any time you would like? Even allowing a user to edit that unit after munging or installing the mod?

Master of the Force
User avatar
Posts: 6069
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: Post Scripting ... the 15 minute mod

Postby DarthD.U.C.K. » Wed Feb 09, 2011 1:54 pm

if its possible, it would require really really complex and extensive scripting but i doubt that its possible. you cant realoly modify the unitselectionscreen as far as i know.

Jedi High Council
User avatar
Posts: 2306
Joined: Sat Nov 15, 2008 1:57 pm
Projects :: I should probably start one...
Games I'm Playing :: TOR AC
xbox live or psn: ShadowScorch88

Re: Post Scripting ... the 15 minute mod

Postby Twilight_Warrior » Wed Feb 09, 2011 2:13 pm

What I'm saying is what if the unit is already there? Like having the standard Republic Trooper (or whatever the rifleman is depending on the era/side) at the bottom of the character selection screen, but with 20 unlock points or something.

Then, before you enter the game, you open up a program (made in like Visual Basic or something), that gives the user options such as what primary/secondary weapon you want the unit to have, etc etc then the program writes a text document to include proper commands like SetClassProperty, etc etc and saves the file as the script.

Jedi Admin
User avatar
Posts: 7420
Joined: Mon Aug 21, 2006 11:03 pm

Re: Post Scripting ... the 15 minute mod

Postby Maveritchell » Wed Feb 09, 2011 3:16 pm

Twilight_Warrior wrote:Essentially, could post scripting be used to create a single, customizable unit on the fly at any time you would like?

"Post scripting" as mentioned in this topic isn't anything special - it's just lua code written in the ScriptPostLoad section, which is to say most of the mod scripting done.

I can't honestly tell what you seem to be asking, but here are a couple points I feel are relevant.

1) As far as I know, you can't use scripts to load in any data after the level has started, unitwise.
2) Even if you could, unless you've created a pretty substantial custom ingame interface that allows the user to input commands (no one has done this; Zerted's come closest, but all he's done is essentially expand the preexisting pause menu), you wouldn't have any means of fetching data from the user.
Then, before you enter the game, you open up a program (made in like Visual Basic or something), that gives the user options such as what primary/secondary weapon you want the unit to have, etc etc then the program writes a text document to include proper commands like SetClassProperty, etc etc and saves the file as the script.

3) You can't make any changes to the game without a munge or a hexedit of a file.

The easiest (and I use this word loosely as this is still very cumbersome) way to create units that the player could choose (and keeping in mind this would be entirely not-online-compatible) would be to have several small .lvl files munged, each representing a single combination of unit class (this could be a script .lvl file or a side .lvl file, depending on the detail of unit you wanted), and each with the same name. The game would load in a .lvl file by this name by default, and you would have to create some third-party out-of-game GUI for the user to choose a character. The application could then shuffle files around in the directory so that the version of the file in the loaded directory would represent the user's choice.

But as far as what you've outlined? I'm not even sure that I understand it, but from what I do, it seems pretty infeasible.

Jedi
User avatar
Posts: 1227
Joined: Mon Dec 06, 2010 8:21 pm
Location: at a computer desk floating around in space
Projects :: making random weapon assets
Games I'm Playing :: SWBF2 and more
xbox live or psn: PS3 beats xbox

Re: Post Scripting ... the 15 minute mod

Postby Dakota » Thu Feb 10, 2011 12:51 pm

i got an idea you could set each weapon to a number and when you press the number it selects the weapon like how in DMI you could select the floor u are on with numbers. i have changed my weapon in game using the FC code consel if you set an lua to change by connecting the numbers to codes then it may work. it would be single player only though (at least i think). it would be extremely complicated and i have no idea how to do it. i am just giving a crazy idea.
any questions?

Next

Return to SWBF2 Modding

Who is online

Users browsing this forum: No registered users and 1 guest