Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs

Strive for Power

Fantasy Slave Management/RPG Erotic Game · By Strive4Power

Modding help Sticky

A topic by Strive4Power created Aug 20, 2018 Views: 9,167 Replies: 49
Viewing posts 1 to 15
(+1)

For the basics of modding, refer to the Modding Guide. If you have any questions or need help, use this topic. 

(1 edit)

Anyone have any clue why this doesn't work? I've got this in "mods/modname/scripts/characters/races.gd", but it doesn't seem to be doing anything.

https://pastebin.com/1swUp609

(+2)

What do you mean by "doesn't seem to be doing anything."  Have you looked at races.gd after applying?

If that's all the mod does, i don't see it actually having any impact on the game whatsoever.  Nothing iterates over all races. Even if you added those 2 races here, currently you'd need to also modify a bunch of other code for them to actually be used anywhere.
 Particularly all the races arrays in globals.gd, like say adding them to:

var starting_pc_races = ['Human', 'Elf', 'Dark Elf', 'Orc', 'Demon', 'Beastkin Cat', 'Beastkin Wolf', 'Beastkin Fox', 'Halfkin Cat', 'Halfkin Wolf', 'Halfkin Fox', 'Taurus']

Ah yes, I should have clarified. By "not do anything", I mean it doesn't modify the "races" variable once applied.

(3 edits) (+1)

Noticed the problem, I had same issue on new files i made. Tabs vs. spaces,  the game uses tabs for indentation and the mod code all expects tabs. You need to convert all those spaces to tabs, then it should work.

Edit: It's more than that, testing out more.  The mod code expects all following lines to begin with a tab too, so the "Race One" and "Race two" need to be indented.  However, even with that, using a regex tester it doesn't match the regex the game is using for variables.

Edit2: The game's regex for variables does not support this far as I can tell,

(var.*=)\s([{]([^\{\}]*[\r\n]*)*[}])?([^\{\}\s]*)

That won't match anything with nested {}'s which are required for adding a race.  You could work around this by defining your own races, and then appending them to the official ones during startup of the game? Otherwise, we'll need a new version that supports this. Basically that chunk of code needs to be amended to also accept a form where it's "var blah = {" followed by a series of lines starting with tab, and then ending with a }, similar to what it does for functions.

To work around this, instead of modifying races.gd, add your own file that defines those 2 races, then do something like this for scripts/globals.gd

https://pastebin.com/g1bwycdJ

It's possible to mod the mod system, to change that regular expression to something that would work better.

I wasn't very familiar with Godot syntax when I wrote that regular expression.  I had to look up multi-line variables, and was not aware at the time that a dictionary with multiple values could be declared on a single line, and I couldn't even find an example of a static multi-dimensional array/dictionary and its declaration.


Regular expressions are... difficult to get right.

Having said that,

what is a regex tester and where can I find one?

Haha yeah... I tried to tweak the regex to get it working right, but bit burned out on coding from work to finish.  I typically use a site like www.regex101.com so I can visually see how it's matching to a set of text.  Can then stick in a variety of test cases and see how it responds.  I was able to tweak it to accept:

var blah = {
<tab indented text>
}

But the solution wouldn't have worked for single lines.  Likely could have made it work with some more groupings and or operators.  I used that site earlier to figure out why some of my code wasn't working, as in my own mod,it also fails on:

var randomportraits = load(globals.modfolder + "/randomportraits/randomportraits.gd").new()

