1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

Upgrade! game mode and mini tutorial.

Discussion in 'Game modes' started by diputs, Mar 19, 2012.

  1. diputs

    diputs Shopkeep Stealer

    Messages:
    16
    Have you ever wondered what to do with all this gold your has collected? You have already built a siege and demolition workshop and already finished your golden tower, but still have gold leftover?
    Well this mode provides you with an answer. This is still the standard CTF, but now you can spend your hardearned gold by upgrading your workshops and maybe even unlocking new ones. And even if there is not enough gold on the map you can spend your coins to buy it! A team witch works together can get a big advantage over their enemies.
    You can find the following stuff in this mod:
    Day/Night Cycle,
    3 Different kind of kegs
    Resource shop
    class change workshop
    Coded Tunnels
    multiple workshops upgrades

    Now let us look at what and how it was changed:

    Rules:
    Code:
     daycycle_speed = 9
    daycycle_start = 0.54
    break_time_static = 120
    This enables the day/night cycle. Since the night starts at .66 the static break time with .54 day start ensures, that the battle will start in the evening.
    Code:
    room_config = Entities/Rooms/MyR.cfg
    minimap = 0
    player_light_radius = 14
    This part disables the minimap and shrinks the players light radius making them effectively blind in the tunnels. If playing on a map with a Wang-dungeon it can be very easy to get lost.
    In builder.cfg/archer.cfg
    Code:
     stone_default = 100
    wood_default = 20
    stone_warmup = 250
    wood_warmup = 250
    arrows_default = 30
    arrows_warmup = 30
    
    These influence the resources players get at the beginning. The amounts are my personal preferences, but archers should always start with some arrows so they can spend their coins on gold.
    Rooms:
    To create new rooms/functions you should only edit the @$rooms and @$room_functions arrays.
    The Syntax for rooms
    Code:
    # room syntax - room name; sprite; help text; functions, item2, item3 ...; costs
    The costs can be the following: w1,s-2,c3,g4. This would mean it costs 1 wood, -2 stone, 3 coins and 4 gold. Negative amounts gives you the resources. - means no cost.
    You can also add rBUILDING to the cost. This means that your team has to build the workshop with the name BUILDING to be able to construct this one.
    Another possibility is to add uBUILDING to the cost. This means that you cannot build this workshop, you have to upgrade another one.
    The Syntax for room functions
    Code:
     name; actor name; config file; icon; make sound; icon frame; icon frame size; help text; costs 
    The name of the function is used in the function field of @$rooms array.
    Icon is the address to the sprite sheet. The position of the sprite is referenced by icon frame and icon frame size. Leaving the Icon field empty (-) will activate this function automatically if a player is near the room.
    Make sound can be set to "d" for the default build sound.
    Actor name and config file are only needed for certain items and are left blank (-) for most others.
    These properties are common for all possible functions.
    Now there are different kind of functions.
    • The hardcoded items/functions. These are: bomb, arrow, heal, catapult, outpost, travel_left/right. The only thing you can essentially change about these is the price.
    • The class change function: class #, there # is a number. If you define more classes in the Rule folder you can add further class change functions.
    • The upgrade function: upgrade NAME. This allows to upgrade workshops to the room with the name NAME.
    • The item function. This one can have any name but needs an actor and a config file.
    • The empty function. Would be useless, but since we can have negative costs it allows for trading of materials.
    Let us now look at what we can do with help of the upgrade function:
    Code:
    BOMB WORKSHOP; Entities/Rooms/Sprites/BombShop.png; Press $KEY7$ to buy bombs; bomb, upgrade DEMOLITION WORKSHOP; w50, s50;
    DEMOLITION WORKSHOP; Entities/Rooms/Sprites/DemoShop.png; Press $KEY7$ to buy explosives;keg, upgrade CHEAP DEMOLITION WORKSHOP; uBOMB WORKSHOP;
    CHEAP DEMOLITION WORKSHOP; Entities/Rooms/Sprites/DemoShop.png; Press $KEY7$ to buy explosives;kegc, upgrade BEST DEMOLITION WORKSHOP;uDEMOLITION WORKSHOP;
    keg; keg; Entities/Items/Keg.cfg; Entities/Items/Sprites/Keg.png; Entities/Rooms/Sounds/BombMake.ogg; 0; 16; Buy me to demolish castles!; c60;
    kegc; keg; Entities/Items/Keg.cfg; Entities/Items/Sprites/Keg.png; Entities/Rooms/Sounds/BombMake.ogg; 0; 16; Buy me
    to demolish castles!; c40;
    upgrade DEMOLITION WORKSHOP; -; -; Entities/Rooms/Sprites/DemoShop.png; d; 0; 24; Upgrade to DEMOLITION WORKSHOP; g250;
    upgrade CHEAP DEMOLITION WORKSHOP; -; -; Entities/Rooms/Sprites/DemoShop.png; d; 0; 24; Upgrade for better prices; g200;
    
    This is pretty straightforward example. We can build the bomb workshop, witch we can upgrade to demolition workshop where we can buy kegs for 60 coins. This one we can again upgrade to get a better deal of 40 coins for a keg.
    Another example is the tunnel:
    Code:
    TUNNEL; Entities/Rooms/Sprites/Tunnel.png; Press $KEY7$ to travel quickly; upgrade TUNNEL A, upgrade TUNNEL B, upg... upgrade TUNNEL I; -;
    TUNNEL A; Entities/Rooms/Sprites/Tunnel.png; Press $KEY7$ to travel quickly; travel_right, travel_left; uTUNNEL;
    ...
    TUNNEL I; Entities/Rooms/Sprites/Tunnel.png; Press $KEY7$ to travel quickly; travel_right, travel_left; uTUNNEL;
    Since the Tunnel isn't team specific we can just add more tunnels. You can only travel from TUNNEL A to another TUNNEL A. This way you should still guard your tunnels, but there is a high chance, the enemy will be using another tunnel system.
    And a last example of upgrade/require:
    Code:
    ENABLER; Entities/Rooms/Sprites/CarpentryShop.png; You can now get a refund\nfor building a frontline shop; -; g150;
    FRONTLINE SHOP; Entities/Rooms/Sprites/EmptyRoom.png; Upgrade me!; upgrade QUARTERS, upgrade ARROW WORKSHOP; rENABLER, w-90;
    Once your team has built an enabler you can start constructing frontline shops. These will refund the wood you spend building the empty shop.
    Now let us look at the items. These require an actor with a config file. There are at least 6 actors i know of.
    •runner: Is the actor used for the players. Not actually much use:
    Code:
    DECOY SHOP; Entities/Rooms/Sprites/Smelter.png; Buy a decoy; decoy; w10, s10;
    decoy; runner; Entities/Items/St_decoy.cfg; Entities/Actors/Sprites/MigrantMale.png; d; 0; 32; I am a decoy; c20; 
    This decoy shop allows you to buy a dummy builder witch will appear in front of the workshop. Enemy players can kill this one.
    •zombie: Actor used for zombies.
    Code:
    ZOMBIE SHOP; Entities/Rooms/Sprites/Nursery.png; Buy Zombies; skeleton, zombie, wraith, zknight; -;
    skeleton; zombie; Entities/Actors/Skeleton.cfg; Entities/Items/Sprites/Keg.png; d; 0; 16; Skeleton; w20;
    zombie; zombie; Entities/Actors/Zombie.cfg; Entities/Items/Sprites/Keg.png; d; 0; 16; Zombie; w30, s10;
    zknight; zombie; Entities/Actors/ZombieKnight.cfg; Entities/Items/Sprites/Keg.png; d; 0; 16; Zknight; w40, s40, c30;
    wraith; zombie; Entities/Actors/Wraith.cfg; Entities/Items/Sprites/Keg.png; d; 0; 16; Wraith; w30, s30;
    This shop allows you to build all possible zombies. Their will fight for you, but sadly their work really badly in multiplayer. Should be fun to play with after the multiplayer zombie update.
    •genericitem: This one is used by lanterns. I couldn't make it work with anything else.
    •boulder: The boulder actor. I couldn't make it work with anything else.
    •keg: The actor for kegs. The most straightforward use is to make different kind of kegs:
    Code:
    kegbig; keg; Entities/Items/St_kegbig.cfg; Entities/Items/Sprites/Keg.png; Entities/Rooms/Sounds/BombMake.ogg; 0; 16; A big one!; c130;
    keglight; keg; Entities/Items/St_keglight.cfg; Entities/Items/Sprites/Keg.png; Entities/Rooms/Sounds/BombMake.ogg; 0; 16; A light version\ngood for catapult usage; c100;
    Changing the physics, explosion radius and damage we can easily get many different kegs.
    You can also apply the keg actor to different items. Just adding
    Code:
    $explosion_texture = Sprites/explosion.png
    $sound_explosion = Entities/Items/Sounds/KegExplosion.ogg
    u16_explosion_tiles_radius = 5
    f32_explosion_damage = 2.0 
    at the end of chest config file will make it possible for chests to explode. But these items will have no fuse, meaning they only explode if their are destroyed by enemies.
    For example the 2 applications for this are the exploding chests and personal armor as can be seen on the „Stuff“ server. But these two can cause some glitches, so use it at your own risk.

    --
    The final room actor comes in the next post. (Stupid character limit:>:(: )
     

    Attached Files:

  2. BlueLuigi

    BlueLuigi :^) Forum Moderator Donator Tester

    Messages:
    3,620
    Very nice detective work, keep it up ;)
     
  3. diputs

    diputs Shopkeep Stealer

    Messages:
    16
    And the final actor:

    •room: Used, as you probably guessed correctly, for rooms. You can take CTF_Room.cfg as the source for the config file. Deleting all but one room and adding

    Code:
    u8_default_room = 1
    will automatically create the specific workshop. But this room will be probably instantly destroyed. We need it to fall down. So you need to also change the ball a little:

    Code:
    f32_ball_width = 23.9
    f32_ball_height = 23.9
    f32_ball_radius = 11.95
    f32_ball_max_fallspeed = 1.0
    f32_ball_max_airspeed = 1.0
    f32_ball_max_groundspeed = 1.0
    f32_ball_max_actionspeed = 1.0
    f32_ball_gravity = 1.0
    This way the newly built room will fall down in front of the workshop. Since the new room has a smaller radius it will have priority over the bigger room. This way only the smaller shop can be used. An example:
    Code:
    BOMB WORKSHOP; Entities/Rooms/Sprites/BombShop.png; Press $KEY7$ to buy bombs; bomb, upgrade EMPTY BOMBSHOP; w50, s50;
    EMPTY BOMBSHOP; Entities/Rooms/Sprites/BombShop.png; . ; nextbomb; uBOMB WORKSHOP;
    bomb; -; -; Entities/Items/Sprites/MaterialStacks.png; Entities/Rooms/Sounds/BombMake.ogg; 12; 16; Bomb costs 20 coins; c20;
    nextbomb; room; Entities/Items/St_bombshop.cfg; Entities/Rooms/Sprites/BombShop.png; d; 0; 24; Use this; -;
    upgrade EMPTY BOMBSHOP; -; -; Entities/Rooms/Sprites/BombShop.png; d; 0; 24; Upgrade for cheaper bombs; g200;
    and in St_bombshop.cfg:
    @$rooms = BOMB WORKSHOP; Entities/Rooms/Sprites/BombShop.png; Press $KEY7$ to buy bombs; bomb; -;
    ;
    @$room_functions = bomb; -; -; Entities/Items/Sprites/MaterialStacks.png; Entities/Rooms/Sounds/BombMake.ogg; 12; 16; Bomb costs 10 coins; c10;
    ;
    
    The way it works: Bomb Workshop can be upgraded for gold to the empty bombshop, witch only has one function to build the new cheaper Bomb Workshop. The second step is needed, because the building of this room only works semi-reliably. But i think it is the only way to get 2 different prices for hardcoded stuff like bombs.
     
  4. Fizar

    Fizar Catapult Fodder

    Messages:
    2
    I cant get this to work. the Upgrade mod makes my game crash and does not have all the options that it says
     
  5. UnnamedPlayer

    UnnamedPlayer Arsenist Administrator Global Moderator Tester
    1. MOLEing Over Large Estates - [MOLE]

    Messages:
    752
    Did you opened zombie mode first? (I know it's a silly question but some people have an impressive capacity of ignoring the obvious)
     
  6. diputs

    diputs Shopkeep Stealer

    Messages:
    16
    Could you be more specific? Does it make your server crash or does your game crash, than joining the server? What kind of error do you get?
    If it is the server: Check if you have configured this server to premium. Check if all the files were successfully copied.
    If it is your game: Can anybody else join your server? Can you join other premium servers?

    All the options mentioned in the above post are there, but some of them are disabled, because they are buggy. Enable them at your own risk.
     
  7. BC

    BC Bison Rider

    Messages:
    70
    Thanks for sharing this diputs :D I love these shops. I used the Zombie shop on BC Zombie CTF (I added gregs and prevented them from picking up players)
     
    BlueLuigi likes this.
  8. goodyman8

    goodyman8 Bison Rider

    Messages:
    1,025
    Good thing you shared these.
    Do you know if it's possible to make actors drop items like chests/other actors?
    And what makes the Gregg's attack have grip?
    Wanted to try putting all those together to make some sort of boss test.
    Just couldn't be bothered to figure out what these 2 meant
    u16_explosion_tiles_radius = 5
    f32_explosion_damage = 2.0
    So thanks for that too.