DragonPrime - LoGD Resource Community
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • April 19, 2018, 02:06:21 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Creature Editor Question  (Read 144 times)
0 Members and 1 Guest are viewing this topic.
TGTarheel
Codemeister
****
Online Online

Posts: 388


View Profile
« on: April 11, 2018, 10:18:58 PM »

OK, so, like in the Master Editor, you can use appo codes to have things show up like the name of your weapon, armor, your character name, subjective/objective/possessive pronouns, etc.

Which of these codes work in the Creature Editor?  I have looked around and see no topic that addresses this.

I know that `w will give you your weapon name...but what other appo codes, if any, work in the creature editor?
Logged
Aeolus
Mod God
*****
Offline Offline

Posts: 1859


You're welcome.


View Profile WWW
« Reply #1 on: April 12, 2018, 12:38:36 AM »

Take a look at the lib/substitute.php file, you'll find a lot of substitute codes in there.
Logged

TGTarheel
Codemeister
****
Online Online

Posts: 388


View Profile
« Reply #2 on: April 12, 2018, 05:52:01 AM »

Take a look at the lib/substitute.php file, you'll find a lot of substitute codes in there.

sweet, thanks.

hummm...had a look.  Some of these codes...which work in, say, the Master messages...do NOT work in the creature death messages.  For example, %o for she/he...works in the Master Editor...but not in the Creature Editor, you can't use it in death messages.  Tried, and it did not work.  Is there a reason why they work in one place and not the other?
« Last Edit: April 12, 2018, 05:59:04 AM by TGTarheel » Logged
Aeolus
Mod God
*****
Offline Offline

Posts: 1859


You're welcome.


View Profile WWW
« Reply #3 on: April 12, 2018, 07:42:20 AM »

Use the code string search module to look for where those functions are used, and that'll answer your question.
Logged

TGTarheel
Codemeister
****
Online Online

Posts: 388


View Profile
« Reply #4 on: April 12, 2018, 11:26:41 AM »

Use the code string search module to look for where those functions are used, and that'll answer your question.

So you are telling me...to make it work, I gotta fool with core code, adding the code from the Master Editor to the Creature Editor, huh?

I suppose I could try...it's what I got a test server for...

huh...I don't see where masters.php or creatures.php call for substitute.php - I guess it is time to use the code string search...
« Last Edit: April 12, 2018, 12:08:02 PM by TGTarheel » Logged
Aeolus
Mod God
*****
Offline Offline

Posts: 1859


You're welcome.


View Profile WWW
« Reply #5 on: April 12, 2018, 04:04:36 PM »

So you are telling me...to make it work, I gotta fool with core code, adding the code from the Master Editor to the Creature Editor, huh?

I suppose I could try...it's what I got a test server for...

huh...I don't see where masters.php or creatures.php call for substitute.php - I guess it is time to use the code string search...

Well, how else are you going to learn? Sometimes you need to be able to find the answers yourself, something the fun of coding is going through a lot of code to find it. I spent two hours the other day debugging and tracking an error through about a half-dozen different core files.

The files masters.php and creatures.php are only the editors, not where the content would actually be displayed or where any substitution would occur.
« Last Edit: April 12, 2018, 04:07:16 PM by Aeolus » Logged

TGTarheel
Codemeister
****
Online Online

Posts: 388


View Profile
« Reply #6 on: April 13, 2018, 12:07:49 AM »

So you are telling me...to make it work, I gotta fool with core code, adding the code from the Master Editor to the Creature Editor, huh?

I suppose I could try...it's what I got a test server for...

huh...I don't see where masters.php or creatures.php call for substitute.php - I guess it is time to use the code string search...

Well, how else are you going to learn? Sometimes you need to be able to find the answers yourself, something the fun of coding is going through a lot of code to find it. I spent two hours the other day debugging and tracking an error through about a half-dozen different core files.

The files masters.php and creatures.php are only the editors, not where the content would actually be displayed or where any substitution would occur.

Figured that out with a code string search.

I looked for where /lib/substitute.php is called for in code...because wherever that is required...that is where I need to be looking....I think...

OK...so I see how it is done, now...say, with the taunts.
Now what I need...is somewhere where lib/substitute.php is NOT used...and add it in.

Now I am debating whether I want to put t in creature.php near $winmsg - which seems to be where it is setting the message in the creature editor...
or if I just want to put it in forestoutcomes.php - where it is displaying the winmsg....near line 27 where it is actually fetching the message.

The reason this is confusing to me is that the taunt editor is standalone...where as creature win/lose messages are a part of the larger creature editor...not their own editor, see?


so...point me the right way since I got this far on my own...which file would YOU do the alteration to??  creature.php or /lib/forestoutcomes.php

I think my code will look something like this - IF I am altering /lib/forestoutcomes.php:

Code:
require_once("lib/substitute.php");
if(isset($badguy['creaturelose'])) $msg = translate_inline($badguy['creaturelose']);
$msg = substitute_array($badguy['creaturelose']);

Where the middle line is already line 27 of /lib/forestoutcomes.php - and I am adding the top and bottom line of the code snip above.

Now...if I were to try altering creatures.php (and I am less sure of fooling with this part...
just plain not as confident here...the coding looks a lot more complicated to me....

Code:
require_once("lib/substitute.php");
$badguy=array 'creaturelose'=>'Die');
$losemsg = substitute_array($badguy['creaturelose']);
$losemsg = call_user_func_array("sprintf_translate", $losemsg);

Then later down

Code:
"creaturelose"=>$losemsg,

But I am far less confident I have this second thing right...it is terribly confusing.

Now...if I do it JUST in the forestoutcomes....it seems to me it would work in battle, but the substitution would not show up in the creature editor itself, it would still show the appo code.

Do I have this close to right??  And again...what do you recommend...assuming I have it right?

My own inclination is to just put it in /lib/forestoutcomes.php - and let it display as I want when the creature lose actually happens, and who gives a rat's behind if the appo code shows up in the editor...because that is far more complicated and I'm quite frankly a little afraid of that one.
« Last Edit: April 13, 2018, 12:44:01 AM by TGTarheel » Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Welcome to DragonPrime - The LoGD Resource Community!

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