Create and Fuck your AI Slut -70% OFF
x

[Makura cover soft] Dungeon and Bride - suggestions, changes, modding, improvement discussion

cantpickaname

Member
Jan 27, 2020
228
361
106
make sure your patch is the last one in the queue which mean if you have other patch like patch2 patch3, your patch name will be patch4
secondly there is a debug log in savedata folder
Thanks, I'll check the debug log.

Regarding the patch order, that should not be an issue, I've ordered it correctly. It works well as long as I'm not adding new functions, that is, when I override a function, the new behavior works correctly. The problem only occurs when I add new functions to the file then it breaks, saying "Member testFunction does not exist".

The fact that it says that my testFunction does not exist implies that it recognizes and overrides the calling function correctly (getFaceNameByShame) but the new function doesn't make it into the final object.

I'm starting to think that this is a limitation of the game engine and how it loads patch files and that there isn't much I can do in this regard. If you know how to get around this please lmk :)
 

drchainchair2

Member
Mar 28, 2020
411
1,071
308
Thanks, I'll check the debug log.

Regarding the patch order, that should not be an issue, I've ordered it correctly. It works well as long as I'm not adding new functions, that is, when I override a function, the new behavior works correctly. The problem only occurs when I add new functions to the file then it breaks, saying "Member testFunction does not exist".

The fact that it says that my testFunction does not exist implies that it recognizes and overrides the calling function correctly (getFaceNameByShame) but the new function doesn't make it into the final object.

I'm starting to think that this is a limitation of the game engine and how it loads patch files and that there isn't much I can do in this regard. If you know how to get around this please lmk :)
This is a PEBKAC error. Most likely you're fucking up function scope.
 

slepth

Member
Aug 5, 2016
161
176
300
I'm having issues trying to override existing files and I need someone who has a bit of experience to point me in the right direction.

Here's what I've got:
in my patch folder I copied over chara.tjs. I've added a test function `testFunction()` that literally just prints out a message to console. Now, within one of the original functions from chara.tjs `getFaceNameByShame()` I made a call to `testFunction()` but this breaks at game bootup.

I've come to the conclusion that the game is calling a different chara.tjs file than the one I provided for the purposes of the new test function, which is hella weird because for the modified getFaceNameByShame() function it understands that there is new content and calls the newer version correctly.

Anyway, if anyone could share how they go about adding functionality to the game I'd appreciate it.
post your current code, maybe?

the code is based on the functions related to "function getFaceName()"?

You still need an event to use that function, I think.

From what I can figure out, all the functions in tjs files are used/called by the ks files....? try finding which ks files that use the functions in the first place.

I feel like I had the same error but it disappears after I added the relevant coding to the other files that calls/use/points to the new code.
 

EandY

Newbie
May 23, 2019
72
31
48
drchainchair2 mind if i ask do can you explain what is going on in the function getTarget(getNext) in living.tjs? i'm trying to modify it but somehow stuck
 

cantpickaname

Member
Jan 27, 2020
228
361
106
post your current code, maybe?

the code is based on the functions related to "function getFaceName()"?

You still need an event to use that function, I think.

From what I can figure out, all the functions in tjs files are used/called by the ks files....? try finding which ks files that use the functions in the first place.

I feel like I had the same error but it disappears after I added the relevant coding to the other files that calls/use/points to the new code.
I can post the code but it's not very important.

Imagine this is my copy of chara.tjs

patch99 > chara.tjs
JavaScript:
// Vanilla code above
function testFunction()
{
    return dm("hey there");
}


function getFaceNameByShame()
{
    testFunction();

    // Vanilla code from devs ...
}
//Vanilla code below

The issue I'm running into is that because the game's own chara.tjs does not contain testFunction() it breaks. All versions of the game's own chara.tjs look like this:
JavaScript:
// Vanilla code above
function getFaceNameByShame()
{
    // Vanilla code from devs ...
}
//Vanilla code below
getFaceNameByShame() is just a convenient place to hook my function call since it gets called whenever you change equipment.
 
Last edited:

slepth

