GithubHelp home page GithubHelp logo

gremious / sts-defaultmodbase Goto Github PK

View Code? Open in Web Editor NEW
112.0 3.0 61.0 35.33 MB

(DON'T USE THIS AND BASEMOD IF YOU'RE NEW TO MODDING) This is a minimal, over-commented, "default clean slate" for jump-starting Slay the spire mods.

License: MIT License

Java 100.00%
slaythespire slaythespire-mod hacktoberfest

sts-defaultmodbase's Introduction

The Default Mod is now out of date.

(rest in peace, soldier)

Please use the following instead:

https://github.com/Alchyr/BasicMod#basic-mod -- Has a complete guide on how to setup a character and walks you throuigh the basics

https://github.com/DarkVexon/ProTemplate -- As extra features and QoL for people familiar with modding StS

https://github.com/nightbug/LaunchPad -- Minimalist template for mods that arent characters

It's a good game. Have fun :)


StS-Default Mod Base

Welcome to this extremely over-commented Slay the Spire modding base.

This is a minimal "default clean slate" for creating Slay the spire mods.

Use it to make your own mod of any type - If you want to add any standard in-game content (character, cards, relics, events, etc.), this is a good starting point.

It features 1 character (the Default) with a minimal set of things: 1 card of each type, 1 debuff, 1 relic, etc.

If you're new to modding, you basically need the BaseMod wiki for whatever you wish to add, and you can work your way thought it with this base. Another very important thing is to look at other mods (get them from their github!), as well as the base-game code, and see how they do things.

https://github.com/daviscook477/BaseMod/wiki

This base itself isn't going to help you code or anything!! Nor does it provide basic Java learning - if you need that go through the codeacademy free java course! While I have been putting comments about what does what, this is just a nice starting point if you need a place to start learning from that's not an absolute empty canvas, or an overly-complicated, difficult to understand mod. But you still need to learn how the in-game code works and how to piece things together on your own. (i.e. this base will show you where to put the code for double-tap, but not what it is/how to write it. Look up the actual cards and backward-engineer them for that.)

Feel free to use this in any way you like, of course.

If you have any issues or you want to recommend and/or add something to the mod that you feel would be helpful, feel free to submit an issue or a PR!

Happy modding!


Check the wiki to get started:

https://github.com/Gremious/StS-DefaultModBase/wiki


Know what you're doing?

Hop on over to the Quick Start branch. It's a fully cloneable, uncommented version of the Default ready for jump-starting a brand new mod!


Some HD Slay the Spire art assets:

Includes:

  • Empty Relic Template feat. empty bottle
  • Empty Card Template
  • Color-Changable cardback
  • A couple of HD Monster vectors (Louse, Nob, Sentry, Sneaky Gremlin)
  • A coupe of HD items (J.A.X., A Coin)
  • 2 people silhouettes
  • A curse Background

https://mega.nz/#F!gfpgTCyK!2oFOjVFKyOreKv7zdY1fEQ

(If you want to contribute to this collection feel free to send me a message through #modding or a github issue.)


sts-defaultmodbase's People

Contributors

alexdriedger avatar amethystproductions avatar ascriptmaster avatar bug-sniper avatar darkvexon avatar gremious avatar hundun000 avatar hyvel avatar kiooeht avatar nafenx avatar reinashsl avatar thepotatomancer avatar torrentails avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sts-defaultmodbase's Issues

Cannot Generate Repository From Template Due to File Size

Because there are two files in the repository over 10MB in size, GitHub refuses to create repositories based on this template.

The files in question are:

  • theDefault/src/main/resources/theDefaultResources/images/charSelect/PortraitBG.psd (10.4 MB)
  • theDefault/src/main/resources/theDefaultResources/images/events/Events.psd (15.9 MB)

Obviously we can still create mods by downloading the source directly, but if these file sizes were reduced somehow that would be cool

Character Code Doesn't Work Out of the Box

Only changing what I needed to (the name and ID of the mod) I can't get the character to work. The game launches, but when I try to start the game as "The Default" character I get a crash that looks like
00:31:09.162 INFO core.CardCrawlGame> Exception occurred in CardCrawlGame render method! 00:31:09.163 ERROR core.CardCrawlGame> Exception caught java.lang.NullPointerException at com.megacrit.cardcrawl.characters.AbstractPlayer.initializeStarterDeck(AbstractPlayer.java:450) at com.megacrit.cardcrawl.dungeons.AbstractDungeon.<init>(AbstractDungeon.java:362) at com.megacrit.cardcrawl.dungeons.Exordium.<init>(Exordium.java:50) at com.megacrit.cardcrawl.core.CardCrawlGame.getDungeon(CardCrawlGame.java:1379) at com.megacrit.cardcrawl.core.CardCrawlGame.update(CardCrawlGame.java:861) at com.megacrit.cardcrawl.core.CardCrawlGame.render(CardCrawlGame.java:419) at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:225) at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:126)

I've attempted to add stack tracing, but the whole character seems to load fine, until I hit "play game". The only mods I have installed are: My Mod, StSLib, Basemod, and Mod the Spire. This issue is working under the assumption that the default character is supposed to work with no changes.

Idea: remove name and description parameters from AbstractDefaultCard constructor

