Loading from a SIDE in another mod folder

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

Post Reply
User avatar
SHOOT ME DEAD !
Private Recruit
Posts: 22
Joined: Wed Jun 17, 2009 10:53 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Contact:

Loading from a SIDE in another mod folder

Post by SHOOT ME DEAD ! »

OK, example..... when I built my jedis for -SMD- Dream Teams I made a world that loaded up the shipped naboo map. So i didnt have a world, just some lua script. One by one I added my jedis creating a big jedis brawl. As I ran out of slots, I removed some jedis and just kept on adding more. When I was done I had a Naboo full of jedis, and was quite happy with how things went. Now it was time to make more maps and decide which jedis would play which worlds blah blah blah... how was I going to do it ?

Most people would create a SIDE for the game rather than have a SIDE stuck in some mod world, but this is highly unecessary and to me it would just complicate the install and uninstall. I think it may also run more risks of incompatibilty.

I swear I looked for this, even using google and so if its an old topic I apologize, but at least this one people will find.

As some of you may know the string "..\\" is a relative file reference that goes back one directory. If you have had to program relative paths that are not subdirectories but are parent directories, then you have probably come across this. As it happens, to go from one mod directory to another, we need to back up three directories. We can do this using "..\\..\\..\\".

Well in my example my jedi naboo mod folder is called Z2N and I want to load stuff from there into another mod. I use the line :

ReadDataFile("dc:..\\..\\..\\Z2N\\data\\_LVL_PC\\SIDE\\smd.lvl",
"smd_hero_gungan3", "smd_hero_chewbacca", "smd_hero_drako",
"smd_hero_anakin")


to load up four of the 32 jedis stored in the SIDE folder for Z2N. As you know if the SIDE was in my current mods folder I would use the line dc:SIDE\\smd.lvl

As it happens the game is coded to see the dc: (downloadable content) and jump to the XXX\\data\\_LVL_PC folder....and thats why dc:SIDE\\ works because its a relative path to the current directory.

Once I realized this I kept adding custom classes where i needed them, with some organization, and simply loading them into other maps using a relative path. It was great because it kept my installs as a simple zip, while still enabling me to make expansions that built upon my previous work.
RogueKnight
Space Ranger
Posts: 2512
Joined: Sat Nov 22, 2008 1:50 pm
Projects :: Life. Work.
Games I'm Playing :: League of Legends
xbox live or psn: No gamertag set
Location: Washington, US

Re: Loading from a SIDE from another mod folder

Post by RogueKnight »

*facepalm*

Topic #9.......

another topic to tell everyone something we already know.....

We aren't exactly n00b modders here bud, after all GT and its occupants are the makers of Convo Pack, BFX, BF0, Dark Times, Tean and his Xbox mod, ect....

We know our way around the modtools, and how to do most of this stuff.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Loading from a SIDE from another mod folder

Post by Maveritchell »

DarthRogueKnight wrote:another topic to tell everyone something we already know.....
Play nice. He did say he searched for old topics and it seems all he wants to do is help. Don't reject something offhand just because it comes from someone new to the site.

OP: Just for your own reference, this is noted in the "How to add Dark Times to your mod" topic and it is referenced in every addme.lua created in a modmap (this is how the addon map's core.lvl is loaded). Thank you for searching beforehand, though.
Post Reply