Member
Aug 5, 2016
161
176
300
I can post the code but it's not very important.

Imagine this is my copy of chara.tjs

patch99 > chara.tjs
JavaScript:
// Vanilla code above
function testFunction()
{
    return dm("hey there");
}


function getFaceNameByShame()
{
    testFunction();

    // Vanilla code from devs ...
}
//Vanilla code below

The issue I'm running into is that because the game's own chara.tjs does not contain testFunction() it breaks. All versions of the game's own chara.tjs look like this:
JavaScript:
// Vanilla code above
function getFaceNameByShame()
{
    // Vanilla code from devs ...
}
//Vanilla code below
I'm not sure if its the code formatting or the naming style of the dev but....
try renaming your function as getTestFunction()?
 

cantpickaname

Member
Jan 27, 2020
228
361
106
That would be naming convention, it's JavaScript at the end of the day so any function name should be allowed. Regardless I changed it to that the issue persists.
 

hilih--

Member
May 22, 2019
120
233
167
I can post the code but it's not very important.

Imagine this is my copy of chara.tjs

patch99 > chara.tjs
JavaScript:
// Vanilla code above
function testFunction()
{
    return dm("hey there");
}


function getFaceNameByShame()
{
    testFunction();

    // Vanilla code from devs ...
}
//Vanilla code below

The issue I'm running into is that because the game's own chara.tjs does not contain testFunction() it breaks. All versions of the game's own chara.tjs look like this:
JavaScript:
// Vanilla code above
function getFaceNameByShame()
{
    // Vanilla code from devs ...
}
//Vanilla code below
getFaceNameByShame() is just a convenient place to hook my function call since it gets called whenever you change equipment.
Probably getFaceNameByShame() is executed in a different context.
Code:
var obj = new ...();
(obj.getFaceNameByShame incontextof char_data)();
In this case, getFaceNameByShame() will have access to the data in the char_data object but will not have any access to the methods or variables of the obj (instance of the own class).

Possible solutions:
- move testFunction outside of the class
- inline code in the getFaceNameByShame() method
- call ClassName.testFunction() instead, but not sure if it will work
 

drchainchair2

Member
Mar 28, 2020
411
1,071
308
Probably getFaceNameByShame() is executed in a different context.
Code:
var obj = new ...();
(obj.getFaceNameByShame incontextof char_data)();
In this case, getFaceNameByShame() will have access to the data in the char_data object but will not have any access to the methods or variables of the obj (instance of the own class).

Possible solutions:
- move testFunction outside of the class
- inline code in the getFaceNameByShame() method
- call ClassName.testFunction() instead, but not sure if it will work
I'm just going to stop all the floundering around and explain it.

CharaObject and GuestObject classes both exist. They are often used together with the same function call since many things apply to the 'entire party'. But they in a rather strange class inheritance relationship. The functions are mostly just empty in GuestObject or call CharaObject directly, as your third solution offered.

If the guy having the problem had bothered to search all the code for "function getFaceNameByShame" the solution is immediately evident because there are two of them. Or even try reading the crash log because it would point that the caller is from guest.tjs.

My initial assessment remains correct.
 
  • Like
Reactions: Sayasaya111

EandY

Newbie
May 23, 2019
72
31
48
actually where did he called
I can post the code but it's not very important.

Imagine this is my copy of chara.tjs

patch99 > chara.tjs
JavaScript:
// Vanilla code above
function testFunction()
{
    return dm("hey there");
}


function getFaceNameByShame()
{
    testFunction();

    // Vanilla code from devs ...
}
//Vanilla code below

The issue I'm running into is that because the game's own chara.tjs does not contain testFunction() it breaks. All versions of the game's own chara.tjs look like this:
JavaScript:
// Vanilla code above
function getFaceNameByShame()
{
    // Vanilla code from devs ...
}
//Vanilla code below
getFaceNameByShame() is just a convenient place to hook my function call since it gets called whenever you change equipment.
testFunction exist or not is not even an issue, i have added a lot of function modded to mess around with skills .drchainchar2 said it right
on the other side, guest object is just inheritate from CharObject so it will not affected when the same function is called
 

