Jump to content
Sign in to follow this  
Meep007

Change Item Desciption

Recommended Posts

Does anyone know if there's a script out there where you can change the description of an item in-game, like after a quest?

That's what I want to use it for. I want to update an item after a quest is completed. I'm sure this has probably been asked before.

Is it even possible?

 

 

Thanks in advance :)

Edited by Meep007

Share this post


Link to post
Share on other sites

I think you may be able to use this command

 

$data_items[id].description = "new description"

 

Edit: I tested it doesn't work,I will lookf for something else

Edit 2 : It works,I messed up my testing setup

Edited by Shiggy

Share this post


Link to post
Share on other sites

Hmm, it's a little weird but I got it to kind of work.

 

It counts every line written in the script as a line in the description. For example, since I can't fit much on one line:

 

$data_items[23].description = "This strange
gem was given to me by my father when I was
young."

 

This cuts off the "young" since the description box in-game fits only 2 lines. "This strange" is also the only thing that shows on the first line. It looks really weird. Writing it like this however:

 

$data_items[23].description =
"This strange gem was given to me by my

father when I was young."

 

Sort of fixes it, but now there's a huge blank space in the description.

 

Let me know if you find out something else. If not, I guess I'll have to live with it.

 

Thanks, Shiggy. :)

 

EDIT: Well now you said you got it to work, so I don't know...I guess I'll live with it.

Edited by Meep007
  • Like 1

Share this post


Link to post
Share on other sites

Use this script

 module NewDescriptions
String1 = " This strange gem was given to me by my father when I was young. "
end

and use this command 

$data_items[23].description = NewDescriptions::String1

  • Like 2

Share this post


Link to post
Share on other sites

Thanks, Shiggy :)

 

This spaces everything out a lot better.

 

This topic can close now.

Share this post


Link to post
Share on other sites

