Script equivalent for description text changing?

Dreadshadow

Lv 38 Tech Magician
Moderator
Joined
Mar 2, 2014
Messages
3,850
Reaction score
2,508
First Language
Greek
Primarily Uses
RMMV
Hello again.

I have an actor.

The ID is 001 (1) since I have only one.

I was browsing the whole

Script Call Equilvalent of Events

old closed thread, looking for something.

Since I could not find it out, anywhere... I thought I could ask once again for your help.

So here comes the question.

I wonder... how can I change the Actor's description text?

You know the one on the database Actor Tab you, that can be shown on Status menu window...

Can you give me a multi line script equivalent please?

I mean one that I can add a multi line text and how i can change line.

(RGSS3 is really huge... :/ )

Thanks in advance once again.

Spare me a few questions, I am still learning Ruby.

Thank God I start to understand RGSS though... :p
 

TheGreenHorse

Veteran
Veteran
Joined
Mar 31, 2014
Messages
177
Reaction score
26
First Language
English
Primarily Uses
RMMV
Check this out: $ game_party.actors [1].description as the assignment and assign itto a string. Not sure if it works.
 

Dreadshadow

Lv 38 Tech Magician
Moderator
Joined
Mar 2, 2014
Messages
3,850
Reaction score
2,508
First Language
Greek
Primarily Uses
RMMV
It doesn't seem to work.

What I actually wanna do, is to have a script command, that can change that description string... to let's say... "Hello World!"

I add some parts that might help you help me.

End of Window_Status from the core:

  #--------------------------------------------------------------------------

  # * Draw Description

  #--------------------------------------------------------------------------

  def draw_description(x, y)

    draw_text_ex(x, y, @actor.description)

  end

 

 

=================================================

 

What I was thinking was a method as:

 

def changeText(text)  

      @actor.description = text

end

 

So i can call it from EVERYWHERE as:

 

changeText("Hello World!")

 

Any ideas?

This thing above seems not working.
 
Last edited by a moderator:

Evgenij

Veteran
Veteran
Joined
Aug 28, 2013
Messages
349
Reaction score
100
First Language
German
Primarily Uses
N/A
You could make a instance variable for this:

def initialize   your_initial_stuff   @description = @actor.description  # create varible and set actor description as default valueenddef changeText(text)  @description = text refreshenddef draw_description(x, y)  draw_text_ex(x, y, @description)enddef refresh contents.clear draw_description(x, y)endI hope you get it, you need to clear the contents and redraw the text, when you change the description.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,302
Reaction score
11,900
First Language
English
Primarily Uses
RMMV
Descriptions come from $data... classes, which are generally not changed in the game, as they are static. If you change them, save your game, close, play and resume, the old descriptions will be there. If you change them and save the $data... classes to xxx.rvdata2, when you start a NEW game, you'll have the new descriptions. Otherwise, you have to start saving the $data... classes with your save file, which will blow out the size of the save file and is really not a good idea.


If you have something whose description is going to change, allocate a variable to it, and in the description put \V[X] where X is the variable number (ie: \V[15] for variable 15, not \V[0015]). Then when you want the description to change, just use a Change Variables command, and put the new description in the Script box of Change Variables. Description is saved with the game, and the $data... classes are untouched.
 

Dreadshadow

Lv 38 Tech Magician
Moderator
Joined
Mar 2, 2014
Messages
3,850
Reaction score
2,508
First Language
Greek
Primarily Uses
RMMV
So that's why...

It is a static variable... :/

Well... no, no problem...

I will try to do what I wanna do directly trying another thing.

Thanks Shaz for demystyfying this for me.

Gee here is a good feature suggestion for a future release (just for a little more polishing)... dynamic Description for status window.

Okay, Case closed I guess.

Thank you guys!

You are all awesome!

You could make a instance variable for this:

def initialize
   your_initial_stuff
   @description = @actor.description  # create varible and set actor description as default value
end

def changeText(text)
  @description = text
refresh
end

def draw_description(x, y)
  draw_text_ex(x, y, @description)
end

def refresh
contents.clear
draw_description(x, y)
endI hope you get it, you need to clear the contents and redraw the text, when you change the description.
Yes I get it, but after reading Zhaz's reply I realized that Status Description will not work properly for me.

I can always put a command on start to do a var change... but no... I thought a better way.

I could just manipulate a string variable and just forget about the status window whatsoever.

Now I wonder why I needed a Status window in the first place anyway.

I wanted only the text, something that can be sown on main window using a variable.

I guess I was too tired yesterday.

Thank you people anyway.
 
Last edited by a moderator:

TheGreenHorse

Veteran
Veteran
Joined
Mar 31, 2014
Messages
177
Reaction score
26
First Language
English
Primarily Uses
RMMV
This is called double posting- you posted directly underneath yourself. You can't double post till 72 hours. Use editing.
 

Dreadshadow

Lv 38 Tech Magician
Moderator
Joined
Mar 2, 2014
Messages
3,850
Reaction score
2,508
First Language
Greek
Primarily Uses
RMMV
I always, ALWAYS forget about that.

Steam forum has more light rules and I am not very experienced on forums.

I will try to avoid such a thing.

Meanwhile, I will also fix that. 

Oh! Now I get it...

There is also no Delete option.

My bad. My apologies.

I will try to avoid this in the future.

Thanks for mentioning that, since if nobody does, i could get into trouble.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Remember, life is sh*t. But it will difinitely be less sh*t in the future! Stay happy everyone ^^ ...*continues to die inside*
Why is it that every time I take a short break from here, we get a new moderator?
Stream will be going live early today as I will be working on some music before I transition to art! When I switch to art, I will be focusing on making a new stream avatar~ Feel free to drop by!
For anyone who has uploaded a game to Steam and wonders if they actually check your game's build when you first upload it, I can personally vouch for Steam.
6 more towns to make in my game. SIX. not done with interiors yet but SIX EXTERIORS.

Forum statistics

Threads
93,497
Messages
913,031
Members
123,035
Latest member
Crowderr
Top