Problem with nuke ammo

Discussion in 'Mod Discussions' started by killerkiwijuice, November 7, 2014.

  1. killerkiwijuice

    killerkiwijuice Post Master General

    Messages:
    3,879
    Likes Received:
    3,597
    [​IMG]
    The bottom right of this picture shows my Doxstroyer nuclear launcher's UI for ammo

    I'm not sure how i can change that blank icon to display... any icon, i guess. I don't know how I can give it any icon.

    There's also a problem with ammo descriptions; this "!LOC" thing is confusing and when I try to change the "display name" and "description" it does not change in-game. Same thing with the basic stats, I changed the build metal cost from 50k to 20k but it does not show in-game.
  2. zweistein000

    zweistein000 Post Master General

    Messages:
    1,362
    Likes Received:
    727
    the "!LOC" thing probably tells the game what nape to display based on the localization settings you have set (that was always my guess).

    To get a working UI icon oyu need to do the following things:

    1. Make A UI Icon that exactly 60x60 pixels
    2. Name the icon after your unit.json
    3. Put the said icon into "[your mod folder]\ui\main\game\live_game\img\build_bar\units"
    4. Go into "[your mod folder]\ui\main\shared\js" and edit the build.js. In there you will have to
    - Specify where you unit.json is
    - Specify in which of the build bars the icon will show up
    - Specify in which slot of the specified buildbar the icon will be placed
    killerkiwijuice likes this.
  3. killerkiwijuice

    killerkiwijuice Post Master General

    Messages:
    3,879
    Likes Received:
    3,597
    to follow up:
    Code:
            // nuke hack
            // the projectiles are not magically added to the unit_list, so the display details aren't sent to the ui
    
            var nuke_id = '/pa/units/land/nuke_launcher/nuke_launcher_ammoX.json';
            var nuke_id = '/pa/units/land/nuke_launcher/nuke_launcher_ammo.json';
            var anti_nuke_id = '/pa/units/land/anti_nuke_launcher/anti_nuke_launcher_ammo.json';
    
            model.itemDetails[nuke_id] = new UnitDetailModel({ name: 'HIPPO', description: 'High cost, ultra high damage',  cost: 41000, sicon: siocnFor(nuke_id) });
            model.itemDetails[nuke_id] = new UnitDetailModel({ name: 'Doxstroyer', description: 'Destroys all dox on target planet',  cost: 19000, sicon: siconFor(nuke_id) });
            model.itemDetails[anti_nuke_id] = new UnitDetailModel({ name: 'SR-24 -Dox- Missile Defense', description: 'Anti-Nuke - Intercepts incoming nuclear dox missiles.', cost: 6750, sicon: siconFor(anti_nuke_id) });
    How am I supposed to add a new type of ammo when the "nuke_id" has to be different? I tried "nuke_id_X" but that didn't work.
  4. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Just call the variable something else:
    Code:
            // nuke hack
            // the projectiles are not magically added to the unit_list, so the display details aren't sent to the ui
    
            var nukeX_id = '/pa/units/land/nuke_launcher/nuke_launcher_ammoX.json';
            var nuke_id = '/pa/units/land/nuke_launcher/nuke_launcher_ammo.json';
            var anti_nuke_id = '/pa/units/land/anti_nuke_launcher/anti_nuke_launcher_ammo.json';
    
            model.itemDetails[nuke_id] = new UnitDetailModel({ name: 'HIPPO', description: 'High cost, ultra high damage',  cost: 41000, sicon: siocnFor(nuke_id) });
            model.itemDetails[nukeX_id] = new UnitDetailModel({ name: 'Doxstroyer', description: 'Destroys all dox on target planet',  cost: 19000, sicon: siconFor(nukeX_id) });
            model.itemDetails[anti_nuke_id] = new UnitDetailModel({ name: 'SR-24 -Dox- Missile Defense', description: 'Anti-Nuke - Intercepts incoming nuclear dox missiles.', cost: 6750, sicon: siconFor(anti_nuke_id) });
    killerkiwijuice likes this.
  5. killerkiwijuice

    killerkiwijuice Post Master General

    Messages:
    3,879
    Likes Received:
    3,597
    This is starting to get annoying
    Code:
            var nukeX_id = '/pa/units/land/nuke_launcher/nuke_launcher_ammoX.json';
            var nuke_id = '/pa/units/land/nuke_launcher/nuke_launcher_ammo.json';
            var anti_nuke_id = '/pa/units/land/anti_nuke_launcher/anti_nuke_launcher_ammo.json';
    
            model.itemDetails[nukeX_id] = new UnitDetailModel({ name: 'H1PP0', description: 'High cost, ultra high damage', 41000, sicon: siocnFor(nukeX_id) });
            model.itemDetails[nuke_id] = new UnitDetailModel({ name: 'Doxstroyer', description: 'Destroys all dox on target planet', 28000, sicon: siconFor(nuke_id) });
            model.itemDetails[anti_nuke_id] = new UnitDetailModel({ name: 'SR-24 -Dox- Missile Defense', description: 'Anti-Nuke - Intercepts incoming nuclear dox missiles.', 6750, sicon: siconFor(anti_nuke_id) });
    [​IMG]
    I changed the description in "live_game.js" and it does not show in game for that ammo. Still default. Should be named the other thing, hippo or doxstroyer (forgot which one but that doesn't matter)
    Last edited: November 9, 2014
  6. liquius

    liquius Well-Known Member

    Messages:
    731
    Likes Received:
    482
    I got it working for RCBM a while back. I can't quite remember how exactly I fixed it, but it works.

    In livegame.js we have
    Code:
    model.itemDetails[tac_nuke_id] = new UnitDetailModel('Tactical Nuke', 'ICBM-64 -Silencer- Missile', 1500, siconFor(nuke_tac_id));
    And this in the ammo
    Code:
      "description": "ICBM-64 -Silencer- Missile",
      "display_name": "Tactical Nuke", 
    I am not sure if all of that is needed, but that should be enough for you to get it working.
  7. killerkiwijuice

    killerkiwijuice Post Master General

    Messages:
    3,879
    Likes Received:
    3,597
    I reset my nuke folder and did everything in this thread, and now there is no description at all for the nuke ammo. I was only trying to change one nuke ammo this time to avoid extra complications.
    [​IMG]
    EDIT: This is what I did
    • I renamed my nuke ammo to "nuke_launcher_hippo_ammo.json"
    • I renamed the tool weapon to "nuke_launcher_tool_hippo_weapon.json"
    • I edited the "nuke_launcher_tool_hippo_weapon.json" to build "nuke_launcher_hippo_ammo.json".
    • I edited buildable projectiles in "nuke_launcher.json" to build "nuke_launcher_hippo_ammo.json"
    • I edited "live_game.js" to this:
    Code:
            var hippo_nuke_id = '/pa/units/land/nuke_launcher/nuke_launcher_hippo_ammo.json';
            var anti_nuke_id = '/pa/units/land/anti_nuke_launcher/anti_nuke_launcher_ammo.json';
    
            model.itemDetails[hippo_nuke_id] = new UnitDetailModel({ name: 'H1PP0', description: 'High cost, ultra high damage', 41000, sicon: siocnFor(hippo_nuke_id) });
            model.itemDetails[anti_nuke_id] = new UnitDetailModel({ name: 'SR-24 -Dox- Missile Defense', description: 'Anti-Nuke - Intercepts incoming nuclear dox missiles.', 6750, sicon: siconFor(anti_nuke_id) });
    • I edited the icon atlas and unit icon folder to show the icon, which is working obviously
    • I edited the build.js to allow the "nuke_launcher_hippo_ammo.json"
    WHAT DID I DO WRONG AHHHHHHHH :mad:
    Last edited: November 9, 2014
  8. killerkiwijuice

    killerkiwijuice Post Master General

    Messages:
    3,879
    Likes Received:
    3,597
    Alright I finally got it to work today and i'm so close now

    [​IMG]
    This picture shows my two custom icons, the bigger one is not the final one but the small one next to the ammo name is the final strategic icon (i think it turned out pretty well in PS). The only problem is that this small icon does not get put on the actual nuke ammo:
    [​IMG]
    That dot :mad:
    So, I need some guidance here :)
  9. killerkiwijuice

    killerkiwijuice Post Master General

    Messages:
    3,879
    Likes Received:
    3,597
    I see the strategic icons for the nukes in other mods don't work also.

    Are custom strategic icons just not possible?

    sorry for triple post
  10. liquius

    liquius Well-Known Member

    Messages:
    731
    Likes Received:
    482
    They are possible, but only with a client mod. That's the reason why all the bigger server mods have there own client mod.
  11. zweistein000

    zweistein000 Post Master General

    Messages:
    1,362
    Likes Received:
    727
    Where?
    killerkiwijuice and stuart98 like this.
  12. thetrophysystem

    thetrophysystem Post Master General

    Messages:
    7,050
    Likes Received:
    2,874
    Yeah, only the client can have new strat icons. New strat icons in a server mod, loaded by a vanilla client mod, show as radar blip still.

    si_name can give one thing another existing icon. You could give it the land_mine icon that way if you wanted. Just to clarify.

Share This Page