Save-Point
Name Detector? (More info in thread) - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Games Development (https://www.save-point.org/forum-4.html)
+--- Forum: Code Support (https://www.save-point.org/forum-20.html)
+--- Thread: Name Detector? (More info in thread) (/thread-7130.html)



Name Detector? (More info in thread) - justpassingby - 10-12-2017

Before I begin, I would like to thank all those who helped me before for the Runic script. Going smoothly so far, that little bugger.
That said... I came across something interesting when I was trying out this certain "Advanced Message" script which was edited, fixed and enhanced by dubealex.

Basically, doing \n[insert Actor ID here] will allow the text box to write down that character's name even though we can already type said name by ourselves.
And there is doing \name[insert name or word here] will give the name/word in a box which is quite important to me.

So... I was wondering... does a script that allow us RPG Maker XP users to do something like this exist? (Note: I Googled as much as I can and found nothing.)
--------
Scenario...

1: This NPC is named "Baku". Yes, that Baku from Final Fantasy IX. I like to use him for examples.

2: I have installed Leon_Westbrooke's "Party Changer" script. Meaning I can set whoever I want as my leader via events (and the occasional script calling).

3: Now let's say my main character whom I will always use as the leader is named "Tiffany" and her Actor ID is "1" and let's say I have a 2nd in command named "Riona".

4: I type in the text box which is Baku's dialogue like... "Hey, little bugger. Are you \n[1] by any chance?".

Result of #4: As a result, the game will detect it and say "Hey, little bugger. Are you Tiffany by any chance?". Right? That brings me to the main questions from #5 onward.

5: Let's say I decided to CHANGE my main character to Riona in-game and THEN approach to talk to Baku instead of staying as Tiffany.

6: Baku will *unfortunately* stick to the dialogue I gave him as "Hey, little bugger. Are you Tiffany by any chance?" because of the \n[1] command.

Conclusion: As mentioned (if a script is needed to be involved especially), is it possible to have the database detect your main character player changes and change the name accordingly to fit the "new character" taking the position of leader? Thus, the title of this thread, Name Detector.

Do let me know your thoughts whenever, please and thank you.


RE: Name Detector? (More info in thread) - kyonides - 10-12-2017

Scriptwise it would be as easy as typing...

$game_variables[VARID] = $game_party.actors[INDEX].name

Then in the message box type \v[VARID] instead of \n[ID].

If my script call is too large, then hit enter right after the equal to symbol and type or paste the rest of the code in the next line.

INDEX is a number starting at 0.


RE: Name Detector? (More info in thread) - justpassingby - 10-12-2017

@kyonides
$game_variables[VARID] = $game_party.actors[INDEX].name

Alright. I get the "v\[VARID] instead of \n[ID]" part.
Is "VARID" one of the script commands? Or a character name made up on the spot by you?
Just wanting to make sure I am not going to go wrong here.

Edit: Never mind. I figured out how to use that script call. Thanks, kyonides.


RE: Name Detector? (More info in thread) - kyonides - 10-12-2017

Abbrevation of variable ID, while ID stands for actor ID, but it won't be used in my script call, plus INDEX is a position starting at 0, remember a party usually has 4 members so the last position would get 3 as its corresponding index.


RE: Name Detector? (More info in thread) - justpassingby - 10-12-2017

@kyonides
Aye, I figured that out via trial and error.
This is what I came up with.

$game_variables[1] =
$game_party.actors[0].name
$game_variables[2] =
$game_party.actors[1].name
$game_variables[3] =
$game_party.actors[2].name
$game_variables[4] =
$game_party.actors[3].name

I guess that means regardless of whoever is in the leadership position, if I use \v[1], that correct person will be speaking.
And using \v[2] results in the 2nd position person in the Caterpillar position doing the speaking and the correct person too,
\v[3] for the 3rd position person and \v[4] for the 4th position person.

Very good script for whom I want to speak at that time with their name displayed even though it's in the large text box itself instead of a small text box on its own which I can do via "\name[Tiffany]" for example.
I think I shall experiment and see whether I can succeed in doing so on my own. If not, cue Terminator's "I'll be back".

Edit: I now attached some images here.
As you can see, doing this "$game_variables[1] = $game_party.actors[0].name" gave me the one that is not in the Name Box (1st image attachment that I wanted): The one with the name "Celes" in the 2nd Image attachment.
The one with the "Tutorial Lenna" is done with "\name[Tutorial Lenna]" which is the 1st image attachment.

I was/am wondering how I am I able to accomplish that.
I tried something like "\v[1] \name[Celes]" or "\name[Celes] \v[1]" and yes, that does work.
But that one is very specific.
Because if I do "\v[1] \name[Terra]" or "\name[Terra] \v[1]", the "\v[1]" part's name goes into the big box and the \name[Terra] part goes into the small box as shown in the 3rd image attachment.

Any way for me to have that "Name Detecting" be scripted into the "Small Box" and not be in the Big one? Thoughts are still greatly welcome.
P.S.: Terra, Celes and Lenna are from FFVI and FV respectively whom I used as name examples to show my issues/references.


RE: Name Detector? (More info in thread) - DerVVulfman - 10-13-2017

So you're looking for a means within Dubealex's AMS R4 to:


1) Change/Show the name of the lead party member within dialog instead of using the \n[ index ] system which selects the name of an actor in the database.

2) Change/show the name of the speaker identified in the name box, preferably by a similar means.

You have already understood the way that $game_party.actors[0] can identify the lead party member... with actors[1], [2] and [3] in tow as the additional members therein, so I won't dwell on that.  Also, you can see how to use the Game_Variable class ($game_variables) to accept the name of an actor.

But now you wish to know how to substitute the name within the name box itself.   The technique is almost the same.  It's a matter of syntax, which you can see in the screenie I attached ... which also includes Kyonides's previously described solution for your first inquiry.

\name [ \v[id] ]

[Image: attachment.php?aid=970]

I doubled up and used two sets of $game_variables when only one was needed. I was thinking of setting the 2nd variable to have the reply of 'NO, I'm ****" instead.



.jpg   textoption.jpg (Size: 21.79 KB / Downloads: 26)


RE: Name Detector? (More info in thread) - justpassingby - 10-13-2017

@DerVVulfman

Interesting. I'll give that one a go and give a post edit update whether it works or not.


RE: Name Detector? (More info in thread) - DerVVulfman - 10-13-2017

No prob.

Oh, and moved to 'code support' as this topic is geared towards understanding or getting around the nuances of a script rather than crafting a whole new one.

Edit: You're less 'justpassingby' and more 'justhangingaround' Winking


RE: Name Detector? (More info in thread) - justpassingby - 10-13-2017

Just like Kamen Rider: Decade then. Grinning

That aside, it worked. Once again, I thank both you and Kyonides. Another issue solved.
Though there is one off topic problem and that is Liz's Autosave.save script. Each time if players want to load their Autosave file instead of their main file, it crashes on me.
But that is a problem for another time. I'll try solving that on my own.