Because it only matches on
var randomportraits = load(globals.modfolder
and inserts that into the file, breaking the game.  Thus, i did var blah = null, and then conditionally load it first time i need it.

(1 edit) (+1)

The mod can't add a "races" variable, because that variable already exists in the script, so either they conflict (and the mod is not applied) or the one from the mod is overwritten.
Btw, can you define a variable before the "extends Node" statement?
I suggest to remove line 2 and 19 from the mod and insert the code after line 359 of races.gd, so that the new two races are pushed at the end of the existing list (the mod should start with <AddTo 358> or something like that, the number may be slightly wrong)

Also what Kyler2 said.

http://strive4power.wikia.com/wiki/Modding_Guide

I know about the conflict, but my understanding is that the <AddTo -1> tag should resolve it by modifying the object alone. I already sent this off to Maverik, and he didn't seem to find a problem with my reasoning but recommended that I post here to see if anyone could find something he missed.

<AddTo ...> is based off insertion point, not total line number.

<AddTo 2>

func testfunc: ....

....


Will add to line 2 of testfunc, not line 2 of the file.

For base files, you cannot define anything before the "extends Node" statement.  Godot requires all files to begin with that.  (Or begin with extending a subclass of Node)

I'm also working on adding races. Seeing as KuraPanda is restructuring some of the scripts to be more easily mod-able (I think), would it be wise to wait until that has happened, before trying to mod in a new race?

I just downloaded Strive for Power recently and I wanted to mod it to add portraits and whatnot, make it more lively but the Zip I extracted doesnt have a mods folder, and all Zips I download don't have a mods folder in them either, I was wondering how I would go about fixing this problem. 

Did you read the mod guide at the top? There is no mods folder in the game, and the mods folder the game does use, does not exist by default.  Per the guide:

> Download and put the mods in the mod folder (%APPDATA%\Strive\mods)

That means you need to make that folder yourself, and extract the mod(s) there. Similar for bodies and portraits folders.

(3 edits)

So I made it in the same place the .exe is for Strive, is that right? Wait, portaits and body mods dont go in this folder im making? Where do I put THOSE? I wish the directions were more fleshed out. Thank you for dealing with my incompetence. 

This picture might help explain the folders part a bit. Hope this helps...
https://mega.nz/#!qRpBAARb!5emCMX28BOqGTFpxqUlos1pNkf4Ww0xZJRkC84weBWc (Link will expire in about 2 weeks to save space on my account >_<)

I dont think you guys have the same Zip file folder I do when I download Strive, I dont know if the donator version is different but I saw how you guys have your files all formatted and mines totally different and super sloppy.

To re-iterate, NO it does NOT go in the same place the .exe is for strive.

Hit the windows key plus R to open the run dialog, paste in this:

%APPDATA%\Strive

That opens the game's data folder, it's in a completely separate place from where the Strive.exe file is. It's where your saves are stored. You should see a saves sub folder, as well as progressdata and settings.ini files.

This is where you make a mods folder and place mods. and what fusiontech45's image is a screenshot of. It is also where the Portraits and Bodies folders go.

(1 edit)

There is no %appdata%/strive because im downloading a zip file, and the zip file is on my desktop, theres nothing in that appdata folder related to strive, the only thing in my %appdata% folder is a Local file and in that Local file it goes to a Microsoft folder and theres nothing in the Microsoft folder. :/

(2 edits)

Or, a nice simple .bat file.  Double click this file and it will create and open the Strive for Power mod directory.

http://www.mediafire.com/file/n6nk6uep54624ja/Create_And_Open_Strive_Mods.bat/fi...

For the properly paranoid, you can type the following two lines in the command prompt.

mkdir %APPDATA%\Strive\mods
start %APPDATA%\Strive\mods

I'm not sure if it works with Mac, but it's just Bash.

Probably needs quotes, otherwise it'll break if the user has spaces in their name. Also "start" on my computer, starts another command prompt. Maybe it works better elsewhere, but if I replace start with explorer, then an explorer window opens.

mkdir "%APPDATA%\Strive\mods"
explorer "%APPDATA%\Strive\mods"
(1 edit)

Ah, the minor variations in computers that break compatibility.

Crazy, that.

It obviously looks like modding isnt supported fully otherwise it wouldnt be this complex. When modding because less of a wild goose chase of file searching I'll get into it but this is just ridiculous, I just want to add some portraits so the game doesnt feel so bland.

Set your folders to display hidden files, then go into the game and click 'open folder' in either save/load menu, or portrait selection menu. 

http://www.mediafire.com/file/qig2s3fpmawnqrg/Strive%20Mods%20Folder.bat


This newly revised .bat file will open (and create, if necessary) the mods folder for Strive.

We're really trying here.

(1 edit)

Wondering if next version of game, the "open mod folder" button could be updated to create the folder if it's missing?

Edit: I also found that the button doesn't even work, as it tries to run OS.shell_open with the user:// path, and that function doesn't auto-resolve the user:// part, it wants an absolute path on the system, did the following:

func _on_openmodfolder_pressed():
var dir = Directory.new()
dir.open("user://")
dir.make_dir("mods")
OS.shell_open(modfolder.replace("user:/", OS.get_user_data_dir()))

(3 edits)

I some how got it to run the bat file, now what do I do? the .exe is still on my desktop so its not going to see this file thats 1000 folders away, cus I already put the portrait mods and what not in it and the game couldnt find it :/

Edit: Im trying too, I really just want to enjoy this game but this is just so frustrating for me

Screenshots of what you're seeing/doing would help immensely. One of yo ulooking at the "%appdata%\Strive" folder, and maybe the contents of the mods folder.  Plus maybe one of the game with the mods panel open.

The game can trivially find this folder, it asks windows where the user's app data folder is, windows tells it, it then looks in the Strive sub folder. Doesn't matter where the game's exe is.  You might have modified the folder it uses for the mod or portraits. In which case it might be looking somewhere else.  We've been working off what the default folders are, but they can be changed.

(2 edits)

All I did was download the file onto my desktop, then extracted it into a folder also on my desktop called strive. From there theres so much in the folder I have no clue whats what except the .exe I use to run the game.

Edit: I ran the .bat and im now waiting for more instructions because this is honestly so confusing and convoluted, the way it was put made it seem much MUCH simpler than this "Put the mods in the mods folder then run the game and activate the mods" But the zip file doesnt have a mods folder so... ugh. I dont know how you expect me to get to this hidden folder so often to mod the game, its so out of the way and inconvenient. It takes me literally 4 minutes to find my way to the mods folder the bat file made

If your OS is Windows 10, the user folder is C:\Users\USERNAME\AppData\Roaming. The bolded word USERNAME is whatever user name you chose when you set up your device. In the Roaming folder is a folder named Strive. You need to create a folder named mods in the Strive folder. I created a shortcut on my desktop for the AppData  folder as several applications put saves and configuration files there.

If your OS is different than Windows 10 I can't help you.

I'm sorry, but this is not confusing or convoluted. It's fairly basic. It should take seconds to find the way to the mods folder the bat file made, open explorer, then paste this in the address bar and hit enter: %APPDATA%\Strive . I can't comprehend how that takes 4 minutes to find, unless it takes you 1 minute to move and click your mouse or press buttons on the keyboard for each action. We've been repeating this same thing over and over here. This %APPDATA% folder is also where a bunch of other game's data often end up, including save files. You'll want to get used to finding it, or understanding how to enter in paths like this in windows explorer.

At this point I'm not sure it makes sense to explain further, you don't seem to be capable of following directions, considering we've explained what goes in this folder before, but here I go:

It has a mods folder, then in that folder you extract the mod, the mod should have it's own folder, containing an info.txt file. Full path you end up with is:

%APPDATA%\Strive\mods\randomportraits\

and in there you'd see an info.txt file.

Then for portrait packs , their zip file usually contains the Bodies and Portraits folders. You want to copy those into the Strive folder, so you end up with:

%APPDATA%\Strive\Portraits\
%APPDATA%\Strive\Bodies\

One thing to note, itch's forums kinda suck for copy and pasting text. It often inserts random unicode characters. If those end up getting copied, then things might not work quite right. Did my best to try and avoid that with these. However if any of these don't behave right, try to delete characters before the % or after the \ that may be there, but hidden.

I'd hate to come back to this a literal month afterwards but I dont think the problem Im having can be explained on this platform easily. Is there another way I can contact one of you to help me, im sure it would only take 2 mins for me to figure it out, dumping text doesnt leave much back and forth to be had, since I cant convey my problem directly.

You should try  joining the discord server https://itch.io/t/284398/discord

is mod feateure in 519c broken?

I was able to apply my mod, randomportraits, fine.

However, modification of var is still broken.  Better regex i recommend is in there, but the code for AddTo is still broken, it's got .replacen("{", "").replacen("}", "") still so it breaks any nested {}'s by stripping them. This was broken in other versions in various ways though so i don't know anything new that is broken?

how to add class/var to globals.?

i mean with a new class or var to use it global with globals.newclass/globals.newvar
simple add the class/var to globals.gd dont work

(14 edits)

Hey all,

I've decided to give a shot at making a mod. I want to make a mod that adds a custom race to strive. Also, I could generalize it, so people can easily add their own races.

 

What I have so far:

A file which defines the new race. Located in …/roaming/strive/mods/ponyrace/newraces.gd

https://pastebin.com/5Zg9AwSR

An edited version of globals.gd which calls my races.gd mod and includes the new race in the race list. Located in /mods/ponyrace/globals.gd

https://pastebin.com/4Fc4LvCh

 (Note: these hyperlinks sometimes go to the wrong file. For correct the file, ensure the text above  matches the actual URL you land on. Edit 3: these pastebin links are kinda out of date. Use the project link in the next post).

Edit: just noticed the # comment mark in globals.gd. I therefore added the desired races inside \mods\ponyrace\scripts\variables.gd.


It doesn't work as intended:

After removing and adding all mods (including my mod, ponyrace), the pony race doesn't show up in game. Clearly, I'm not even close yet.


 

If anyone could point out what I'm doing wrong, that would be awesome. It someone who knows what they are doing can confirm that my code theoretically ought to work, that would also be helpful, because then I can go and look for missing comas or similar.

 

Thanks!

Edit 1:

Attempting to add the new race data inside will give a console error and crash the game. 

script error: parse error: unexpected assign. 

at: newraces.gd:2

where line 2 is the first like where I start defining the new race.


edit 2:

When I try to generate a new person, I see the new races available. However, when I click that option, a console error occurs. 

at /scripts/characters/constructor.gd:89

invalid get index 'beastkin pony' (on base: dictionary)

This error code makes me think 'beastkin pony' is not get registered everywhere correctly. But Three things I notice. 

  • 'Beastkin Pony' is indeed listed in \files\scripts\variables.gd
  • 'beastkin pony' is not listed in  \files\scripts\characters\races.gd
  • _init() is being changed  by my files in \mods\ponyrace\scripts\globals.gd. Console gives an error about unexpeted assign in newraces.gd: line 2.

Therefore, my edits have correctly updated variables.gd and globals.gd, but not races.gd or global.races.

It's late. Gotta sleep. Here's what I got so far. Help would be very nice.

https://dstu.itch.io/ponyrace

newraces.gd

var races = {
"Beastkin Pony" : {
...


globals.gd

#  newrace mod
<AddTo 0>
func _init():
    var newRaces = load(setfolders.mods + "/ponyRace/newraces.gd").new()
    for cur_race in newRaces.races:
        races[cur_race] = newRaces.races[cur_race]
var longtails = ['cat','fox','wolf','demon','dragon','scruffy','snake tail','racoon', 'horse']
var alltails = ['cat','fox','wolf','bunny','bird','demon','dragon','scruffy','snake tail','racoon', 'horse']

- global newRaces not necessary
- <AddTo -1> dont work
- newRaces is the file, races is the dictionary
- AddTo on vars also does not seem to work (but if it does: should be before each var and have only the additional content)
- penistypearray is the same as in original file

(1 edit)

Anyone know how to make change what races appear in each slaver guild? 

I can already get my custom race to appear in custom character creation and random encounters in the wilds.

Edit: Fount it. It's in /scripts/ outside.gd and explorationregios.gd

(1 edit)

Forgot to add support for negative numbers in the AddTo regex.

`
var tag_regex = "<(\\w*)(\\s+\\d+)?(\\s\\d+)?>"
`
should be
`
var tag_regex = "<(\\w*)(\\s+[0-9\\-]+)?(\\s[0-9\\-]+)?>"
`

Does anyone how to open the png.import files? If it's a compressed file, what do I need to unpack it?

They're encrypted.  They're not supposed to be opened.

You need the source code if you want the .png files.

Bummer. Alright, thanks for replying.

Hey, uh, I don't know where else I'd ask this, so... does anyone know if it's possible to have a futanari option for the player character in character creation, since you can have futanari characters in random encounters? Or maybe like, unlocked character customization, so one could play as, say, a dragonkin character with fur and equine parts? I imagine such features wouldn't suit everyone's playstyle, but I for one really enjoy it when a game lets you choose to "ignore the rules" and mess around. I have very little modding experience, though I'd be willing to learn; I want to be able to do that stuff eventually, but it can be pretty intimidating. What I mean by this is: I'm mostly curious as to whether it would be possible, and what it would entail. Please tell me if I'm doing anything wrong, socially; I'm awkward and don't know how to do stuff. Thanks in advance, and great game; I'm really enjoying it so far!

It's already possible to start the game as a futanari character.

Unlocked character customization would be a Big undertaking, almost too bothersome, you have something like that with the laboratory already, letting you add some mods and what not, so maybe an overhaul of the laboratory system would actually be easier to implement, but from the get go you would need to sink into the depths of coding in GDScript and trust me, takes time and patience. I myself am not even sure how I would even begin tackling that lol.

Is there documentation on aspects like specific properties/variable names, necessary directory structure, etc? I'm specifically thinking about doing some stuff from MacOS.

Follow up: I downloaded the Windows version of the game and see a lot of scripts aren't as packed up there, so I think I have more of a general idea of structure. However I'm still curious about some things. For example the "Faster pregnancies & growup" mod I have installed looks like it should work fine, but apparently doesn't. Have there been some changes in recent versions that might break things like var reassignment in scripts/variables.gd?

Mods currently do not work for MacOS as the mod system currently uses a crude text file parsing system(scripts/mods/modpanel.gd) to edit the files with matching relative paths.  It will not report any failures during the application of mods, nor warn of conflicts between mods.  Due to the fact that all the game's script files are stored in a .pck file for MacOS, the relative paths do not match and the appropriate changes are not made.

There have not been any recent changes that would break var reassignment.  The "Faster pregnancies & growup" mod works fine for me (Windows 7 x64); the changes to variables.gd match the mod.  If you managed to overcome of the .pck file issue, then verify that the mod folder is located correctly(Strive/mods/Faster pregnancies & growup/info.txt), as the mod system will only check the immediate sub-directory.

The community currently does not have any active MacOS modders, so we have not been able to overcome issues related to the OS.  There is a Discord(https://itch.io/t/284398/discord) where we modders and players discuss stuff.  I would appreciate any help you can give towards compatibility with MacOS.  If you can find a method of modding the game on MacOS, then I can create a mod system for it.