Jump to content
Haduuken

[Tutorial] Uranium Mine (Fixed)

Recommended Posts

Author: StonerGaming

Difficulty: Easy/Copy Paste

Step 1. Open Config_VItems.hpp. Add under //mined items

    class uranium_unrefined {
        variable = "uraniumUnrefined";
        displayName = "STR_Item_UraniumOre";
        weight = 3;
        buyPrice = -1;
        sellPrice = -1;
        illegal = true;
        edible = -1;
        icon = "";
    };

    class uranium_refined {
        variable = "uraniumRefined";
        displayName = "STR_Item_Uranium";
        weight = 1;
        buyPrice = -1;
        sellPrice = 6500; //Optional Price
        illegal = true;
        edible = -1;
        icon = "";
    };	

Step 2. Open Config_VItems.hpp. Add Under Virtual Shops

    class uranium {
        name = "STR_Shops_Uranium";
        side = "civ";
        license = "";
        level[] = { "", "", -1, "" };
        items[] = { "uranium_refined" };
    };

Step 3. Open Config_Gather.hpp. Add under "Class Minerals"

        class uranium_unrefined {
            amount = 15;
            zones[] = { "uranium_mine" };
            item = "pickaxe";
            mined[] = { "uranium_unrefined" };
            zoneSize = 30;
        };	

Step 4. Open Config_License.hpp. Add under //Processing License

    class uranium {
        variable = "uranium";
        displayName = "STR_License_Uranium";
        price = 35000;
        illegal = true;
        side = "civ";
    };	

Step 5. Open Config_Process.hpp. Add

    class uranium {
        MaterialsReq[] = {{"uranium_unrefined",1}};
        MaterialsGive[] = {{"uranium_refined",1}};
        Text = "STR_Process_Uranium";
        //ScrollText = "Refine Uranium";
        NoLicenseCost = 10000;
    };

Step 6. Open stringtable.xml. Add

        <Key ID="STR_Item_Uranium">
            <Original>Uranium</Original>
        </Key>
        <Key ID="STR_Item_UraniumOre">
            <Original>Uranium Ore</Original>
        </Key>		
        <Key ID="STR_MAR_Uranium_Trader">
            <Original>Uranium Trader</Original>
        </Key>	
        <Key ID="STR_Process_Uranium">
            <Original>Processing Uranium</Original> 
        </Key>	
        <Key ID="STR_License_Uranium">
            <Original>Uranium Processing</Original>
        </Key>		

Step 7. Open your mission.sqm in A3 Editor. Place a marker

variable name: uranium_mine

Step 8. Place a NPC. add in the init. (For Processing)

this enableSimulation false;  this allowDamage false;  this addAction[localize"STR_Process_Uranium",life_fnc_processAction,"uranium",0,false,false,"",' life_inv_uraniumUnrefined > 0 && !life_is_processing && !life_action_inUse'];  this addAction[format ["%1 ($%2)",localize (getText(missionConfigFile >> "Licenses" >> "uranium" >> "displayName")), [(getNumber(missionConfigFile >> "Licenses" >> "uranium" >> "price"))] call life_fnc_numberText],life_fnc_buyLicense,"uranium",0,false,false,"",' !license_civ_uranium && playerSide isEqualTo civilian '];

Step 9. Place a NPC. add in the init. (For Trader)

this allowDamage false; this enableSimulation false; this addAction[localize"STR_MAR_Uranium_Trader",life_fnc_virt_menu,"uranium"];

I am 100% sure this version works i have tested it on my server

  • Like 5

Share this post


Link to post
Share on other sites
On 8/26/2017 at 0:17 PM, JudiciaLL said:

i rpt no error but setting up client

The worst this would do is not mine or not show a scroll menu at npc's. So start with your last working mission file and follow the tutorial again. Remember to keep an untouched working backup to fall back on. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...