9RWO0dm.pngThis thread is closed, due to being solved. If for some reason you would like to re-open this thread, just send me a PM. (=

Share this post


Link to post
Share on other sites

ZOJxAAR.png This thread is reopened, because it seems, that other member has something important to add. (=

Share this post


Link to post
Share on other sites

I've already told the OP through pm, but figure I'd say this here as well for anyone who may find this thread. Using this method will change the description for sure, however, that description will remain until the game is closed. This means that even if you load up a new game after just having the description change in a save file the change will remain even on the brand new game. Since this will reset when the game is closed it isn't viable for long periods of use where you don't know if the player will be on the whole time.

  • Like 1

Share this post


Link to post
Share on other sites

I wrote a script that check the value a game variable when loading the game to update the item description if necessary

 

 

 

 

module DataManager
	class << self
		alias description_load_game_without_rescue load_game_without_rescue
		def load_game_without_rescue(index)
			description_load_game_without_rescue(index)
			if $game_variables[99] == 0               #change the conditions here
				$data_items[23].description = NewDescriptions::String1
			end
                         # add conditions for more items here
		end          
	end
end

 

 

Edited by Shiggy

Share this post


Link to post
Share on other sites

Okay, I tried this new script and it didn't fix this new issue when loading a new game. Also, when I tried to load a game I saved for testing this, one before the description change occurred, the screen froze and I had to restart the game. The only thing that didn't freeze was the music in the background.

 

Maybe I'm not using it right, possibly, I don't know. :unsure:

 

Any further advice/instructions would be appreciated.

 

Thanks :)

Share this post


Link to post
Share on other sites
module DataManager
	class << self
		alias description_load_game load_game
		def load_game(index)
     
			if $game_variables[0] == 1
				$data_items[23].description = NewDescriptions::String1
			end

			description_load_game(index)

      
    end
  end
end

Try this script instead and don't forget to set up the game variable when you change the description

  • Like 1

Share this post


Link to post
Share on other sites

 

Try this script instead and don't forget to set up the game variable when you change the description

 

 

I set up the variable, but maybe I did something wrong?

 

I can now load the games without any freezing though, so at least something changed. (I tested it a few times last time, and it happened each time)

 

Unfortunately, the description change is still permanent even if I load an earlier save, or start a new game.

Share this post


Link to post
Share on other sites

Ok I took my timeto make sure everything is fine. This should do it now:

module DataManager
    class << self
        
          def reload_items
            $data_items         = load_data("Data/Items.rvdata2")
          end
           
          alias description_setup_new_game setup_new_game
          def setup_new_game
            reload_items
            description_setup_new_game
          end
    end
  
end
  
class Scene_Load < Scene_File

  alias description_on_load_success on_load_success
  def on_load_success
    DataManager.reload_items
    if $game_variables[0] == 1
         $data_items[23].description = NewDescriptions::String1
    end
    description_on_load_success
  end
  
end 
  • Like 1

Share this post


Link to post
Share on other sites

Got an error when adding item to inventory, so I can't test if it worked or not.

 

Script 'Game_Party' line 251: ArgumentError occured

comparison of NilClass with 1 failed

 

I'm just going to like your comments from now on because I don't get notifications of comments to my topics and I don't know if it's the same for you.

Edited by Meep007
  • Like 1

Share this post


Link to post
Share on other sites

I have no idea how the script I gave you is affecting this + I was ableto test it myself and had no issue

Edit : Also check the settings for your notifications options . I don't care because I look what's new on the main page very often

Edited by Shiggy
  • Like 1

Share this post


Link to post
Share on other sites

Yeah, I have no idea either. The game just won't let me have the item anymore. I tried to get it from a store instead and it gave me an error to this:

 

  #--------------------------------------------------------------------------
  # * Determine if Maximum Number of Items Are Possessed
  #--------------------------------------------------------------------------
  def item_max?(item)
    item_number(item) >= max_item_number(item)
  end

 

It won't even let me have any other items...what the flip?

 

May have to call it quits on this because it doesn't seem that I'll ever get it to work. :(

Share this post


Link to post
Share on other sites

Have you tried in a fresh project ?

Can you try to use this scrpt command somewhere
msgbox_p($game_items[23])
and tell me what you get

Share this post


Link to post
Share on other sites

It prints exactly that in the game text box.

 

When I start a new game I don't have this problem. Maybe some weird script conflict? O_o

 

I also noticed that if I restart the game all changes are reverted back again in any saves.

Edited by Meep007
  • Like 1

Share this post


Link to post
Share on other sites

Sry it's $data_items not $game_items


I also noticed that if I restart the game all changes are reverted back again in any saves.

 

It works perfectly work for me 

 

Edit: Can you send me screenshot of all your events ?

Do you have other scripts installed?

Edited by Shiggy
  • Like 1

Share this post


Link to post
Share on other sites

It already had $data_items.

 

If I changed it to $game_items, the item crashing problem stopped, but now the changes revert when loading a save and not just restarting the engine.

 

Help, Shiggy...my brain hurts :mellow:

 

PS: I don't want to keep you awake so

 

EDIT: Yes I have others. This might take a bit, so we can continue this tomorrow if you want.

Edited by Meep007

Share this post


Link to post
Share on other sites

If it's a compatibility issue I would need you to send me the whole project ,send me a PM when you have time

  • Like 1

Share this post


Link to post
Share on other sites

I checked for any that I could think would effect this and it ended up being this one:

 

Yanfly Engine Ace - Adjust Limits v1.00

 

Kinda makes a little sense to me since since it sent me here.

 

#--------------------------------------------------------------------------
  # * Determine if Maximum Number of Items Are Possessed
  #--------------------------------------------------------------------------
  def item_max?(item)
    item_number(item) >= max_item_number(item)
  end

 

But that's just a hunch, I'm not a scripter so...

Limits Script.txt

Edited by Meep007
  • Like 1

Share this post


Link to post
Share on other sites

I know where the issue is,turn this line into a comment 

def max_item_number(item); return item.max_limit; end

in the limits script

 

I will look for a fix tomorrow

  • Like 1

Share this post


Link to post
Share on other sites

Replace the reload_items method in the script I gave you with this

def reload_items
    $data_items         = load_data("Data/Items.rvdata2")
    for obj in $data_items
       next if obj.nil?
       obj.load_notetags_al
    end
end

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted