1. 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

Shadowblitz16's Modding Questions

Discussion in 'Modding Help' started by Shadowblitz16, Mar 24, 2017.

  1. Skinney

    Skinney THD Team THD Team Forum Moderator Tester

    Messages:
    468
    DefaultGUI.as which is located in Base\Scripts\Default\ is an #include in KAG.as which is located in Base\Rules\CommonScripts\. It doesn't matter where you instantiate the icon as long as you do so prior to needing it.
     
  2. Shadowblitz16

    Shadowblitz16 Ballista Bolt Thrower

    Messages:
    158
    ok thankyou.

    I some other questions..

    where is the script that draws and determines whats is drawn in the knight and archer bomb and arrow select screen?
    I have some new bombs I want to add to its functionality.

    also what determines weather a knight throws a bomb material or the bomb item corresponding to that material when he presses space?
    I have this problem where the knight is throwing the bunkerbomb material instead of the bunkerbomb item.
     
  3. Skinney

    Skinney THD Team THD Team Forum Moderator Tester

    Messages:
    468
    Take a look at KnightHUD.as. Something that might be beneficial to you is to consider what key terms, functions, or hooks that might be used to create something like the Knight menu and search for them in Sublime Text using Ctrl+Shift+F.
     
  4. Shadowblitz16

    Shadowblitz16 Ballista Bolt Thrower

    Messages:
    158
    @Skinney I did take a look at knightHUD.as and I did a search on DrawInventoryOnHUD() function but the file that declares it, which lead me to ActorHUDStartPos.as, but I don't see why my bombs are showing up as question marks.

    I also don't understand how the buttons work when you don't have the bomb. it looks like it uses a blank inventory sprite but I can't find one in the base folder.
    does it just draw grey over the opaque pixels of the sprite?
    --- Double Post Merged, Mar 29, 2017, Original Post Date: Mar 28, 2017 ---
    ok so I got my bigger bomb to actually work.
    NOTE IF SOMEONE ELSE IS HAVING THIS PROBLEM MAKE SURE THIS..
    Code:
                {
                    ShopItem@ s = addShopItem(this, "Bunker Bomb", "$bunkerbomb$", "mat_bunkerbombs", descriptions[62], false);
                    AddRequirement(s.requirements, "coin", "", "Coins", cost_bunkerbombs);
                }
    
    IS THIS,,
    Code:
                {
                    ShopItem@ s = addShopItem(this, "Bunker Bomb", "$bunkerbomb$", "mat_bunkerbombs", descriptions[62], true);
                    AddRequirement(s.requirements, "coin", "", "Coins", cost_bunkerbombs);
                }
    
    anyways I was rearranging my bomb order and it seems that even though I reordered the KnightLogic.as and the KnightCommon.as. cherrybombs and bombs are swapped in explosion power
    here is what I mean...
    Code:
    //In Knightlogic.as
    const string bombTypeName = bombTypeNames[bombType];
    this.Tag(bombTypeName + " done activate");
    if (hasItem(this, bombTypeName))
    {
        if (bombType == 0)
        {
            if (getNet().isServer())
            {
                //Remember to use the item name here not the material name.
                CBlob @blob = server_CreateBlob("cherrybomb", this.getTeamNum(), this.getPosition());
                if (blob !is null)
                {
                    TakeItem(this, bombTypeName);
                    this.server_Pickup(blob);
                    blob.set_f32("explosive_radius", 24.0f);
                    blob.set_f32("explosive_damage", 1.0f);
                    blob.set_f32("map_damage_radius", 12.0f);
                    blob.set_f32("map_damage_ratio", 0.0f);
                    blob.set_bool("map_damage_raycast", true);
                    //blob.set_string("custom_explosion_sound", "/GlassBreak");
                    blob.set_u8("custom_hitter", Hitters::bomb);
                }
            }
        }
        else if (bombType == 1)
        {
            if (getNet().isServer())
            {
                //Remember to use the item name here not the material name.
                CBlob @blob = server_CreateBlob("bomb", this.getTeamNum(), this.getPosition());
                if (blob !is null)
                {
                    TakeItem(this, bombTypeName);
                    this.server_Pickup(blob);
                    blob.set_f32("explosive_radius", 48.0f);
                    blob.set_f32("explosive_damage", 4.0f);
                    blob.set_f32("map_damage_radius", 24.0f);
                    blob.set_f32("map_damage_ratio", 0.4f);
                    blob.set_bool("map_damage_raycast", true);
                    //blob.set_string("custom_explosion_sound", "/GlassBreak");
                    blob.set_u8("custom_hitter", Hitters::bomb);
                }
            }
        }
        else if (bombType == 2)
        {
            if (getNet().isServer())
            {
                //Remember to use the item name here not the material name.
                CBlob @blob = server_CreateBlob("bunkerbomb", this.getTeamNum(), this.getPosition());
                if (blob !is null)
                {
                    TakeItem(this, bombTypeName);
                    this.server_Pickup(blob);
                    blob.set_f32("explosive_radius", 64.0f);
                    blob.set_f32("explosive_damage", 8.0f);
                    blob.set_f32("map_damage_radius", 48.0f);
                    blob.set_f32("map_damage_ratio", 0.8f);
                    blob.set_bool("map_damage_raycast", true);
                    //blob.set_string("custom_explosion_sound", "/GlassBreak");
                    blob.set_u8("custom_hitter", Hitters::bomb);
                }
            }
        }
        else if (bombType == 3)
        {
            if (getNet().isServer())
            {
                //Remember to use the item name here not the material name.
                CBlob @blob = server_CreateBlob("waterbomb", this.getTeamNum(), this.getPosition());
                if (blob !is null)
                {
                    TakeItem(this, bombTypeName);
                    this.server_Pickup(blob);
                    blob.set_f32("map_damage_ratio", 0.0f);
                    blob.set_f32("explosive_damage", 0.0f);
                    blob.set_f32("explosive_radius", 92.0f);
                    blob.set_bool("map_damage_raycast", false);
                    blob.set_string("custom_explosion_sound", "/GlassBreak");
                    blob.set_u8("custom_hitter", Hitters::water);
                }
            }
        }
        else
        {
        }
    
        SetFirstAvailableBomb(this);
    }
    
    Code:
    //In KnightCommon.as
    namespace BombType
    {
        enum type
        {
            cherry = 0,
            bomb,
            bunker,
            water,
            count
        };
    }
    //Remember to use the item name here not the material name.
    const string[] bombNames = { "cherrybomb",
                                "bomb",
                                "bunkerbomb",
                                 "waterbomb"
                               };
    
    const string[] bombIcons = { "$CherryBomb$",
                                "$Bomb$",       
                                "$BunkerBomb$",
                                 "$WaterBomb$"
                               };
    //Remember to use the item name here not the material name.
    const string[] bombTypeNames = { "mat_cherrybombs",
                                    "mat_bombs",
                                    "mat_bunkerbombs",
                                     "mat_waterbombs"
                                   };
    
    
    so I was wondering is there something else I am missing because the other bombs work fine.
    --- Double Post Merged, Apr 7, 2017 ---
    bump I still need this.
    --- Double Post Merged, Aug 16, 2017 ---
    @Skinney
    I still need this I can't find where the inventory bomb selector icons are coded in.

    KnightHud is not it, as it defines nothing related to the sprites.

    I have added the bombs icons to BasicHelps..
    Code:
    void onInit(CRules@ this)
    {
        // knight
        AddIconToken("$CherryBomb$", "Entities/Characters/Knight/KnightIcons.png", Vec2f(16, 32), 1);
        AddIconToken("$NormalBomb$", "Entities/Characters/Knight/KnightIcons.png", Vec2f(16, 32), 2);
        AddIconToken("$BunkerBomb$", "Entities/Characters/Knight/KnightIcons.png", Vec2f(16, 32), 3);
        AddIconToken("$WaterBomb$",  "Entities/Characters/Knight/KnightIcons.png", Vec2f(16, 32), 4);
        AddIconToken("$Help_Bomb1$", "Entities/Common/GUI/HelpIcons.png",          Vec2f(8, 16), 30);
        AddIconToken("$Help_Bomb2$", "Entities/Common/GUI/HelpIcons.png",          Vec2f(8, 16), 31);
        AddIconToken("$Swap$", "Entities/Common/GUI/HelpIcons.png",                Vec2f(16, 16), 7);
        AddIconToken("$Jab$", "Entities/Common/GUI/HelpIcons.png",                 Vec2f(16, 16), 20);
        AddIconToken("$Slash$", "Entities/Common/GUI/HelpIcons.png",               Vec2f(16, 16), 21);
        AddIconToken("$Shield$", "Entities/Common/GUI/HelpIcons.png",              Vec2f(16, 16), 22);
        // archer
        AddIconToken("$Arrow$", "Entities/Characters/Archer/ArcherIcons.png",      Vec2f(16, 32), 0);
        AddIconToken("$WaterArrow$", "Entities/Characters/Archer/ArcherIcons.png", Vec2f(16, 32), 1);
        AddIconToken("$FireArrow$", "Entities/Characters/Archer/ArcherIcons.png",  Vec2f(16, 32), 2);
        AddIconToken("$BombArrow$", "Entities/Characters/Archer/ArcherIcons.png",  Vec2f(16, 32), 3);
        AddIconToken("$Daggar$", "Entities/Common/GUI/HelpIcons.png",              Vec2f(16, 16), 10);
        AddIconToken("$Help_Arrow1$", "Entities/Common/GUI/HelpIcons.png",         Vec2f(8, 16), 28);
        AddIconToken("$Help_Arrow2$", "Entities/Common/GUI/HelpIcons.png",         Vec2f(8, 16), 29);
        AddIconToken("$Swap$", "Entities/Common/GUI/HelpIcons.png",                Vec2f(16, 16), 7);
        AddIconToken("$Grapple$", "Entities/Common/GUI/HelpIcons.png",             Vec2f(16, 16), 16);
        // builder
        AddIconToken("$Build$", "Entities/Common/GUI/HelpIcons.png",               Vec2f(16, 16), 11);
        AddIconToken("$Pick$", "Entities/Common/GUI/HelpIcons.png",                Vec2f(16, 16), 12);
        AddIconToken("$Rotate$", "Entities/Common/GUI/HelpIcons.png",              Vec2f(16, 16), 5);
        AddIconToken("$Help_Block1$", "Entities/Common/GUI/HelpIcons.png",         Vec2f(8, 16), 12);
        AddIconToken("$Help_Block2$", "Entities/Common/GUI/HelpIcons.png",         Vec2f(8, 16), 13);
        AddIconToken("$Swap$", "Entities/Common/GUI/HelpIcons.png",                Vec2f(16, 16), 7);
        AddIconToken("$BlockStone$", "Sprites/world.png",                          Vec2f(8, 8), 96);
    
        AddIconToken("$workshop$", "Entities/Common/GUI/HelpIcons.png",            Vec2f(16, 16), 2);
    }
    
    void onBlobCreated(CRules@ this, CBlob@ blob)
    {
        if (!u_showtutorial)
            return;
    
        const string name = blob.getName();
    
        if (blob.hasTag("seats") && !blob.hasTag("animal"))
        {
            SetHelp(blob, "help hop", "", " $down_arrow$ Hop inside  $KEY_S$", "", 5);
            SetHelp(blob, "help hop out", "", " Get out  $KEY_W$", "", 4);
        }
        if (blob.hasTag("trader"))
        {
            SetHelp(blob, "help use", "", "$trader$ Buy    $KEY_E$", "", 3);
        }
        if (blob.hasTag("respawn"))
        {
            SetHelp(blob, "help use", "", "$CLASSCHANGE$ Change class    $KEY_E$", "", 3);
        }
        if (blob.hasTag("door"))
        {
            SetHelp(blob, "help rotate", "", "$" + blob.getName() + "$" + " $Rotate$ Rotate    $KEY_SPACE$", "", 3);
        }
    
    
    
        if (name == "hall")
        {
            SetHelp(blob, "help use", "", "$CLASSCHANGE$ Change class    $KEY_E$", "", 5);
        }
        else if (name == "trap_block")
        {
            SetHelp(blob, "help show", "builder", "$trap_block$ Opens on enemy", "", 15);
        }
        else if (name == "spikes")
        {
            SetHelp(blob, "help show", "builder", "$spikes$ Retracts on enemy if on stone $STONE$", "", 20);
        }
        else if (name == "wooden_platform")
        {
            SetHelp(blob, "help rotate", "", "$wooden_platform$  $Rotate$ Rotate    $KEY_SPACE$", "", 3);
        }
        else if (name == "ladder")
        {
            SetHelp(blob, "help rotate", "", "$ladder$  $Rotate$ Rotate    $KEY_SPACE$", "", 3);
        }
        else if (name == "tdm_ruins")
        {
            SetHelp(blob, "help use", "", "Change class    $KEY_E$", "", 5);
        }
        else if (name == "lantern")
        {
            SetHelp(blob, "help activate", "", "$lantern$ On/Off     $KEY_SPACE$", "");
            SetHelp(blob, "help pickup", "", "$lantern$ Pick up    $KEY_C$");
        }
        else if (name == "satchel")
        {
            SetHelp(blob, "help activate", "knight", "$satchel$ Light     $KEY_SPACE$", "$satchel$ Only KNIGHT can light satchel", 3);
            SetHelp(blob, "help throw", "knight", "$satchel$ THROW!    $KEY_SPACE$", "", 3);
        }
        else if (name == "log")
        {
            SetHelp(blob, "help action2", "builder", "$log$ Chop $mat_wood$   $RMB$", "", 3);
        }
        else if (name == "keg")
        {
            SetHelp(blob, "help pickup", "", "$keg$Pick up    $KEY_C$", "", 3);
            SetHelp(blob, "help activate", "knight", "$keg$Light    $KEY_SPACE$", "$keg$Only KNIGHT can light keg", 5);
            SetHelp(blob, "help throw", "", "$keg$THROW!    $KEY_SPACE$", "", 3);
        }
        else if (name == "cherrybomb")
        {
            SetHelp(blob, "help throw", "", "$mat_cherrybombs$THROW!    $KEY_SPACE$", "", 3);
        }
        else if (name == "bomb")
        {
            SetHelp(blob, "help throw", "", "$mat_bombs$THROW!     $KEY_SPACE$", "", 3);
        }
        else if (name == "bunkerbomb")
        {
            SetHelp(blob, "help throw", "", "$mat_bunkerbombs$THROW!    $KEY_SPACE$", "", 3);
        }
        else if (name == "crate")
        {
            SetHelp(blob, "help pickup", "", "$crate$Pick up    $KEY_C$", "", 3);
        }
        else if (name == "workbench")
        {
            SetHelp(blob, "help use", "", "$workbench$    $KEY_TAP$$KEY_E$", "", 4);
        }
        else if (name == "catapult" || name == "ballista")
        {
            SetHelp(blob, "help DRIVER movement", "", "$" + blob.getName() + "$" + "Drive     $KEY_A$ $KEY_S$ $KEY_D$", "", 3);
            SetHelp(blob, "help GUNNER action", "", "$" + blob.getName() + "$" + "FIRE     $KEY_HOLD$$LMB$", "", 3);
        }
        else if (name == "mounted_bow")
        {
            SetHelp(blob, "help GUNNER action", "", "$" + blob.getName() + "$" + "FIRE     $LMB$", "", 3);
        }
        else if (name == "food")
        {
            SetHelp(blob, "help switch", "", "$food$Take out food  $KEY_HOLD$$KEY_F$", "", 3);
        }
        else if (name == "boulder")
        {
            SetHelp(blob, "help pickup", "", "$boulder$ Pick up    $KEY_C$");
        }
        //else if (name == "tent")
        //{
        //    SetHelp( blob, "help use", "", "Change class    $KEY_E$", "", 5 );
        //}
        else if (name == "building")
        {
            SetHelp(blob, "help use", "", "$building$Construct    $KEY_E$", "", 3);
        }
        else if (name == "archershop" || name == "boatshop" || name == "knightshop" || name == "buildershop" || name == "vehicleshop")
        {
            SetHelp(blob, "help use", "", "$building$Use    $KEY_E$", "", 3);
        }
        //else if (name == "ctf_flag")
        //{
        //    SetHelp( blob, "help use", "", "$$ctf_flag$ Bring enemy flag to capture", "", 3 );
        //}
    }
    

    and this is my KnightIcons
    [​IMG]

    I think there is a file I do not know about that actually points to these sprites when I have them in my inventory and/or have them selected.

    EDIT: also note I changed bombs to normal bombs
     
  5. Monkey_Feats

    Monkey_Feats Bison Rider Tester

    Messages:
    214
    What's the actual problem at the moment? can't see bomb icons?
    The bomb selection menu is made in KnightLogic.as under void onCreateInventoryMenu().
    But you shouldn't need to change anything in there because it pulls the info it needs from the bomb arrays you created in KnightCommon.as.
     
    Last edited: Aug 17, 2017
  6. Shadowblitz16

    Shadowblitz16 Ballista Bolt Thrower

    Messages:
    158
    the shop icons change when I buy stuff and the bomb selection menu is not working its just blank question marks.
    and I did set up my knight common correctly
    Code:
    //common knight header
    namespace KnightStates
    {
        enum States
        {
            normal = 0,
            shielding,
            shielddropping,
            shieldgliding,
            sword_drawn,
            sword_cut_mid,
            sword_cut_mid_down,
            sword_cut_up,
            sword_cut_down,
            sword_power,
            sword_power_super
        }
    }
    
    namespace KnightVars
    {
        const ::s32 resheath_time = 2;
    
        const ::s32 slash_charge = 15;
        const ::s32 slash_charge_level2 = 38;
        const ::s32 slash_charge_limit = slash_charge_level2 + slash_charge + 10;
        const ::s32 slash_move_time = 4;
        const ::s32 slash_time = 13;
        const ::s32 double_slash_time = 8;
    
        const ::f32 slash_move_max_speed = 3.5f;
    
        const u32 glide_down_time = 50;
    }
    
    shared class KnightInfo
    {
        u8 swordTimer;
        u8 shieldTimer;
        bool doubleslash;
        u8 tileDestructionLimiter;
        u32 slideTime;
    
        u8 state;
        Vec2f slash_direction;
        s32 shield_down;
    };
    
    
    namespace BombType
    {
        enum type
        {
            cherry = 0,
            normal = 1,
            bunker = 2,
            water  = 3,
            count  = 4
        };
    }
    //Remember to use the item name here not the material name.
    const string[] bombNames = { "cherrybomb",
                                "normalbomb",
                                "bunkerbomb",
                                 "waterbomb"
                               };
    
    const string[] bombIcons = { "$CherryBomb$",
                                "$NormalBomb$",          
                                "$BunkerBomb$",
                                 "$WaterBomb$"
                               };
    //Remember to use the item name here not the material name.
    const string[] bombTypeNames = { "mat_cherrybombs",
                                    "mat_normalbombs",
                                    "mat_bunkerbombs",
                                     "mat_waterbombs"
                                   };
    
    
    //checking state stuff
    
    bool isShieldState(u8 state)
    {
        return (state >= KnightStates::shielding && state <= KnightStates::shieldgliding);
    }
    
    bool isSpecialShieldState(u8 state)
    {
        return (state > KnightStates::shielding && state <= KnightStates::shieldgliding);
    }
    
    bool isSwordState(u8 state)
    {
        return (state >= KnightStates::sword_drawn && state <= KnightStates::sword_power_super);
    }
    
    bool inMiddleOfAttack(u8 state)
    {
        return ((state > KnightStates::sword_drawn && state <= KnightStates::sword_power_super));
    }
    
    //checking angle stuff
    
    f32 getCutAngle(CBlob@ this, u8 state)
    {
        f32 attackAngle = (this.isFacingLeft() ? 180.0f : 0.0f);
    
        if (state == KnightStates::sword_cut_mid)
        {
            attackAngle += (this.isFacingLeft() ? 30.0f : -30.0f);
        }
        else if (state == KnightStates::sword_cut_mid_down)
        {
            attackAngle -= (this.isFacingLeft() ? 30.0f : -30.0f);
        }
        else if (state == KnightStates::sword_cut_up)
        {
            attackAngle += (this.isFacingLeft() ? 80.0f : -80.0f);
        }
        else if (state == KnightStates::sword_cut_down)
        {
            attackAngle -= (this.isFacingLeft() ? 80.0f : -80.0f);
        }
    
        return attackAngle;
    }
    
    f32 getCutAngle(CBlob@ this)
    {
        Vec2f aimpos = this.getMovement().getVars().aimpos;
        int tempState;
        Vec2f vec;
        int direction = this.getAimDirection(vec);
    
        if (direction == -1)
        {
            tempState = KnightStates::sword_cut_up;
        }
        else if (direction == 0)
        {
            if (aimpos.y < this.getPosition().y)
            {
                tempState = KnightStates::sword_cut_mid;
            }
            else
            {
                tempState = KnightStates::sword_cut_mid_down;
            }
        }
        else
        {
            tempState = KnightStates::sword_cut_down;
        }
    
        return getCutAngle(this, tempState);
    }
    
    //shared attacking/bashing constants (should be in KnightVars but used all over)
    
    const int DELTA_BEGIN_ATTACK = 2;
    const int DELTA_END_ATTACK = 5;
    const f32 DEFAULT_ATTACK_DISTANCE = 16.0f;
    const f32 MAX_ATTACK_DISTANCE = 16.0f;
    const f32 SHIELD_KNOCK_VELOCITY = 3.0f;
    
    const f32 SHIELD_BLOCK_ANGLE = 175.0f;
    const f32 SHIELD_BLOCK_ANGLE_GLIDING = 140.0f;
    const f32 SHIELD_BLOCK_ANGLE_SLIDING = 160.0f;
    
     
  7. Monkey_Feats

    Monkey_Feats Bison Rider Tester

    Messages:
    214
    hmm seems weird, could you upload your mod in a zip folder, I'll have a quick look.
     
  8. Shadowblitz16

    Shadowblitz16 Ballista Bolt Thrower

    Messages:
    158
  9. Monkey_Feats

    Monkey_Feats Bison Rider Tester

    Messages:
    214
    well for the knight icons you need to add the icons to DefaultGUI.as rather than BasicHelps.as.
     
    Last edited: Aug 17, 2017
  10. Shadowblitz16

    Shadowblitz16 Ballista Bolt Thrower

    Messages:
    158
    that shouldn't matter though should it?
    EDIT: ya I don't even see it add anything related to the inventory in DefaultHud.as

    also class icons are not the problem
     
  11. Monkey_Feats

    Monkey_Feats Bison Rider Tester

    Messages:
    214
    As for the explosions, I think you just have your values wrong.

    In CherryBomb.as you have done - SetupBomb( this, bomb_fuse, 64.0f, 3.0f, 24.0f, 0.4f, true );
    and in NormalBomb.as you have done - SetupBomb(this, bomb_fuse, 48.0f, 3.0f, 24.0f, 0.4f, true);

    swap the 64 and the 48,
    --- Double Post Merged, Aug 17, 2017, Original Post Date: Aug 17, 2017 ---
    knight icons* mb
     
  12. Shadowblitz16

    Shadowblitz16 Ballista Bolt Thrower

    Messages:
    158
    oh I thought that bomb damage was calculated in KnightLogic.as

    EDIT: ok so I looked at the base files and no the icons are added in BasicHelps.as
     
    Last edited: Aug 17, 2017
  13. Monkey_Feats

    Monkey_Feats Bison Rider Tester

    Messages:
    214
    I think basic helps is just for the help popups (Edit: No, No it isn't), plus this is how I have it working for me.
    screen.png
     
    Last edited: Aug 17, 2017
  14. Shadowblitz16

    Shadowblitz16 Ballista Bolt Thrower

    Messages:
    158
    hmm weird my base basichelps have these lines of code..

    Code:
        AddIconToken("$Bomb$", "Entities/Characters/Knight/KnightIcons.png", Vec2f(16, 32), 0);
        AddIconToken("$WaterBomb$", "Entities/Characters/Knight/KnightIcons.png", Vec2f(16, 32), 2);
        AddIconToken("$Satchel$", "Entities/Characters/Knight/KnightIcons.png", Vec2f(16, 32), 3);
        AddIconToken("$Keg$", "Entities/Characters/Knight/KnightIcons.png", Vec2f(16, 32), 4);
    
    which looks like where it adds the inventory selector icons

    I just want to add these where the game normally adds them

    EDIT: also my cherry and normal bombs are still swapped even though I swapped the values in the as file
     
    Last edited: Aug 17, 2017
  15. Monkey_Feats

    Monkey_Feats Bison Rider Tester

    Messages:
    214
    In your gamemode.cfg, the line space between redbarrier.as and basichelps.as is causing the problem XD. Also you'll need to fix those ticket scripts or take em out for it to work.
     
  16. Shadowblitz16

    Shadowblitz16 Ballista Bolt Thrower

    Messages:
    158
    lol I'm not quite sure how to fix the ticked scripts but I will get to it later
    also I will take a look at the gamemode cfg

    EDIT: by problem did you mean the bomb explosion swap or the inventory selector icons not showing?
    EDIT2: nvm looks like it was the icon problem! yay one bug down! thankyou.
     
    Last edited: Aug 17, 2017
  17. Monkey_Feats

    Monkey_Feats Bison Rider Tester

    Messages:
    214
    I meant the icons not showing, I think by having the space there it was not loading the rest of the scripts.

    In NormalBomb.as you are missing this :
    Code:
    void onTick( CBlob@ this )
    {
        //set parent from attached blob
    
        if (getNet().isServer())
        {
            CBlob@ parent = this.getAttachments().getAttachedBlob("PICKUP", 0);
    
            if (parent !is null)
            {
                u16 oldParentID = this.get_u16("explosive_parent");
                u16 newParentID = parent.getNetworkID();
    
                if (oldParentID != newParentID)
                {
                    this.set_u16("explosive_parent", newParentID);
                    this.SetDamageOwnerPlayer( parent.getPlayer() );
                    //this.Sync("explosive_parent", true); we dont need this synced
                }
            }
        }
    
    }
     
  18. Shadowblitz16

    Shadowblitz16 Ballista Bolt Thrower

    Messages:
    158
    cool that fixed the normal bombs having less knockback then cherry bombs. thankyou!

    so where does it decide the archer's arrow sprite when he charges the bow?
    I rearranged the ArrowType enum in archerCommon.as and it seems that it fires the correct arrow but it doesn't show the correct arrow when charging. any ideas?
     
    Last edited: Aug 17, 2017
  19. Monkey_Feats

    Monkey_Feats Bison Rider Tester

    Messages:
    214
    Few things with the arrows, firstly in ArcherCommon.as, you rearranged the name arrays, but you didn't rearrange the enum type. Needs to be the same order as the others (normal = 0, fire, bomb, water)

    Secondly, you'll need to add ArcherAnim.as to your mod and in it rearrange the arrow frames to the same order as before. (Lines: 68 - 71)

    Lastly, since you swapped the sprites around in ArcherIcons.png, you'll need to change the frame number for them in BasicHelps.as. Although seeing as you didn't add any new arrow frames, there is no point in doing this, just delete ArcherIcons.png from your mod and use the base one.

    Also while I'm here, your material default frames and inventory frames need changing in their respected cfg's.
     
  20. Shadowblitz16

    Shadowblitz16 Ballista Bolt Thrower

    Messages:
    158
    Ok cool thankyou it looks shops are good besides the icon by the price do you know how to fix that?