In AbstractDefaultCard's source code, the constructor starts with:
public AbstractDefaultCard(final String id, final String name, final String img, final int cost, final String rawDescription, final CardType type, final CardColor color, final CardRarity rarity, final CardTarget target) { super(id, name, img, cost, rawDescription, type, color, rarity, target); super(id, name, img, cost, rawDescription, type, color, rarity, target);

To make hardcoding the name and description a more difficult and less tempting course of action, I propose we do that following:

  • Copy the class currently named AbstractDefaultCard to AbstractDynamicCard
  • Delete the dynamic variables and related methods from AbstractDefaultCard
  • Delete the name and rawDescription parameters from AbstractDefaultCard's ctor's declaration.
  • In the super call replace name and rawDescription with CardCrawlGame.languagePack.getCardStrings(id).NAME and CardCrawlGame.languagePack.getCardStrings(id).DESCRIPTION.
  • Turn all cards into child classes that extend AbstractDefaultCard. If they already did, make them extend AbstractDynamicCard instead.
  • Delete the text declaration code below from all cards, and delete the now-undefined ctor parameters
    public static final String ID = DefaultMod.makeID("DefaultCommonAttack");
    private static final CardStrings cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);

    public static final String NAME = cardStrings.NAME;
    public static final String DESCRIPTION = cardStrings.DESCRIPTION;

This idea synergizes with #34 in nudging people to check the jsons for any name or description-related errors.

Character Encoding in POM

I think it would be good to specify the character encoding in the POM.xml.

Only characters from UTF-8 should be used anyway..,
so problematic characters are ignored even if they are used.

And the warning is just annoying...

Character animations not working?

I see that there are files for a cultist looking character:
skeleton

But I only see this question mark thing that until now I assume it was how the default was supposed to look:
Screenshot from 2024-02-25 22-50-21

Is it supposed to look like this or like the cultist?
If it's supposed to look like a cultist, could you share a working example? (full code)

Thank you!

Include info for Mac users in Wiki and/or comments

tl;dr Help out Mac users please :)

I'm moving through the Wiki to try modding, and there's a few tweaks for Mac users in the Adding Dependencies

  • For the Steam.path, mac users should look in /Users/{yourUser}/Library/Application Support/Steam/steamapps/
  • All the systemPath values for the modthespire, basemod, and StSLib worked correctly
  • For desktop-1.0.jar, the path provided won't work. On mac, everything's bundled in SlayTheSpire.app. If you right click that file in finder and select "Show Package Contents", you can see there's a buncha stuff within the app. The path for mac users should be ${Steam.path}/common/SlayTheSpire/SlayTheSpire.app/Contents/Resources/desktop-1.0.jar
  • For the package configuration, the tofile in needs to be in the Resources/mods folder: <copy file="target/${project.artifactId}.jar" tofile="${Steam.path}/common/SlayTheSpire/SlayTheSpire.app/Contents/Resources/mods/${project.artifactId}.jar"/>

The above could be added as additional notes in the wiki page linked above, or perhaps as commented out lines like the local ../lib/ paths are

Edit: Found another one that maybe is clear and I just didn't get it. In the Setting up debugging step, the "intstall directory" is also buried in the .app folder. I had to set it to pathToSteam/common/SlayTheSpire/SlayTheSpire.app/Contents/Resources, as that had the jre/bin/java path in it that MtS needs to run.

Add groupId to modid (ModInfo)

To avoid duplicate mod ids, it would be good to include the groupId in it.
"modid": "${project.groupId}:${project.artifactId}",

Old version:
"modid": "${project.artifactId}",

Out of Date

This "default" mod was last updated 3 years ago and is VERY outdated. There are other StS mod templates and full guides that are currently maintained and up-to-date, as a part of the modding community we see lots of people landing here on this "default" mod and have lots of troubles. It would be nice if you could re-write some of your README at the very least to make it clear this is out of date and perhaps point towards some of the up-to-date guides see:

https://github.com/Alchyr/BasicMod#basic-mod -- Has a complete guide on how to setup a character and walks you throuigh the basics
https://github.com/DarkVexon/ProTemplate -- As extra features and QoL for people familiar with modding StS
https://github.com/nightbug/LaunchPad -- Minimalist template for mods that arent characters

Bug: Multiword keywords not marked up

Add thedefault:multikey or thedefault:multi keyword or thedefault:multi_keyword to a card's description in the json like how the other mods do it. Expect it to show up in yellow and with a keyword tip popping out. Instead, the description is rendered like this screenshot:
image

Idea: Put troubleshooting guide in wiki

To hopefully reduce the number of people asking how they messed up in getting code coming from the DefaultModBase, I would like to propose starting a wiki with a page about troubleshooting common problems. It can include advice on

*opening up the jar with 7-Zip to make sure the json and other resources are the most current
*making sure the source code has no compilation problems before it's jarred
*running the code through a debugger if the above don't work

Idea: Generate ID from class name

It was suggested in the discord discussions that perhaps we should generate IDs using getClass().getSimpleName(). For example,
public static final String ID = DefaultMod.makeID("DefaultCommonAttack");
would become
public static final String ID = DefaultMod.makeID(getClass().getSimpleName());.

The benefits of doing this are:

  • It's less tempting for people to change a component and hardcode it if it looks like there's only one choice
  • Less typing if someone wants to rename both the class and the ID
  • One less area for people to mod developers to look for problems in

I can't think of much of a drawback, unless someone wants a card to not have its classname as its ID like Claw or wants to change how classes are alphabetically sorted. Or possibly, someone may jump off the rails and give up on using DefaultBaseMod altogether, but that sounds unlikely for newcomers already looking for a starting point.

This idea synergises with a later idea I plan to post here involving reading and setting the description only in the abstract superclasses.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.