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

[Help] Loading WorkShops from a config inside of the room config

Discussion in 'Modding [KAG Classic]' started by MurCon, Jun 27, 2013.

  1. MurCon

    MurCon Catapult Fodder

    Messages:
    9
    Hello,

    I have a 249 lined workshop(@$rooms = 164 Lines , @$room_functions = 85 Lines)
    that I want to put into it's own config. I've tried doing this already, but have been unsuccessful; every time I go to create the shop it either crashes my game or pops up a empty workshop over the existing shop. The workshop has no bugs if I just load it normally(works as intended), and do not try to load it with its own config.

    Here is what I got setup in both my room config, and separate workshop config that I put in the items folder(This is an example of what I am trying to do, since I want to keep what I am trying to do a secret until I am finished.):

    \Base\Entities\Rooms\exampleroom.cfg
    Code:
    # # # Sprite # # #
    $sprite_factory = room_sprite
    
    $sprite_texture = Entities/Rooms/Sprites/EmptyRoom.png
    s32_sprite_frame_width = 24
    s32_sprite_frame_height = 24
    $sprite_sound_death_hit =
    $sprite_sound_flesh_hit = Sounds/pick_wall?.ogg
    $sprite_sound_die = Sounds/destroy_wall.ogg
    $sprite_sound_spawn = Entities/Rooms/Sounds/ConstructShort.ogg
    $sprite_sound_gib = Entities/Rooms/Sounds/DestroyRoom.ogg
    $sprite_sound_emit =
    
        $sprite_gibs_start = *start*
    
        $gib_type = static_particle
        $gib_file = Entities/Rooms/Sprites/RoomGibs.png
        u8_gib_count = 9                    #number of gibs
        u8_gib_style = 0                    #column
        u8_frame_width = 8;
        u8_frame_height = 8;
        @u8_gib_frame = 1; 2; 3; 4; 5; 6; 7;    #row
        $gib_collide_sound = Sounds/rock_hit?.ogg
        f32_gib_mass = 2.5
        u8_gib_emit = 255                    #nothing
        f32_velocity = 12.0
        f32_offset_x = 0.0
        f32_offset_y = 0.0
    
        $sprite_gibs_end = *end*
    
    f32_blood_multiplier = 8.0
    clr_blood_color = 255; 50; 40; 30
    
      $sprite_animation_start = *start*
    # # # Default # # #
      $sprite_animation_default_name = default
      u16_sprite_animation_default_time = 1
      u8_sprite_animation_default_loop = 0
      @u16_sprite_animation_default_frames = 0;
    
      $sprite_animation_end = *end*
    # # # Light # # #
    f32_light_radius = 50.0
    clr_light_color = 255; 255; 240; 171
    1_light_default_on = 0
    # room
    $sprite_sound_build = Entities/Rooms/Sounds/Construct.ogg
    # # # Ball # # #
    $ball_factory = room_ball
    
    f32_ball_width = 24.0
    f32_ball_height = 24.0
    f32_ball_radius = 12.0
    f32_ball_max_upspeed = 0.0
    f32_ball_max_fallspeed = 0.0
    f32_ball_max_airspeed = 0.0
    f32_ball_max_groundspeed = 0.0
    f32_ball_max_actionspeed = 0.0
    f32_ball_gravity = 0.0
    f32_ball_ground_slide = 0.0
    f32_ball_wall_slide = 0.0
    f32_ball_ladder_slide = 0.0
    f32_ball_ground_bounce = 0.0
    f32_ball_wall_bounce = 0.0
    1_ball_opens_doors = 0
    1_ball_opens_bridges = 0
    f32_ball_hit_momentum = 0.0
    # # # Unused # # #
    $movement_factory =
    $weapon_factory =
    $brain_factory =
    $attachment_factory =
    # # # General # # #
    $name =
    f32_health = 100.0
    f32 gib_health = -2.5
    $help_text = Hold $KEY7$ and\nselect workshop\nto build
    
    u8_default_room = 0
    @$rooms = #
    Exampleshop; Entities/Rooms/Sprites/Smelter.png; Example msg.; upgrade Exampleshop2; w25;
    Exampleshop2; Entities/Rooms/Sprites/Smelter.png; -; example; uExampleshop; ###<--- This room loads exampleshop.cfg
    @$room_functions = #
    example; room; Entities/Items/exampleshop.cfg; Entities/Rooms/Sprites/Smelter.png; d; 0; 24; Example Msg; -;
    upgrade Exampleshop2; -; -; Entities/Rooms/Sprites/Smelter.png; d; 0; 24; Example Msg; -;
    
    \Base\Entities\Items\exampleshop.cfg
    Code:
    $sprite_factory = room_sprite
    
    $sprite_texture = Entities/Rooms/Sprites/EmptyRoom.png
    s32_sprite_frame_width = 24
    s32_sprite_frame_height = 24
    $sprite_sound_death_hit =
    $sprite_sound_flesh_hit = Sounds/pick_wall?.ogg
    $sprite_sound_die = Sounds/destroy_wall.ogg
    $sprite_sound_spawn = Entities/Rooms/Sounds/ConstructShort.ogg
    $sprite_sound_gib = Entities/Rooms/Sounds/DestroyRoom.ogg
    $sprite_sound_emit =
    
        $sprite_gibs_start = *start*
    
        $gib_type = static_particle
        $gib_file = Entities/Rooms/Sprites/RoomGibs.png
        u8_gib_count = 9                    #number of gibs
        u8_gib_style = 0                    #column
        u8_frame_width = 8;
        u8_frame_height = 8;
        @u8_gib_frame = 1; 2; 3; 4; 5; 6; 7;    #row
        $gib_collide_sound = Sounds/rock_hit?.ogg
        f32_gib_mass = 2.5
        u8_gib_emit = 255                    #nothing
        f32_velocity = 12.0
        f32_offset_x = 0.0
        f32_offset_y = 0.0
    
        $sprite_gibs_end = *end*
    
    f32_blood_multiplier = 8.0
    clr_blood_color = 255; 50; 40; 30
    
      $sprite_animation_start = *start*
    
      # default
      $sprite_animation_default_name = default
      u16_sprite_animation_default_time = 1
      u8_sprite_animation_default_loop = 0
      @u16_sprite_animation_default_frames = 0;
    
      $sprite_animation_end = *end*
    
    # light
    f32_light_radius = 50.0
    clr_light_color = 255; 255; 240; 171
    1_light_default_on = 0
    # room
    $sprite_sound_build = Entities/Rooms/Sounds/Construct.ogg
    
    # ball
    
    $ball_factory = generic_ball
    
    f32_ball_width = 23.9
    f32_ball_height = 23.9
    f32_ball_radius = 11.95
    f32_ball_max_upspeed = 0.0
    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
    f32_ball_ground_slide = 0.0
    f32_ball_wall_slide = 0.0
    f32_ball_ladder_slide = 0.0
    f32_ball_ground_bounce = 0.0
    f32_ball_wall_bounce = 0.0
    1_ball_opens_doors = 0
    1_ball_opens_bridges = 0
    
    # unused
    
    $movement_factory =
    $weapon_factory =
    $brain_factory =
    
    # general
    
    $name =
    f32_health = 3.0
    f32 gib_health = 0.0
    $help_text =
    #$explosion_texture = Sprites/explosion.png
    #$sound_explosion =
    #u16_explosion_tiles_radius = .1
    #f32_explosion_damage = 0.0
    
    
    u8_default_room = 1
    
    #### There is 249 lines of rooms and functions, and the lines do not look like this. This is just an example of my setup.
    @$rooms = #
    Exampleroom2; Entities/Rooms/Sprites/DemoShop.png; Example msg; upgrade X g1-100/4; -; ## <-- This right here I want to be created from "example" in the rooms.cfg file in the rooms folder.
    #
    X g0; -; Example msg; upgrade X g1; uX;
    X g1; -; Example msg; upgrade X t0, upgrade X g2; uX;
    X t0; -; Example msg; upgrade X g1; uX;
    X t1; -; Example msg; upgrade X t0, upgrade X g2; uX;
    ;
    @$room_functions = #
    upgrade X g0; -; -; -; d; 5; 16; Example Msg; c5;
    upgrade X g1; -; -; -; d; 5; 16; Example Msg; c5;
    upgrade X t0; -; -; -; d; 5; 16; Example Msg; c5;
    upgrade X t1; -; -; -; d; 5; 16; Example Msg; c5;
    ;
    ;
    </br>--- merged: Jun 23, 2013 11:27 PM ---</br>
    Another reason why I want to do this is because there is some sort of limit of how big your room config can be. Meaning, everything after 333 line mark won't be read by the server. It's not due to any error done by myself, because I doubled checked everything, and loaded things separately chunk by chunk.
    </br>--- merged: Jun 27, 2013 5:35 PM ---</br>
    Any word on this?
     
  2. Zer0Striker

    Zer0Striker Shipwright

    Messages:
    139
    Um may I ask what this workshop does that makes it require so many lines?
    Also you have 2 semicolons at the end of the room functions and make sure you don't have any empty lines as it won't include the functions/rooms after the empty line.
    Edit: Btw I noticed you have default room set to 1. You could always spawn the room in with addBlob on a map.gm file.
    Code:
    loadMap(`Maps/example_map.png`); //Loads the map up.
     
    roomSpawnX = [Insert Number Here], //Where the room spawns on the x-axis.
    roomSpawnY = [Insert Number Here], //Where the room spawns on the y-axis.
    teamID = [Insert Number Here]; //Determines the team the room is spawned for; IDs are 0(Blue) and 1(Red).
     
    addBlob(`room`, `Entities/Rooms/Example_Room.cfg`, roomSpawnX*8+4, roomSpawnY*8-4, teamID); //Spawns the room with the given coordinates and teamid.
    To load up the map.gm just put the map.gm's directory into the mapcycle.
     
  3. MurCon

    MurCon Catapult Fodder

    Messages:
    9
    Not quite what I am trying to do, I want players to be able to create and upgrade the shops. I don't want to have it where it's already spawned. There isn't any double colon in my actually file, I just quickly put this together to show you what I want to do.