Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

SOLVED player set password problem

Status
Not open for further replies.

CynicSyndrome

Towns Guard
Xy$
0.36
what I need is a player set password. player creates password: name input-> actor1000(password), player prompted for password: name input -> actor999(password entry), If actor999.name=actor1000.name; then proceed to trigger event, or flip switch, open door, start pc, etc. just an outline, I need help correcting the script to make this work. Setting name input to a variable would fix this, if anyone knows how to script for that. or directly scripting a conditional branch that compares one actor name to another. if name x = name y, then A, else B.
 

LTN Games

Master Mind
Resource Team
Xy$
0.01
Are you using Quasi Name Input plugin? or a different input plugin? I may be able to help you out.One way this is achievable is that the Name input plugin changes the name of an actor so you could technically have an Actor slot specifically for password input, once the player has inputted a password you can then save whatever the name of the "Password Input" actor is, into a new variable.

So, for example, let's say you change the name of actor 10 which will be the Password input actor, after the name is changed you can setup a "control variable' event command and use a script like this to set the variables value.
JavaScript:
$dataActors[10].name;
Screenshot_1.png
Let me know if you need any additional help.
 

LTN Games

Master Mind
Resource Team
Xy$
0.01
The above way should work without the plugin as well. Using "Name Input Processing" event command to change an actors name as the password then using the small script above to set the variable as the name of the actor. I've tested it without plugin so you should be good.
 

CynicSyndrome

Towns Guard
Xy$
0.36
Just tested it now. Doesn't seem to work. Variable keeps coming up zero. Entered it exactly as given corrected for actor# and variable#
 

Dad3353

Praised Adventurer
I'm testing this, too (no plug-in, either, and for a slightly different use...); I can't capture the name entered. All I get is the Actor Name in the database. Checked and double-checked for exactitude, but no dice, I'm afraid.
The Actor's Name is visible after Player data entry through \N[10], but this doesn't seem to be $dataActors[10].name.
Here's my code...
Variable 58 and 59 are always identical ("Password Input" every time, whatever the data entry...).
\N[10] changes, but not $dataActors[10].name. What are we doing wrong..?
Any clues..? This'll be very useful once up and running, so thanks in advance.

Edit: I've solved this by using the Script '$gameActors.actor(10).name()' instead of $dataActors [10].name in my Event. I now understand that 'dataActors' refers to the database information (which doesn't change in the game...); 'gameActors' refers to the dynamic information which may change as the game progresses. I'll chalk that one up to experience. My Password Event is now working.
Hope this helps someone else.
 
Last edited:

LTN Games

Master Mind
Resource Team
Xy$
0.01
Sorry guys, It's been a little while since I've played with MV. I should have used $gameActors, so for it to work properly do this instead.
JavaScript:
// 10 is the id of the actor in the database.
$gameActors.actor(10)._name
Screenshot_1.png

EDIT:
Edit: I've solved this by using the Script '$gameActors.actor(10).name()' instead of $dataActors [10].name in my Event. I now understand that 'dataActors' refers to the database information (which doesn't change in the game...); 'gameActors' refers to the dynamic information which may change as the game progresses. I'll chalk that one up to experience. My Password Event is now working.
Hope this helps someone else.
Just to elaborate, $dataActors pulls the information from the JSON files located in the data folder, which does not change until the game is saved. $gameActors as you have mentioned is the dynamic and constantly updated object which contains all actor information in the database but also any new information given to it during gameplay.
 
I was ninja'd by @LTN Games (again?!). ;)

I was using a slightly different method by creating a blank Actor (without needing to reset the name to an empty string). And had a headache trying to pass it to the V control character. That is, until I realised the correct way of doing it (from previous experiences with one of Otherworld's plugins) was LTN's method, which you can pass as a string directly. Amazing what a little walk in the rain does Haha!
 

LTN Games

Master Mind
Resource Team
Xy$
0.01
Good to know everything has been worked out for you.

I will now be closing this topic, if you have any reason for re-opening please report the post so a moderator can deal with it, thanks.
 
Status
Not open for further replies.
Top