Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Strive for Power

Fantasy Slave Management/RPG Erotic Game · By Strive4Power

Adding new items or images

A topic by Gatreex created Jun 01, 2022 Views: 2,710 Replies: 14
Viewing posts 1 to 3

For me to add new races via notepad++ and to add new portraits is not enaugh,i want to add new items or to replace the old ones,i am a amateur in modding so i think is understandable that i tried  to copy paste and replace the item icons with  some images from google...but at least i know somehow without answers that the format is the problem...i am no coder but i can almost sense it that the icons were coded or created in a specific program so i am asking you:Which program or how i can make them?or at least if there is any way to create some compatible images with the game interface.I want to be clear,i just want to add the images and to create similar items or to replace the old ones  with more or less  damage for the sake of novelty,not to create some brand new items with new fancy effects,if you think is just too complicated for me just let me know,sorry if i am not gramataticaly correct i am from a tier 3 european country and english is not even close to be official here.

In file items.gd, there is a description like this

    weapondagger = {

        code = 'weapondagger',

        name = 'Dagger',

        icon = "res://files/images/items/weapondagger.png",

        description = "A simple weapon providing bare minimum of physical power. ",

        effect = [{type = 'incombat', effect = 'damage', effectvalue = 4, descript = "+4 Damage"}],

        recipe = '',

        reqs = null,

        cost = 50,

        type = 'gear',

        subtype = 'weapon',

        weight = 5,

        amount = 0,

    },

Change this icon statement to a path like

icon = globals.modfolder + "/Gatreex/Images/dagger.png",

(2 edits)

(1 edit)

something is still wrong

(1 edit)

Leo has assumed that you have quite a bit of experience with coding/modding and has over-simplified his explanation. If you have 64 bit Windows, then I recommend using the Debug mod(https://itch.io/t/1137280/debugmod-v1) to give you some better feedback from mistakes made when editing files, in the form of a second window that opens with the game. It won't help with every problem, but it will often give error messages with line numbers for typos rather than crashing.


File paths can be created in a few ways. The game engine, Godot, provides two basic paths "res://", which is the program folder "Strive for Power", and "user://", which is your appdata folder "%appdata%/Strive" (this folder is hidden by Windows by default, so you may have trouble finding it). Strive creates additional paths in "Strive for Power/files/globals.gd", which can be accessed using "globals." followed by a file-scoped variable name (a variable created with no tabs before it).

"globals.modfolder.gd" is defaultly equivalent to "user://mods/" or "%appdata%/Strive/mods/", thus the full path Leo gave was "%appdata%/Strive/mods/Gatreex/Images/dagger.png". This is the old style for specifying paths for mod files. Leo likely presumed that you were creating a shareable mod since you posted in the Mods section. If you are simply creating stuff for yourself and wanted to use the program folder, then the path would be "res://Gatreex/Images" and you would just move your "Gatreex" folder into the "Strive for Power" folder (then delete the "globals.modfolder +" folder).


For non-gear weapons, the paths will look like 

icon = load("res://files/images/items/food.png"),

The load function will only work for images that have been imported by the Godot editor. There are several ways around this. My preferred approach is to change the order of loading files, which will allow the use of globals.loadimage() instead of load(). In globals.gd simply change

var items = load("res://files/scripts/items.gd").new()
var itemdict = items.itemlist

to

onready var items = load("res://files/scripts/items.gd").new()
onready var itemdict = items.itemlist

Due to the complexity of the file load order, this does not work for every file, but I have tested it with the items.

Thanks for the info,yes i have 64 bit ver,%appdata% at least is easy xd ,i have just to type it in the windows search bar..amateur means amateur,all i did in the past was copy paste and changing things a little bit,races was easy to add or at least their names and where you find them,for what price is sold,etc like i didn t do much,i will try everything you sugested  but tomorrow,is 1 AM here.

(1 edit)

Main Menu -> Mods -> Open Mod Folder sets globals.modfolder
icon = globals.modfolder + "/Gatreex/Images/dagger.png",

(1 edit)

oh so what i wanted was really a mod,i didn t understand,i believed that i can do it without activating any mod with just copy and paste in notepad++,i played before just with the random portrait mod,i know where to find that folder,thanks

You don't need a mod. In my example I used the mod directory for the image path. That's all. (I was trying to use less English words)

i get it,i will find it in %appdata% roaming,i have another question,i am working on making a portrait pack and i wonder where i should post it after i finish,the Mods section is fine or not?

https://itch.io/board/252654/portarits-packs.

There is a portrait packs section as well as a mods section.

thanks i will check it out,is this slightly better?XD



The Debug mod is not applied through the mod system. It is a manual patch.

Also, beware changing which mods are applied as every time you apply the changes you will reset all of the scripts in the Strive program folder.

I recommend not using "%appdata%" in paths as it is not compatible with all OS and computers. If it's only for you then there may not be problems, but "user://mods" will be more broadly compatible.

The game has a guide that explains how the mod system works, which is found in the Help section of the Mods menu. There is also a slightly outdated copy of the guide in the wiki.

(1 edit)

''Also, beware changing which mods are applied as every time you apply the changes you will reset all of the scripts in the Strive program folder.'',yes i observed this,ok so no %appdata% in the path and i will see  both guides