Chaos Project

RPG Maker => RPG Maker Scripts => Topic started by: MarkHest on June 19, 2012, 12:51:10 am

Title: MarkHest wants to learn RGSS!
Post by: MarkHest on June 19, 2012, 12:51:10 am
Hi, just resently i started learning RGSS to make scripts for RMXP. This topic is practically just a 'help' topic for myself whenever i need help with something that has to do with scripting.
I made this topic so that i don't have to create a 'new' topic for every single question i have(there will be a few...) and that i only have to create a post here instead.
I will always look for help in the 'help' file for RGSS first before i ask question. So if i post a question here it is one of the following reasons: I am too stupid to find the answer, the answer did not exist, i understand parts of the answer but i need to know more.

So yeah, let me start with the first question:
I know i can use $game_map.events[ID].moveto(0, 0) to move events on a map, but what do i write to select the 'event in process' instead of an event ID. Meaning, move the event i am placing the ScriptCall in.

Question two: And the other queston is the same but i want to move the player instead of an event.

I just want to know what to write instead of events[ID].
Title: Re: MarkHest wants to learn RGSS!
Post by: G_G on June 19, 2012, 12:55:35 am
character = get_character(character_type)
character.moveto(x, y)


Substitute "character_type" for one of the following:
-1 = The player.
0 = The current event that's processing the script call
Alternatively, you can also replace "character_type" with an actual event id.

EDIT: Also throwing this out there, we have a thread for general questions and whatnot.
http://forum.chaos-project.com/index.php/topic,2966.0.html
Title: Re: MarkHest wants to learn RGSS!
Post by: MarkHest on June 19, 2012, 01:13:48 am
So it should look like this if i want to move the event in process?
$game_map.character = get_character(0).moveto(0, 0)


or maybe like this?
$game_map.character = get_character(0)
$game_map.character.moveto(x, y)


:O.o:

*Tests it out*
edit: error :(

and about your help topic, i'd rather have a separate topic where i can keep track of what i am doing.
Title: Re: MarkHest wants to learn RGSS!
Post by: KK20 on June 19, 2012, 01:23:53 am
Literally, copy and paste that code G_G provided into a script call within an event and change the placeholder parameters with actual values. And watch the magic work~  :D

You can look up 'Interpreter 2' and scroll to the bottom where it says 'def get_character(parameter)' if you want to understand the code more.
Title: Re: MarkHest wants to learn RGSS!
Post by: MarkHest on June 19, 2012, 01:32:32 am
Oh, thank you G_G and KK20!
Worked perfectly! :)

I never said i was a 'total' beginner and that my knowledge is very limited.
More stupid quesions will show up in the future :^_^':
Title: Re: MarkHest wants to learn RGSS!
Post by: MarkHest on July 01, 2012, 02:16:22 pm
Okay! NEW QUESTION!

I just resently took on the task to try and make a new option in the menu, by doing this i switched the 'Save' option to a new option called 'Info'.
So i wanted this new option in the menu to be called 'Info'. I just have a few questions about the few commands that i can't seem to understand.

First off we have the Window Command. I've seen @help_window = Window_Help.new in nearly every Scene_Menu script and wonder what this command is and what it does. Why is it named 'help'? What is a 'help window'?
Title: Re: MarkHest wants to learn RGSS!
Post by: G_G on July 01, 2012, 02:51:13 pm
The help window gives information about RPG data in various scenes.

Scene_Skill
- It's what displays the Skill's description.
Scene_Item
- It's what displays the Item's description.
Scene_Equip
- Weapon/Armor description.
Scene_File/Save/Load
- Telling you what slot to choose
Scene_Battle
- Displays Skill description
- Displays Item description
- Displays battler name when choosing target
- Displays the Skill or Item that's getting used at the moment.
Title: Re: MarkHest wants to learn RGSS!
Post by: MarkHest on July 01, 2012, 03:20:07 pm
Oh! That explains a lot :D
Thanks ^^