I'm trying to figure out a way to create a text input that displays, saves, and can be changed.
Basically, a variable i can stick text into, and then call up to display.
So far the closest I've gotten is something like this:
(inside Script window on page 3 of events)
$game_temp.message_text = "hi"
followed by a control self switch to move out of this loop. (otherwise it loops endlessly).
I tried using specific variables like
$game_temp.message_text = $data_actors[1].character_name
but it causes my icon to delete and calls me 'fighter 001" or some such.
I'm not sure if this can be done with pure eventing, eventing with script references, or if its pure scripting.
I'm confused about something. Do you want the player to be able to actually input text, or do you just want some text stored in a variable?
for what I'm doing, whichever is easier. I need to be able to save the names of maps/areas, either literally as they are saved in the map directory, or giving an option for players to describe them with a fill in the blank option similar to input number.
Can't you do this by using a name input then converting that into a variable?
example:
call a name impute for actor some ID (its temp) after that is over use a script command:
$game_variables[id] = $game_actor[same id as before].name
i know there there is probably more that your asking, but this is how to set a variable to a string that the player sets.
Name input has a max of 12 characters, so I don't really think it's what he wants :-\
i want something like this, but working:
conditional branch...[something]
Script: $game_variables[1] = map_id
Else
Branch End
conditional branch...[something else]
Script: $game_temp.message_text = $game_variables[1]
Else
Branch End
Basically, a way of saving the name of the map you are currently on, and calling it later in a message text.
Couldn't you just write the name of the map that the player is currently in, in the text box?
So say the character is in Grassy Plain. You could just go Show Text: Grassy Plain.
Or do you want something more complicated then that?
data_maps = load_data("Data/MapInfos.rxdata")
$game_variables[ID] = data_maps[$game_map.map_id].name
that work?
also to show this in a message just use \v[ID].
Quote from: Mr_Wiggles on May 15, 2010, 04:02:14 PM
data_maps = load_data("Data/MapInfos.rxdata")
$game_variables[ID] = data_maps[$game_map.map_id].name
that work?
also to show this in a message just use \v[ID].
tried this:
$game_variables[36] = $data_maps[$game_map.map_id].name
$game_temp.message_text = $game_variables[36]
got an error. I'm guessing[$game_map.map_id] is supposed to be specific. I want it to query what the current map is and save it.
That's not what he asked you to do - what he was suggesting is correct. Do what he told you to do and access it in a message by \v[id].
The reason you are getting an error is because you put a $ in front of data_maps - Map Info is not saved in a global variable though - you have to load it first, which is what the first line Wiggles used was for and which you omitted.
So, do what Wiggles told you to do exactly, and it should work.
Lol Modern, Mr. Wiggles edited his script around a bit. So Shin was just following commands.
PROOF:
« Reply #7 on: Today at 11:02:14 AM »
« Last Edit: Today at 11:05:56 AM by Mr_Wiggles »
Well, what Shintashi quoted from Wiggles in his post is correct, so assumedly he must have seen the modified post prior to posting. Anyway, it's not a big deal either way.
still doesn't work. Tried it four or five different ways, with a number in ID and without.
QuoteScript:data_maps = load_data
("Data/MapInfos.rxdata")
$game_variables[1] = data_maps
[$game_map.map_id].name
Script:\v[ID]
causes an "undefined local variable or method 'data maps' for #<Interpreter..." error
Quotedata_maps = load_data
("Data/MapInfos.rxdata")
$game_variables[ID] = data_maps
[$game_map.map_id].name
causes a 0 for 1 error
Quotedata_maps = load_data
("Data/MapInfos.rxdata")
by itself causes an error
even
Quotedata_maps = load_data
crashes..
they all end up saying the same thing: wrong number of arguments (0 for 1)
a = load_data("Data/MapInfos.rxdata")
$game_variables[1] =
a[$game_map.map_id].name
Text: \v[1]
Works...
EDIT: Lol, the script box wasn't big enough to hold the code data_maps = load_data("Data/MapInfos.rxdata").
lol...
Yea i find that problem allot, if the code doesn't fit on the line, and is cut up then you get a syntax. You have to make it fit on one line some how. or carry over by a space where you can ( = > < all those things)
Yeah, cozzie is right - it needs to fit on one line.
Also, you put it in an in-game message, not in a script line, so:
Text: This map's name is \v[1].
Not
Script: \v[1]
well it looks like it works, but only for what it does. How do I get the computer to remember the map name as a variable, and call that variable as text later?
For example, if I walk south and want the NPC to say "You came from the northern forest"
Right now it just says "You came from 0" because the v[1] sets back to 0, I'm guessing.
Serious? It worked for me.
Are you sure you put in the call script:
a = load_data("Data/MapInfos.rxdata")
$game_variables[1] =
a[$game_map.map_id].name
And then you used the Show Text command with:
This map is \v[1].
Quote from: cozziekuns on May 15, 2010, 08:17:38 PM
Serious? It worked for me.
Are you sure you put in the call script:
a = load_data("Data/MapInfos.rxdata")
$game_variables[1] =
a[$game_map.map_id].name
And then you used the Show Text command with:
This map is \v[1].
totally. Now make a second map and link them with transfer player events.
talk to the first sprite with the above code, then place
That map was \v[1].
inside a new sprite on the new map. The computer does not remember what v[1] is.
How are you setting the variable?
cause if the script command is not run it wont set the variable. You can make it set it in the transfer player, or a corner event that is set to parallel.
a = load_data("Data/MapInfos.rxdata")
$game_variables[1] =
a[$game_map.map_id].name
Text: \v[1]
Returned MAP001.
Transfered player to MAP002.
Text: \v[1]
Returned MAP001. You're probably doing something wrong...
Demo attached.
yep, typo on my part ^^ i had v[2] instead of v[1]