Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: nathmatt on March 19, 2008, 03:38:10 pm

Title: [RESOLVED] quick rgss or event question?
Post by: nathmatt on March 19, 2008, 03:38:10 pm
is there a way to change events name when say var=1
Title: Re: quick rgss or event question?
Post by: Fantasist on March 19, 2008, 03:48:00 pm
I think there is. Try this:

module RPG
  class Event
   
    ID = 1
   
    def self.name
      if $game_variables != nil
        nm = case $game_variables[ID]
        when 1 then 'blah'
        when 2 then 'blah2'
        else
          @name
        end
        nm
      end
    end
   
  end
end


set ID to the variable ID. Place it anywhere above Main.
Title: Re: quick rgss or event question?
Post by: nathmatt on March 19, 2008, 07:18:30 pm
how do i call it
Title: Re: quick rgss or event question?
Post by: Nortos on March 19, 2008, 11:36:07 pm
u dnt need to just when variable number 1 atm is set to 1 it is called blach and when number 1 is set to 2 it's called blah2
Title: Re: quick rgss or event question?
Post by: Fantasist on March 20, 2008, 04:48:54 am
Yes, it's a configuration. Make a nice extension to work with multiple variables if you HAVE to use the feature more then once at a time.
Title: Re: quick rgss or event question?
Post by: nathmatt on March 20, 2008, 03:31:05 pm
???  so how does this change an event on the maps name for a abs
Title: Re: quick rgss or event question?
Post by: Fantasist on March 20, 2008, 10:21:27 pm
You just set up the name(s) in the config. ID is the id of the variable you want to change to change the name. It's like this:
when variable with id (ID) is 1, then name is 'blah' (or anything you like)
So put this script anywhere above main and just change the variable in-game.

...but there's a catch to this I overlooked. The names of ALL the events will change when you change the variable. So it's not right... I'll think of something else tomorrow, I'm a bt busy atm and gtg, sorry.
Title: Re: quick rgss or event question?
Post by: nathmatt on March 21, 2008, 04:14:55 pm
that alright i can wait just a sugestion put to tell it what events to change maybe do what bliz did with his eneies on his abs maybe make it if events name = \r
Title: Re: quick rgss or event question?
Post by: Fantasist on March 23, 2008, 12:30:24 am
1. Okay, this is confusing. The purpose, what exactly do you need this for? You're using some sript which displays event names on map, and you want to change the name real-time during gameplay?
2. I'm not that good in this area, actually I'm pretty bad. Be prepared for the situation that I might not be able to help you.
Title: Re: quick rgss or event question?
Post by: nathmatt on March 23, 2008, 10:25:32 am
actually im using bliz abs so with this type of script i could change almost anything by changing its name since thats what his abs looks at
Title: Re: quick rgss or event question?
Post by: Fantasist on March 24, 2008, 01:54:27 am
Oh... tough one... I guess I might not be able to help you. why don't you post this in the Blizz-ABS topic too?
Title: Re: quick rgss or event question?
Post by: nathmatt on March 24, 2008, 08:49:51 pm
ill try that
Title: Re: quick rgss or event question?
Post by: Blizzard on March 25, 2008, 11:47:27 am
Actually that won't work. The name is checked only when the map is entered (otherwise it would lag). Changing the name of an event won't do anything. I suggest you use clone events and switches.
Title: Re: quick rgss or event question?
Post by: nathmatt on March 26, 2008, 03:53:33 pm
clone events ?
Title: Re: quick rgss or event question?
Post by: Blizzard on March 26, 2008, 03:57:02 pm
Yes, you simply use another event. Let's say you want an enemy to turn into a lifeless object. Instead of changing the name, you simply turn on a switch that makes the enemy vanish and the object appear. You can simply use event switch preconditions for that.
Title: Re: quick rgss or event question?
Post by: nathmatt on March 26, 2008, 04:12:15 pm
yea but ther problem there is if u have to many dummy events it lags i tryed that once tried to do that and use the trade event to but it always freezes on me
Title: Re: quick rgss or event question?
Post by: Blizzard on March 26, 2008, 04:16:56 pm
It freezes? That's weird. Have you tried it on a map with just a few events? Maybe the freezing is not the fault of the number of events, but a bug in Blizz-ABS...

EDIT: Alright, how about the possibility to change the event's name in-game? This would be reset after re-entering the map, though.
Title: Re: quick rgss or event question?
Post by: nathmatt on March 26, 2008, 04:47:20 pm
i would use it like a star oceon battle so the first event would  when hero touch teleport me to a map & change a varible to a number which would make my 3 event
a monster so all i would have to do is make a certain map for each type of terrain unstead of for each monster also is there a way on ur abs monster to make them where the will run at me then let me use the when hero touch condition
Title: Re: quick rgss or event question?
Post by: Blizzard on March 27, 2008, 05:14:53 am
Yes, but making the enemy event code run by touch or by button was a bug in an earlier version, not a wanted feature. That's why I removed it.
Hm, I think it's possible to figure something out that should work if you are able to use renaming commands together in a parallel process. Or maybe somebody wants to make a plugin for Blizz-ABS that allows a Star Ocean Battle System. xD
Title: Re: quick rgss or event question?
Post by: nathmatt on March 27, 2008, 07:31:25 am
here was my idea how 1 would work

http://forum.chaos-project.com/index.php?topic=614.0
Title: Re: quick rgss or event question?
Post by: nathmatt on March 27, 2008, 08:17:30 am
even tho i really wouldn't need that could be done with conditon branch and events mainly haveing trouble with the name thing and the enemy running at me when i get in a certain range to teleport me
Title: Re: quick rgss or event question?
Post by: Blizzard on March 27, 2008, 08:28:39 am
Wouldn't it be a better idea to use normal events for the running events instead of enemies?
Title: Re: quick rgss or event question?
Post by: nathmatt on March 27, 2008, 01:15:40 pm
how would i do that
Title: Re: quick rgss or event question?
Post by: Blizzard on March 27, 2008, 01:37:24 pm
Simply use event that move toward the player if the player is within range. You can store the x and y coordinates into variables and compare them.
Title: Re: quick rgss or event question?
Post by: nathmatt on March 27, 2008, 02:32:49 pm
k ill try that

k how do i compare them
Title: Re: quick rgss or event question?
Post by: Blizzard on March 28, 2008, 07:07:00 am
You can use the "Operate variable" command to store values into variables. Simply compare their difference with some values that you need. Use conditional branches.
Title: Re: quick rgss or event question?
Post by: Fantasist on March 28, 2008, 09:08:00 am
Okay, here's something useful for comparing ranges:
http://forum.chaos-project.com/index.php?topic=79.0