reeve.miykael

Newbie
Nov 29, 2018
16
20
Adding new images
Going back to my example (we want to add the icon of a new weapon, the naginata), this is a step-to-step tutorial:
0. download Godot Engine from
1. launch Godot Engine
2. click "New Project"
1.png
3. click "Browse" and choose the project folder
4. click "Create & Edit" to launch the project
2.png
5. in the bottom-right corner, click "FileSystem"
3.png
6. right-click and choose "New folder"
5.png
7. name the new folder: "files"
6.png
8. double-click the "files" folder
9-10: repeat steps 6-7 and create the "images" folder
11. double-click the "images" folder
12-13: repeat steps 6-7 and create the "items" folder
14: double-click the items folder
15: drag and drop your image into the items folder
8.png
16: Godot Engine automatically creates the files you need:
- /path/to/preject/files/images/items/naginata.png.import (e.g. on Windows: D:\Godot\F95\files\images\items\naginata.png.import)
- /path/to/preject/.import/naginata.png-83875db020b2d5f2b794ce75304bff0a.stex
Grab them and paste them into the corresponding SfP directories
 

sp1ker

Newbie
Apr 29, 2017
96
69
If you want to replace an existing image, my method saves you the trouble to edit the .gd files.
If you want to add new images, I think there is a much easier solution: it should not be different from loading a face/body portrait. Cons: you have to mess up with the code.

@Fuzzcat : as for the hex editor, in the attached archive there is a stupid .exe I made some months ago (I am not proud of it, I just wanted to learn a bit of C#). There is also the source, if you want to compile it by yourself (I have used the MS Visual C# Compiler).
Put the .exe it into the ".import" folder and double click it (if it does not work, try launching it through cmd.exe): it should create a subfolder (its name is the current timestamp) containing the fixed PNG. It does not edit the original files... but backup them before using this hack (better safe than sorry).
You're a damn prince, Reeve.
If only you could make a little program to export our regular PNGs as .import files as well :)

(I'm being facetious - your tutorial is unbelievable and a great asset to this community)
 

reeve.miykael

Newbie
Nov 29, 2018
16
20
Up until Maverik sees that and start properly exporting his project. ;)
From what I have seen (and read), Maverik has mixed feelings about this. On the one hand, he fears that people may steal his game; on the other hand, he knows his limits (you can easily spot which parts of the game he has not personally developed). If he made the game open source, like FCdev or Innoxia did, imho SfP could only benefit from this.

To answer to @Fuzzcat : if people could properly fork the project, I may be interested in making a mod, but I would like to do it on Gitsomething. If I did it today, I would just break the law and (more important) my repository would be closed in a few minutes. School of lust has taught us something.

As for the artwork, I know Maverik wants to protect the assets and he will not be happy of this hack, but actually I don't see the point in obfuscating some pics. Sure, he could make the things harder and export the project as a single .exe, like the devs of Hardcoded and Porn Empire do (two more Godot games), but this would only punish the fan base.

@sp1ker : thanks man, you are too kind. I will see what I can do, no promises: in this community there are many developers more skilled than me, please don't have high expectations. ^^
 

congamensch

Member
Feb 19, 2018
390
748
Sorry to interrupt, but how does one unlock the hatchery? I tried looking on the wiki, and I could find nothing. I couldn't find anything by googling either.
 

Fuzzcat

Active Member
Oct 27, 2017
624
659
Going back to my example (we want to add the icon of a new weapon, the naginata), this is a step-to-step tutorial... *snip*
You're a damn prince, Reeve.
If only you could make a little program to export our regular PNGs as .import files as well :)

