DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • December 11, 2018, 12:47:28 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: 1 [2]   Go Down
  Print  
Author Topic: Keep gold after dragonkill  (Read 7131 times)
0 Members and 1 Guest are viewing this topic.
Aeolus
Mod God
*****
Offline Offline

Posts: 1912


You're welcome.


View Profile WWW
« Reply #15 on: November 24, 2018, 10:19:41 PM »

Right.  I sorta got that figured.  I was trying to find it within the core code and make a core edit.
The module presented seemed to require a fair bit of reworking to get where I wanted.  I am gonna check out the other module presented and see if it more meets my needs here.
Will update.

Not quite there, either.  I need to not have booleans...I need to be able to have values of goldinbank saved across a DK - and set those based on number of DK's

Damn...seems like this is an easier core rewrite, if only I can find exactly WHERE in the core the damn reset happens.


This module is basically created for what you want. It saves how much gold you have before a DK, then sets your gold to that after a DK (i.e. "values of goldinbank saved across a DK"). You just want different levels of gold saved. The logic I provided can be used directly (after turning it into code) in the post-DK hook, barely any reworking necessary.
Logged

TGTarheel
Codemeister
****
Offline Offline

Posts: 491


View Profile
« Reply #16 on: November 25, 2018, 01:10:42 AM »

Right.  I sorta got that figured.  I was trying to find it within the core code and make a core edit.
The module presented seemed to require a fair bit of reworking to get where I wanted.  I am gonna check out the other module presented and see if it more meets my needs here.
Will update.

Not quite there, either.  I need to not have booleans...I need to be able to have values of goldinbank saved across a DK - and set those based on number of DK's

Damn...seems like this is an easier core rewrite, if only I can find exactly WHERE in the core the damn reset happens.



This module is basically created for what you want. It saves how much gold you have before a DK, then sets your gold to that after a DK (i.e. "values of goldinbank saved across a DK"). You just want different levels of gold saved. The logic I provided can be used directly (after turning it into code) in the post-DK hook, barely any reworking necessary.

I think I have managed the same as a core edit.  Just needed to know where to put it.  At least it seems to parse correctly, now just need to test it across a dragonkill to see if what I did works.
What I wanted was dragon.php & op=prologue1

What I was looking for...erroneously...was a reset gold in bank to zero.  What that op DOES, however...is tell the game what to keep.  Everything else by default goes away.
SO...just a matter of the if statements - capturing goldinbank before it resets, and setting a variable.  Then valuing the variable according to the parameters I want...then, after everything resets, add a line in to set goldinbank to the value of the variable.

It seems like it ought to work, anyway.  The proof is in the pudding though.

I just wanted this so that people could save a little money in the bank so that pets would not run away due to neglect all the time every time you got creamed in the forest and lost all your gold.

Not trying to actually allow a huge amount to be saved.  You can save more in your dwelling coffers in my game...but the pets module won't auto-withdraw from coffers to feed pets, it will only do that from the bank...hence my wanting to be able to save a small amount of gold...in the bank...and not have the PITA of having to remember to withdraw it all every time you want to fight a dragon.
« Last Edit: November 25, 2018, 01:13:48 AM by TGTarheel » Logged
Aeolus
Mod God
*****
Offline Offline

Posts: 1912


You're welcome.


View Profile WWW
« Reply #17 on: November 25, 2018, 04:32:04 AM »

Core code, module, either works. The logic works at any rate, I tested it in about two minutes. Cheers.
Logged

TGTarheel
Codemeister
****
Offline Offline

Posts: 491


View Profile
« Reply #18 on: November 27, 2018, 04:47:55 AM »

Core code, module, either works. The logic works at any rate, I tested it in about two minutes. Cheers.
The logic works...and so does the core edit I did.  It worked like it was supposed to.  Tested across a DK with less than limit in bank and with more than limit in back, and it did what it was supposed to do in both cases.
Logged
Aeolus
Mod God
*****
Offline Offline

Posts: 1912


You're welcome.


View Profile WWW
« Reply #19 on: November 27, 2018, 05:34:54 AM »

Good to hear. Make sure that you have a check to disable it in case you ever need to. Core edits should only be done in the most necessary of circumstances, and can go terribly wrong in the future when other things are changed. That's what modules were created for. Cheers.
Logged

TGTarheel
Codemeister
****
Offline Offline

Posts: 491


View Profile
« Reply #20 on: November 28, 2018, 11:52:01 PM »

Good to hear. Make sure that you have a check to disable it in case you ever need to. Core edits should only be done in the most necessary of circumstances, and can go terribly wrong in the future when other things are changed. That's what modules were created for. Cheers.

TBH, I do core edits when I can't figure out where to hook a module into to get it to do what I want.  I was not quite sure where to hook this, because, if you hook to "dragonkill" then I think the gold would wipe out first...so it would ruin what I was trying to do.

I also always notate my core edits by wrapping them with comment lines, at the beginning and end of the core edit, and leave myself a note of what I was trying to achieve with the core edit.

Additionally, after I make a core edit work right...I have a backup of the original core file...and a backup of the working core file...thus I always have a way to back up to where I was when things worked in case something breaks.

I'm pretty careful with core edits.  I agree with you, I don't like them much but there are times when it's just easier.
« Last Edit: November 28, 2018, 11:54:56 PM by TGTarheel » Logged
Pages: 1 [2]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Please take the time to read the FAQ and browse the DragonPedia

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
52 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search