Save-Point
Getting ride of a script for good - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Games Development (https://www.save-point.org/forum-4.html)
+--- Forum: Code Support (https://www.save-point.org/forum-20.html)
+--- Thread: Getting ride of a script for good (/thread-389.html)



Getting ride of a script for good - Werehog5 - 04-03-2010

Lets say i put a script in the beginning of the game right where you start. so after you leave the place, you go back to it and the same script replays. How do i make so the script on plays once no matter what? SOS!!!Shocked


Getting ride of a script for good - PK8 - 04-03-2010

Moving this to RGSS support.


Getting ride of a script for good - Boot - 04-03-2010

Could you elaborate a little? Are you saying you've made an event and you don't want that event to repeat itself, or you've called a script? Try and explain a little more so someone can help you. Take screen shots if necessary.


Getting ride of a script for good - fgsfds - 04-03-2010

It seems like he uses a script that supposed to do something to an event, or something graphical, and he want's to get rid of it afterwards, only making it appear whenever he wants to.
I'm sorry, but it some scripts (Most likely on almost all of them), you can't get rid of them unless the script has the instruction on how to remove it, usually done by a script command I believe.
Best bet is to work your way around it or remove it, unless someone has a bright idea.


Getting ride of a script for good - PK8 - 04-03-2010

I'm really not sure if I can help as I'm not too good of a scripter compared to the other guys, but I'm assuming he wants a script to do something to a particular map once.

What the scripter may need to do is create some sort of an instance variable which would act as an array, or maybe a hash. Yeah, maybe hashes would work better than arrays since they're more precise.
Code:
@variable = {} #instance variable is a hash.

Afterwards, the scripter would need to create an if condition somewhere, which may look something like this (I could be very much wrong, as I'm pretty rusty in scripting):
Code:
if @variable{$game_map.map_id} != true
  # The script does something here.
  @variable[$game_map.map_id] = true
end

Werehog5 just needs to tell us what script(s) he's using, that way it'll help us help him faster.