(I'm being facetious - your tutorial is unbelievable and a great asset to this community)
That's some damn good tutorial.
Again, when I tried Godot, I was just looking at the screen and saying "well, now what?"... because supposedly, Godot is easy to use...yeah, my ass. (Wait... not that my ass is easy to use, I mean using Godot!)

Now seriously...sheesh that's complicated.
I expected something simple like "change .cbz extension for .zip" or the like.
Out of curiosity (and because it saves time dammit)... I guess that outright .png images work the same? If it does for portraits, then it'll work for items?
I just wanted the original files to have at hand, and keep a similar style, but to hell with them if that requires such an amount of dig-dugging just to make-try-test a simple item.

And yeah, Mav seemed a bit... overzealous about the game. I offered my graphic skills for free. And he was doubting. Did like a dozen concepts, threw a lot of ideas (which he used)... and still doubted, was kind of foggy, and never decided anything. After a while, he simply didn't replied anymore. Like he was all like "for free? why?" and looked at me shifty-eyed. Cool guy, but odd.

Funniest thing: he seems overzealous... but there's really nothing that original that could be stolen.
He's using standard races, standard names... he even started the game based off Jack O Nine Tails and Free Cities (said it himself), and used generic background pictures at the beginning. That's why I offered a hand, because I liked the project, and he was all alone doing it *shrug*

Anyways, as for mods... he's not opposed to that, to the contrary, he's got a modding comunnity set up on Itchi.o. He even posts there and give hints and all (I guess he also learns from there. Smart move.)
Overall, there's just 3 big mods that could be actually considered mods. The rest are merely edits of constants, which we can do easily ourselves (and without breaking anything as they usually do).
My idea was to make a big bunch of items, with full-new icons. I'm not new to it, and really enjoy drawing small, fast things. Then upload, and let everyone use it as they want (adding items apparently doesn't messes with anything, it's a sort of safe bet), including players and modders. Basically, a generic repository.
 
  • Like
Reactions: AWolfe

reeve.miykael

Newbie
Nov 29, 2018
16
20
Out of curiosity (and because it saves time dammit)... I guess that outright .png images work the same? If it does for portraits, then it'll work for items?
Yes, they can work: but the issue is that the game expects items to have the .stex+.import format.

I added a regular PNG in files\images\items and edited items.gd:
Code:
clothchain = {
    code = 'clothchain',
    name = 'Chainmail Bikini',
    icon = "res://files/images/items/bikini.png",
    [...]
and the result is:
Code:
ERROR: No loader found for resource: res://files/images/items/bikini.png
So you should also edit multiple gd scripts (the market, both the inventories, what you and your slaves wear/hold) and tell the game to use, only for the items you have created, not the "load" function, but "globals.loadimage" (as the portrait mods do).
And if the dev modifies those scripts, the mod must be updated too.

On the other hand, once you encrypt the icons with Godot, they are ready to be used. Also, I may be mistaken but I think that the game would run slightly faster.
Btw, iirc you can drag and drog multiple files at once, so the conversion is not that long if you have all the assets ready.
 

Fuzzcat

Active Member
Oct 27, 2017
624
659
Yes, they can work: but the issue is that the game expects items to have the .stex+.import format.

I added a regular PNG in files\images\items and edited items.gd:
Code:
clothchain = {
    code = 'clothchain',
    name = 'Chainmail Bikini',
    icon = "res://files/images/items/bikini.png",
    [...]
and the result is:
Code:
ERROR: No loader found for resource: res://files/images/items/bikini.png
So you should also edit multiple gd scripts (the market, both the inventories, what you and your slaves wear/hold) and tell the game to use, only for the items you have created, not the "load" function, but "globals.loadimage" (as the portrait mods do).
And if the dev modifies those scripts, the mod must be updated too.

On the other hand, once you encrypt the icons with Godot, they are ready to be used. Also, I may be mistaken but I think that the game would run slightly faster.
Btw, iirc you can drag and drog multiple files at once, so the conversion is not that long if you have all the assets ready.
*sigh*
No wonder why Mav wants to change engine.
Well, seems like I'll spend the weekend fiddling with the stupid Godot.
Or just do the pics, the text coding, and let some modder compile the frigging thing :p
 
  • Like
Reactions: reeve.miykael

1

Newbie
Feb 17, 2017
59
72
And if the dev modifies those scripts, the mod must be updated too.
load is just a "link" to Godot internal class's method ResourceLoader.load, you can't change it.
It is made to read only preimported resources, that's why you get that error.

On the other hand, once you encrypt the icons with Godot, they are ready to be used. Also, I may be mistaken but I think that the game would run slightly faster.
Godot does not "encrypt" resources per se, it just "imports" them by converting and putting them in the unified containers they made.Here stex, the Stream Texture. ie simple images.
And no in this use case this behaviour does not effect loading speeds in positive way.

In fact they way(file size wise) Godot imports png files... sucks, hard. For example, if you make a build that uses optimised png's directly it'll weight under 140MB(unpacked). But if you have SSD it won't impact loading times much though.
Even with optimised png's RAM usage will stay mostly the same, to optimise there you'll need to rewrite godot itself, derp.
Also, if you optimise resource loading in game code you can get almost instant game loading times and around 2-3 times less RAM usage.
 

Fuzzcat

Active Member
Oct 27, 2017
624
659
Which is already a lot of work, man. Godspeed!
Hum, not really for what I intend for starters.
Just for testing, I'm going with male versions of clothing sets, as well as some variations of each. I guess I can just copypaste code there, and do some minor changes. That alone will double the available items in game, without actually changing anything.

If I can make it work, then I'll be doing the rest I have in mind (which is nothing complicated, but it'll add some more versatility and variation to equipment.

load is just a "link" to Godot internal class's method ResourceLoader.load, you can't change it.
It is made to read only preimported resources, that's why you get that error.
Sorry if I still don't get it clear... so you mean that .png files can actually be used?

Btw... I just found I had an old version, which has all graphic assets in .png files. *facepalm*
 

LoganJ

Member
Feb 5, 2018
167
117
Bugreport:
In the latest Version (0.5.22b) the "Heal"-Spell doesn't work correctly anymore. Now it reduces the maximum health/health by 10%.
Maybe somebody can report this to the Dev in the right way as I don't know where and how to do this.
 

AWolfe

Engaged Member
Donor
Game Developer
Jan 21, 2018
2,010
1,655
Bugreport:
In the latest Version (0.5.22b) the "Heal"-Spell doesn't work correctly anymore. Now it reduces the maximum health/health by 10%.
Maybe somebody can report this to the Dev in the right way as I don't know where and how to do this.
It's working just fine for me.
 

sp1ker

Newbie
Apr 29, 2017
96
69
Bugreport:
In the latest Version (0.5.22b) the "Heal"-Spell doesn't work correctly anymore. Now it reduces the maximum health/health by 10%.
Maybe somebody can report this to the Dev in the right way as I don't know where and how to do this.
Do you mean the spell while out in combat or back at the Mansion? They're two different spells.
 
  • Like
Reactions: reeve.miykael

Fuzzcat

Active Member
Oct 27, 2017
624
659
Yes, but as reeve had mentioned, you'll need to change in code all involved load calls to .loadimage.
Sorry to be a pain and insist on this... with "change in code" means that I could change the .loadimage file code to have the game accept .png images?
(I know I'm a pest... but I dread the idea of having to spend a lot of time using other programs I don't know, just to make images available...)
 

reeve.miykael

Newbie
Nov 29, 2018
16
20
@LoganJ : how high is the magic affinity of the caster? Because the efficacy of the healing spell greatly depends on it.
- If cast by the MC, it increases the health of a person by MC's magic affinity times seven, plus a random number between 20 and 30
- If cast by a slave, it increases the health of a person by caster's magic affinity times nine, plus 25
As for reporting a bug, write .

@sp1ker : good point, I did not know they were different (actually it seems counter-intuitive to me).

@Fuzzcat : this is just an example.
In files\scripts\outside.gd there is this little fragment of code:
Code:
        if person.gear[i] != null:
            var item = globals.state.unstackables[person.gear[i]]
            $playergrouppanel/characterinfo.get_node(i).texture_normal = load(item.icon)
If I am not mistaken, the last line affects the icons in this popup:
slots8.png
and replaces the default images with those of what a character wears or holds.
You should change the last line like that (I have not tested the code, do not trust in it):
Code:
            if(item.has("custom")):
                $playergrouppanel/characterinfo.get_node(i).texture_normal = globals.loadimage(item.icon)
            else:
                $playergrouppanel/characterinfo.get_node(i).texture_normal = load(item.icon)
In the first line, the game checks the item definition. If it finds the "custom" key, the game will load a plain PNG (as it does with custom portraits); if not, it will expect two files, a .stex and a .import.
In files\scripts\items.gd you must define your custom item like that:
Code:
naginata = {
    ...
    icon = "res://files/images/items/naginata.png", #do not call the "load" function
    custom = true,
    ...
}
As I said in a previous post, you must edit not only the aforementioned script (outside.gd), but also all the files where the icons are loaded (there is the market, the black market in Umbra, the personal inventory, the mansion inventory and God knows what else). And if Maverik renames for instance the "characterinfo" popup like "newcharacterinfo", you must update your mod too.
Imho it's way less bothersome to convert the images once.
 
  • Like
Reactions: Fuzzcat
4.20 star(s) 47 Votes