• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Search function for any platform

T

tiestolord

Guest
hello dear GMakers

I browsed internet and forums i didnt find nothing for search option or function, just for windows 8.

Is it possible to make lets say just for numbers, lets say i enter number 2 and press search to go to selected room2. Or 73 for room 73...?

I trying to make something like this, specific number give you specific room or player or object.
 
R

renex

Guest
Your post is really confusing.

If you're talking about the IDE, then there's this...

upload_2017-1-28_13-49-9.png

You can also bring up a goto dialog with Ctrl-R.

If you mean cheat codes for a game, then you'll have to use get_string to ask for input and then process user input to figure out what to do.
 

Neptune

Member
Maybe something like:
Code:
Switch(user_input)
{
Case 0: room_goto(room0) break;
Case 1: room_goto(room1) break;
Case N: room _goto(roomN) break;
}
 
T

tiestolord

Guest
I searching something like Vether posted, draw code for entering in search line and to give me chossen room with that number or letter.
 
T

tiestolord

Guest
Maybe something like:
Code:
Switch(user_input)
{
Case 0: room_goto(room0) break;
Case 1: room_goto(room1) break;
Case N: room _goto(roomN) break;
}
Yea something like that but that goes in step event or? And what will be code for type in selected place to search?
 

Neptune

Member
Hmm, It would go in the step event of whatever object is controlling your room-switching.
And for "Case N:" that is symbolic for however many rooms you have: 1,2,3,4,5...N

And you would have to code an entire sequence for obtaining an user input, or create a virtual keypad -- so the player can click on-screen numbers and letters to enter in an input.

I recommend searching for a youtube tutorial on "user inputs using GML" or something.
If you find yourself struggling after trying a few things, PM me and I'll help you further.

Good-luck to you!
 
D

Docker

Guest
Are you trying to make it so the player can provide a number input and it loads that room or what? depending on what it is you are asking for there are much more elegant solutions with less typing but you're question is very vague...
 
W

Wraithious

Guest
You can just use result= get_string_async(); (where result could be any variable name u make it) put an async dialog event in an object and when you parse it use a string to put together the room name and do something like
Code:
//... get result from async
Var StringRoomToGoTo= "room"+string(result);
room=asset_get_index(StringRoomToGoTo);
 
T

tiestolord

Guest
Ill be more specific now, i wanna make coordinates system, something like entering numbers to get to specific player or room. Lets say you have to enter 3 digit number example [4:1:8]. Does numbers are given variables [galaxy : system : planet]. I already searched the internet and nothing.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
You have a clear idea of what you want to do so why not just start doing it instead of asking us to give you the codes? Break the task into chunks, like:

1) Get user input - Write how to get the user to input ONE value and store it. HINT: Look at the keyborard_string variable...
2) Expand user Input - Now expand on the above and get the user to input 3 values. HINT: Learn about arrays from the manual...
3) Parse user input - Write something that will interpret the user input and show the information, or change rooms, or whatever it is you need. HINT: Look at using "For" loops and "Switch"...

What you are asking isn't too hard to do, and it's better if you try and do it yourself and then come back to us and ask specific questions about what you are doing rather than request that we give you the whole thing. So, start by looking up how to use keyboard_string and see if you can't get a simple system for getting input (you'll probably need some of the string functions too, like string_digits to ensure only numbers are input). If you have questions, then post again!

Breaking a task down into more easily managed sections is the best way to get ahead and learn quickly, and I recommend that you get into the habit. It really does make seemingly complex issues much easier to solve.
 
T

tiestolord

Guest
You have a clear idea of what you want to do so why not just start doing it instead of asking us to give you the codes? Break the task into chunks, like:

1) Get user input - Write how to get the user to input ONE value and store it. HINT: Look at the keyborard_string variable...
2) Expand user Input - Now expand on the above and get the user to input 3 values. HINT: Learn about arrays from the manual...
3) Parse user input - Write something that will interpret the user input and show the information, or change rooms, or whatever it is you need. HINT: Look at using "For" loops and "Switch"...

What you are asking isn't too hard to do, and it's better if you try and do it yourself and then come back to us and ask specific questions about what you are doing rather than request that we give you the whole thing. So, start by looking up how to use keyboard_string and see if you can't get a simple system for getting input (you'll probably need some of the string functions too, like string_digits to ensure only numbers are input). If you have questions, then post again!

Breaking a task down into more easily managed sections is the best way to get ahead and learn quickly, and I recommend that you get into the habit. It really does make seemingly complex issues much easier to solve.
Yea you are right, i even tryed to make my own codes but the problem was with search fuction, i dont want to someone write a code for me but to give help, because someone will help tgis post one day
 
T

tiestolord

Guest
You could use reflection.
Quick introductory video

Name you room something lime room_x_y_z

Then if the player inputs (4,5,6), you can build the string room_4_5_6 and look for it.

In the video I show how to find scripts, but there *should* be the same functions for rooms.
Not bad, ill give it a try
 
Top