cantpickaname

Member
Jan 27, 2020
228
361
106
I'm just going to stop all the floundering around and explain it.

CharaObject and GuestObject classes both exist. They are often used together with the same function call since many things apply to the 'entire party'. But they in a rather strange class inheritance relationship. The functions are mostly just empty in GuestObject or call CharaObject directly, as your third solution offered.

If the guy having the problem had bothered to search all the code for "function getFaceNameByShame" the solution is immediately evident because there are two of them. Or even try reading the crash log because it would point that the caller is from guest.tjs.

My initial assessment remains correct.
Thank you again for taking the time to patiently explain this to me. I look forward to both of us making cool and interesting additions to this game!
 
Last edited:

EandY

Newbie
May 23, 2019
72
31
48
Don't worry, I figured it out on my own. Great to see you coming out of the woodworks when Hilih kinda figured it out too. If you're wondering why I sound hostile to you it's because you're being a dick.

I asked for help, you quiped, I quiped back but you couldn't handle your own medicine.

For your information, I did search for getFaceNameByShame, it was not immediately obvious because my brain wasn't as big as yours and my penis was probably smaller too. After doing some reading my brain got bigger and I figured it out, my penis did too, it's now bigger than yours.

You've been no help. You could have but chose not to. My initial assessment also remains correct.
ok, don't be hostile now since you can code 1 or 2 lines, and next time we will not help if you keep being like this, at least respect each other a little bit will not hurt anyone
 
  • Thinking Face
Reactions: cantpickaname

13325

Member
Jun 21, 2017
129
108
235
>scope issue
>grrr you didn't fix my code
>scope issue with more explanation
>yep its a scope issue and if you used all your dev resources you'd have found it
>grrrr you did nothing and I figured it out on my own also my peepee bigger

you cant make this shit up.
To prevent something like this again you should open all the files in your IDE and search all files for the functions, or read the debug, or have some humility.
 
  • Disagree
Reactions: cantpickaname

EandY

Newbie
May 23, 2019
72
31
48
Reported him

progress of skills: all skill has differenceaccuracy calculation
lord
Retaliation: toggle skill, when inactive, gain 20% damage reduction and increase stacking damage
when active, turn all damage reduction into attack
skill pirate :
Ataque Feroz : consumed 15% current HP as attack
skill warrior: depend on equipments
if off hand has shield : shield bash level 5 allow to stun all enemies in front round 3 turns cooldown
if offhand equip dagger/axe/anything else: twin storm : attack 1 enemy with dual damage, gain absolute evasion for 3 turns ( i copied from parrying dagger medieval stand )
warrior equipment polearm/spear : a sweep attack that attack all enemies in front round
warrior equip blunt weapon : ground AOE attack similar to earthquake skill from magic tree
warrior passive unarmed: increase damage by from unarmed by level of character obtain at level 1

druid : add 2 chanting skills that will canceling each other, during chanting, cannot cast spell or attack
sanctuary : increase team defend by 20%, heal team 15% max HP per turn and reduce drowsiness by 5
sacred order : increase team attack, speed and accuracy by 20%
 
Last edited:

EandY

Newbie
May 23, 2019
72
31
48
Testing trigger skills on skills. If this work welp, there goes bard buff
Planning to every time bard trigger a song. An attack will happen on enemy which may randomized
Not sure how to buff spell sword. Valkyrie will have same treatment with warriors and all attack depend on weapon and they have 3 weapons. Hammers. Spear polearm and shield
Spear will have that dash forward and back. Hammer aoe attack on all enemies shield idk yet.
For sorcerer i might add time stop on them not sure
Priest none yet.
Bishop :
Pilgrimage(10): semi-passive: gain attack damage depend on combo gain,
active : consume all stack of magic into a huge row attack that always has divine attributes
Alchemist none yet
Summoners none yet
Mage none yet
Assassin and thief none yet
Hunters. Change arrows into attributes arrows. Also created 2 active skills. 1 is volley attack all enemies. The other one is split shot do row attack
So far only lord pirate and warrior done
 
Last edited: