Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Adding your own equipment, enemies & characters Sticky Locked

A topic by TheMysticSword created Apr 19, 2019 Views: 510
This topic is locked
Viewing posts 1 to 2
(12 edits)

- Getting started -

To add your own things in Dicey Wastelands, you need to use CSV files. Currently you can add custom equipment, enemies and characters.

Create a folder in the "mods" folder of Dicey Wastelands and give it a name. This will be the name of your mod.

- Equipment -

Create a new file in your mod folder and call it "equipment.csv". Copy and paste the header of the "equipment.csv" from the Dicey Wastelands folder:

Name,Description Line 1,Description Line 2,Size,Floor,Script: On Use,Script: Init Variables,Script: Begin Turn,Script: End Turn,Slots,Countdown,Color,On Upgrade,On Weaken,Cast Direction,Uses,Single use

Equipment has 15 fields and can be heavily customized:

  • Name - equipment name (displayed at the top of the card). Supports color tags.
  • Description Line 1 - the first line of equipment description (displayed below the dice slots). Supports color tags.
  • Description Line 2 - the second line of equipment description (displayed below the dice slots). Supports color tags.
  • Size - the equipment size (either 1 or 2).
  • Floor - the floor on which you can find this item (set to -1 if it isn't supposed to be found in chests or level-ups)
  • Script: On Use - a pipe-separated ( | ) list of commands (strings) that are executed on use. Read more about scripts in the Scripts section.
  • Script: Init Variables - a pipe-separated list ( | ) of commands (strings) that are executed outside of combat to initiate variables. Shouldn't contain commands other than "var".
  • Slots - a pipe-separated ( | ) list of the dice slots (displayed in the middle of the card).
    Slot nameDescription
    NORMALTakes any dice.
    EVENTakes dice with an even value.
    ODDTakes dice with an odd value.
    REQUIRE1Takes only 1s.
    REQUIRE2Takes only 2s.
    REQUIRE3Takes only 3s.
    REQUIRE4Takes only 4s.
    REQUIRE5Takes only 5s.
    REQUIRE6Takes only 6s.
    MAX2Takes dice with a value equal or below 2.
    MAX3Takes dice with a value equal or below 3.
    MAX4Takes dice with a value equal or below 4.
    MAX5Takes dice with a value equal or below 5.
    MIN2Takes dice with a value equal or above 2.
    MIN3Takes dice with a value equal or above 3.
    MIN4Takes dice with a value equal or above 4.
    MIN5Takes dice with a value equal or above 5.
    COUNTDOWNTakes any dice, but activates only if the countdown reaches zero.
    DOUBLESTakes any dice, but activates only if the dice values in both DOUBLES slots are equal.
    CLICKTakes no dice, activates on click.
  • Countdown - the amount of dice pips required to activate the item. Required for COUNTDOWN slots.
  • Color - the color of the card. Can be RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE, GRAY or RAINBOW.
  • On Upgrade - what should happen if this item is upgraded.
    ValueDescription
    simplifyMakes the dice slots less restrictive (for example, EVEN > NORMAL).
    adduseGives an additional use to the equipment.
    upgradeChanges the equipment to its upgraded version, which is a different piece of equipment with the same name and "_upgraded" appended to it (Revolver > Revolver_upgraded).
    reducecountdownReduces the base countdown value by 50%.
  • On Weaken - what should happen if this item is weakened.
    ValueDescription
    complicateMakes the dice slots more restrictive (for example, NORMAL > EVEN).
    noreuseableSets the equipment uses to one.
    downgradeChanges the equipment to its downgraded version, which is a different piece of equipment with the same name and "_downgraded" appended to it (Slugger > Slugger_downgraded).
    noeffectRemoves all commands from the equipment.
    immuneMakes the item immune to weakening.
  • Cast Direction - the direction of movement when equipment is used (1 for up, -1 for down).
  • Uses - the amount of uses per turn (-1 for reuseable, 0 for one).
  • Single use - whether this item should be used only once per battle (0 for false, 1 for true).
Name,Description Line 1,Description Line 2,Size,Floor,Script: On Use,Script: Init Variables,Script: Begin Turn,Script: End Turn,Slots,Countdown,Color,On Upgrade,On Weaken,Cast Direction,Uses,Single use
Gamer Time,+<gamertime> to next,attack for both,2,-1,inflict:BUFF&@gamertime|inflictself:BUFF&@gamertime|sfx:sndMutant16LowA|varadd:gamertime&1,var:gamertime&3,,,COUNTDOWN,8,GRAY,,,1,0,0
Lucky Cake,Heal 5 hp,to someone,2,-1,callifelse:heal;5&healself;5&rd&1&3|sfx:sndSharpTeeth,,,,CLICK,,GREEN,upgrade,downgrade,1,0,0
Lucky Cake_upgraded,Heal 5 hp to you,Heal 2 hp to enemy,2,-1,healself:5|heal:2|sfx:sndSharpTeeth,,,,CLICK,,GREEN,,,1,0,0
Lucky Cake_downgraded,Heal 2 hp to you,Heal 5 hp to enemy,2,-1,healself:2|heal:5|sfx:sndSharpTeeth,,,,CLICK,,GREEN,,,1,0,0
Broken Watch,Skip an enemy turn,@s(Once per battle)@w,1,-1,inflict:SKIP&1|sfx:sndWeirdTickTock&dw_examplemod,,,,COUNTDOWN,24,PURPLE,reducecountdown,noeffect,1,0,1
Sharp Screw,Do 2x[] damage,@s(Reuseable)@w,1,-1,var:screw&d|varmult:screw&2|attack:@screw|sfx:sndScrewdriver,,,,DOUBLES|DOUBLES,,RED,simplify,noeffect,1,-1,0

- Enemies -

Create a new file in your mod folder and call it "enemies.csv". Copy and paste the header of the "enemies.csv" from the Dicey Wastelands folder:

Name,Level,Rarity,Sprite,Voice,HP,Dice,Equipment,Last Words,Attributes

Enemies have 10 fields:

  • Name - the name of the enemy.
  • Level - the level of the enemy (defines the experience reward and the spawn floor).
  • Rarity - defines how rare this enemy is (if rarity is 5, the chance of this enemy appearing is 1/5).
  • Sprite - the enemy sprite. Only the first two frames are shown outside of combat.
  • Voice - the sound that is played when the enemy says their last words.
  • HP - starting health.
  • Dice - starting dice.
  • Equipment - a pipe-separeted list of the enemy's starting equipment.
  • Last Words - the enemy will sometimes say those when defeated. You can use underscores ("_") to add pauses.
  • Attributes - a pipe-separated list of the enemy's attributes.
    AttributeDescription
    poisonstrongTakes 0.5x damage from poison.
    poisonhealHeals from poison.
    poisonimmuneTakes no damage from poison.
    burnweakTakes 2x damage from picking burning dice.
    burnstrongTakes 0.5x damage from picking burning dice.
    burnhealHeals from picking burning dice.
    burnimmuneTakes no damage from picking burning dice.
    stunimmuneEquipment can't be stunned.
    weakenimmuneEquipment can't be weakened.
    getdiceGets +1 dice every turn.
    ignoreloopsDoesn't get loop buffs (extra health and dice).
    noworldanimDoesn't have animation outside of combat (shows only the first frame of the sprite).
    noworldpreviewDoesn't show its name and level when hovered.
    customspriteHas a custom sprite instead of a vanilla one (takes 3 arguments: mod type, mod name, sprite variable).
    shakyequipmentCauses enemy equipment cards to shake.
Name,Level,Rarity,Sprite,Voice,HP,Dice,Equipment,Last Words,Attributes
Angry Screwdriver,2,-1,sprScrewDriver,sndScrewdriver,20,1,Screwdriver:0&0|Screwdriver:1&0|Screw:0&1|Screwdriver:1&1|Screwdriver:0&2|Screwdriver:1&2,SHANK SHANK ___SHANK,

- Characters -

Custom characters should be created in their ".race.gml" file. They have several fields:

  • displayname - the displayed name of your character.
  • skillcards - an array of the character's skillcards (they usually have gray color). You can have two skillcards at the same time by making .them take up one slot and setting their "row" value to 0 and 1 respectively.
  • equipment - an array of the character's starting equipment. If left blank, the character starts with a Revolver.
  • inventory - an array of the character's starting inventory.
  • maxhealth - the maximum amount of health the character has from the start.
  • dice - starting dice.
  • gold - starting gold.
  • combatdisplay_sprite - an array consisting of two values - the portrait sprite of the character and the subimage (frame).
#define diceywastelands_race()
return {
    displayname: "Cuz",
    skillcards: [{
        name: "Gamer Time",
        row: 0
    }],
    equipment: [],
    inventory: [],
    maxhealth: 24,
    dice: 2,
    gold: 3,
    combatdisplay_sprite: [mskNone, 0]
};

- Scripts -

Scripts follow this syntax: "command1:arg1&arg2&arg3...|command2:arg1&arg2&arg3...".

CommandArgumentsDescription
attackamount of damageDeals damage to the opponent.
attackpierceamount of damageDeals damage to the opponent, ignoring status effects.
attackselfamount of damageDeals damage to the user, takes shield and armor into consideration.
attackpierceselfamount of damageDeals damage to the user, ignoring status effects.
recoilamount of damageDeals damage to the user, takes shield into consideration.
healamount of healthHeals the opponent.
healselfamount of healthHeals the user.
sfxsound index, (optional) mod namePlays the sound (if the mod name is defined, it plays a sound from that mod).
inflictstatus name (or "RANDOM")Inflicts the status effect on the opponent.
inflictselfstatus name (or "RANDOM")Inflicts the status effect on the user.
givedicedice valueGives a new dice with this value.
splitdicedice value, amount of new diceRandomly splits the dice value and gives new dice.
giveeqequipment nameReplaces this equipment with another one for this turn.
giveeqtargetequipment nameGives the opponent an item in the bottom middle slot for one turn.
replaceeqequipment nameReplaces this equipment with another one for this battle.
stealgoldamount of goldTakes this amount of gold from the opponent and gives it to the user.
reducegoldamount of goldReduces this amount of gold from the opponent.
reducegoldselfamount of goldReduces this amount of gold from the user.
varvariable name, valueDeclares a variable under this name (if it doesn't exist yet) and sets its' value.
varaddvariable name, valueAdds this value to the variable value.
vartakevariable name, valueSubtracts this value from the variable value.
varmultvariable name, valueMultiplies the variable value by this value.
vardivvariable name, valueDivides the variable value by this value.
rdvarvariable nameSets this variable's value to a random number from 1 to 6.
expdischarge-Sets the player's experience charge to 0 (used in Horror's Rad Beam).
destroydiceamount of diceDestroys this amount of remaining dice.
callifelsescript 1, script 2, value, min, maxCalls script 1 if the value is between the min and max numbers, otherwise calls script 2. Scripts here use ";" instead of ":"; "?" instead of "&"; "/" instead of "|" (/ is used for separating multiple commands in a script).
alldicenew valueSets the value of all remaining dice to this.
fleeturnsFlee from the battle in X turns. Enemies will choose this only if it has 20% health or less.
halfdice-Returns half of the dice value that you input.

You can also add these commands to change the way the enemy AI uses equipment:

CommandArgumentsDescription
bonusamount of pointsGives bonus points to this equipment. More points means that the AI is more likely to use this item.
ignoredeath-Sets the amount of points to 1 if the enemy is supposed to die when using this item.
playlast-Sets the amount of points to 1 so the enemy always uses it after all items are used.

You can pass special arguments to the commands:

ArgumentReal value
dtotal sum of the dice pips of all dice in this item.
rda random number from 1 to 6.
@variablenamethe variable value (if it exists).
$statusnamethe amount of this status effect on the enemy.
expchargeHorror's Radiation Beam charge.
hpthe user's health.
targethpthe opponent's health.
maxhpthe user's max health.
targetmaxhpthe opponent's max health.
dicethe user's dice.
targetdicethe opponent's dice.
goldthe user's gold.
targetgoldthe opponent's gold.
remainingdicethe amount of remaining dice.
moved this topic to Modding