Announcement

Collapse
No announcement yet.

Help saving and loading campaign info

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help saving and loading campaign info

    Hello you guys,

    I'm currently working on a Campaign like mod to UT2K4. The main objective would be to allow servers admins to define a series of maps to be played in a non linear order, depending on the winner of the last map.
    For example, you choose three maps (DM-foo, DM-bar and DM-fooba for example), the first map played is DM-Foo, in this map IF the blue team is the winner the next map would be DM-bar and IF the red team wins will be DM-foobar.

    My objective with it is recreate a bit the Enemy Territory gameplay and create some interesting possibilities to map developers (creating 5 or 6 AS maps correlated that would be played in campaign would be an example of the possibilities). I also plan to introduce player persistence between the levels and some RPG elements. But for now lets focus on my current problem.

    I already have the above cited behavior with a small mutator I've written that reads a .ini (the mutator has a config clause) so to decide the next match. I've also have a proper (or almost) in game GUI to manage this .ini.

    The main concern I've right now is that all i can have at a given time is one .ini (i.e., one campaign configured), and even then the config is not reloaded on the GUI after the match ends.
    So my question is: there is any way to allow the user to save various of these configs and load them as desired?
    What i was thinking would be more or less like having different campaign configs that would be listed to the user and then he would decide witch one to play, to create new ones, modify entries, delete things and so on...
    If these could be seen as maps that would stay at the /map folder would been even better.

    As illustration follow an example of a .ini for my mutator:

    [UTCGame.UTCRules]
    currentMatch=1
    myUrls=(nextMatchBlue=2,nextMatchRed=1,URL="DM-1on1-Albatross?Game=XGame.xTeamGame?Mutator=UTCGame.Mut Campaign,")
    myUrls=(nextMatchBlue=0,nextMatchRed=0,URL="DM-1on1-Crash?Game=XGame.xTeamGame?Mutator=UTCGame.MutCamp aign,")
    myUrls=(nextMatchBlue=0,nextMatchRed=0,URL="CTF-1on1-Joust?Game=XGame.xCTFGame?Mutator=UTCGame.MutCampa ign,")
    GameTypes=Team DeathMatch
    GameTypes=Capture the Flag
    Maps=DM-1on1-Albatross
    Maps=DM-1on1-Crash
    Maps=CTF-1on1-Joust



    Ow yeah, another thing. I'm currently working on this as a mod (with its own directory and all), but the campaign.ini is being saved at the system folder of UT2004 and not the one from my mod

    thanks!

    #2
    class specific ini files are always saved in the UT2004/System directory (as far as I know, I never managed to get it to go where I wanted it to). Mod architecture seems a bit incomplete yet, but better than it used to be.

    For your problem,

    myUrls=(nextMatchBlue=2,nextMatchRed=1,URL="DM-1on1-Albatross?Game=XGame.xTeamGame?Mutator=UTCGame.Mut Campaign,")

    myUrls=(nextMatchBlue=0,nextMatchRed=0,URL="DM-1on1-Crash?Game=XGame.xTeamGame?Mutator=UTCGame.MutCamp aign,")

    myUrls=(nextMatchBlue=0,nextMatchRed=0,URL="CTF-1on1-Joust?Game=XGame.xCTFGame?Mutator=UTCGame.MutCampa ign,")


    This looks exactly like a dynamic array to me. It looks like all you need is to make myUrls a dynamic array (var array<string> myUrls). Then inr your ini file (and default properties, for default urls), put:

    myUrls(0)=(nextMatchBlue=2,nextMatchRed=1,URL="DM-1on1-Albatross?Game=XGame.xTeamGame?Mutator=UTCGame.Mut Campaign,")

    myUrls(1)=(nextMatchBlue=0,nextMatchRed=0,URL="DM-1on1-Crash?Game=XGame.xTeamGame?Mutator=UTCGame.MutCamp aign,")

    myUrls(2)=(nextMatchBlue=0,nextMatchRed=0,URL="CTF-1on1-Joust?Game=XGame.xCTFGame?Mutator=UTCGame.MutCampa ign,")

    Comment

    Working...
    X