-
Notifications
You must be signed in to change notification settings - Fork 0
Modding
We Also Have a Modding Tutorial Here.
We don't know why, but we added mod support. This means you can run extra code every tick, add new shop items, and do anything.
Create a new project, and call it whatever you want. Next, create a package, and call it whatever you want. If you are using Eclipse to make a mod, you need to edit your build path. Right-click your project folder, click Build Path, then select Configure Build Path. If you are not already in the Libraries Tab, select Libraries, and Click Add External JARs... on the right. Next, you need to locate the directory where you saved our game. If you ever move this jar, you will need to repeat this process. After you have selected your jar and added it, you can now hit Apply and Close at the bottom.
You are now ready to make your mod.
We don't know.
We also don't know.
To make a mod, create a class extending Mod
(com.wearedevs.someclicker.mod.Mod
). In the constructor of your new class will contain all the code that is run (Registering Handlers and Shop Items).
package com.imdaveead.someclicker.examplemod;
import com.wearedevs.someclicker.mod.Mod;
public class MyNewMod extends Mod {
public MyNewMod() {
//Code To Run When Mod is Loaded.
public void preInit() {
//Code to Run Before Loading the Save File.
}
public void postInit() {
//Code to Run After Loading the Save File.
}
public String[] save() {
//Save Your Mod Stuff.
return null;
}
public void load(String[] savefile) {
//Load Your Mod Stuff.
}
}
To create a shop item, make a new class that extends ShopItem
(com.wearedevs.someclicker.shop.ShopItem
)
import com.wearedevs.someclicker.shop.ShopItem;
public class MyShopItem extends ShopItem {
public void onPurchase() {
//Run Code
}
public int getPrice() {
return 100;
}
public String getName() {
return "My Custom Item";
}
}
Use getPrice()
and getName()
to return the price and name of the item. onPurchase()
is called when the user successfully buys your item.
To add the item to the shop call ShopHander.unlock(ShopItem item)
with your item. You can make shop item unlock trees by calling ShopHander.unlock
after purchasing an item.
To add code to the game loop, add a new class that extends TickHook
(com.wearedevs.someclicker.mod.TickHook
). In the run
method, add the code you want to run per tick. When you want to disable the hook, call this.disable()
. To add the hook, just create a new instance of it.
import com.wearedevs.someclicker.mod.TickHook;
public class MyHook extends TickHook {
public void run() {
}
}
Important Variables:
Main.clicks
The Amount of Clicks the User Has.
Main.perClick
How Much the User Gets When He or She Clicks.
Main.multiplier
How much to multiply Main.perClick
by.
Once you have made your mod, you want to export it to a jar file. Then add a file called mod.txt in your jar containing four, comma-separated values.
<Game Version>,<Mod Name>,<Mod Version>,<Main Class>
- Game Version the version id that the game is running. Currently 1.
- Mod Name Your Mod Name
-
Mod Version The Version of Your Mod (Example:
1.0.0
) -
Main Class Your Main Mod Class You Created in Step: 2.1 (Example:
imdaveead.someclicker.examplemod.ExampleMod
)
To Install your mod to the game, navigate to %appdata%/WeAreDevs/someclicker/mods/
by pressing the Windows Key + R. and typing %appdata%
, navigating to the WeAreDevs/someclicker/mods/
folder and place your jar file there. The game will handle the rest of it.