General RGSS/RGSS2/RGSS3 Help

Started by G_G, March 04, 2009, 12:14:28 am

Previous topic - Next topic

Dundora

January 06, 2011, 05:07:46 pm #500 Last Edit: January 06, 2011, 05:08:49 pm by Dundora
Hmm, I just tested it, and it turns out im doing something wrong.

Spoiler: ShowHide



Ryex

January 06, 2011, 05:22:33 pm #501 Last Edit: January 06, 2011, 05:28:07 pm by Ryex
I'm not sure why you would want to, but here you go.

set up the shop goods
[code]
$game_temp.shop_goods = [
[0,1], [1,1], [2,1]
]

pattern goes
[TYPE,ID], [TYPE,ID], [TYPE,ID]

where type is 0, 1 or 2 meaning item, weapon, or armor respectively and ID is the items id in the database.
then call the shop
$scene = Scene_Shop.new



EDIT: darn blizz beat me to the punch. ah well my example is slightly different[/code]
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Dundora

well i gues i shouldhv just said this in the first place, but i was hoping i could call it during batle,....why didnt i say that in the first place.....

anywya if i cant call it during a battle i gues ill need to find someone to make me a script.

nathmatt

January 06, 2011, 05:34:20 pm #503 Last Edit: January 06, 2011, 05:38:35 pm by nathmatt
when you call Scene_Shop and you want to make it custom call it like this
$scene = Scene_Shop.new([[0,1]]) if you made that some kind of global variable could add to it when ever you wanted say using $game_variables[1] first you need to make it an array  $game_variables[1] = []
now you can just use $game_variables[1].push([0,1]) and call it like this $scene = Scene_Shop.new($game_variables[1]) that should work
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Ryex

Quote from: nathmatt on January 06, 2011, 05:34:20 pm
when you call Scene_Shop and you want to make it custom call it like this
$scene = Scene_Shop.new([[0,1]]) if you made that some kind of global variable could add to it when ever you wanted say using $game_variables[1] first you need to make it an array  $game_variables[1] = []
now you can just use $game_variables[1].push([0,1]) and call it like this $scene = Scene_Shop.new($game_variables[1]) that should work


don't listen to him, Scene_Shop dose not take any arguments so this will only give you errors.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

nathmatt

January 06, 2011, 05:42:11 pm #505 Last Edit: January 06, 2011, 05:46:31 pm by nathmatt
use ryex's code it should work  :^_^':
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Blizzard

And especially don't use $game_variables for that kind of thing.

If "$game_temp.shop_goods.clear" is giving you an error, use "$game_temp.shop_goods = []" instead.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

nathmatt

y not ? Does it really mater what use the $game_variables for ?
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Dundora

Thanks all off you guys :D

after some tries i got it workign like this:
Spoiler: ShowHide




now to see if i cn call this during battle.

Blizzard

If you call it during battle, it will abort the battle and restart it after you return to the battle scene.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Dundora

January 07, 2011, 04:52:08 am #510 Last Edit: January 07, 2011, 04:57:27 am by Dundora
Yeah your right, its alright though i already firgured somethign else out :)
thanks again.

Edit: i  now need an other piece of script thoug, i need one that makes the player use an item that is in the inventory without actually going to the menu, so its used when talking to an event for example.

nathmatt

ok i using array.each{|word|text.gsub!("#{word}") {replace}} the only problem is i want it to remove the word no matter how its capitalized in the text 
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


ForeverZer0

array.each{|word|text.downcase.gsub!("#{word}") {replace}}

Define the words as all lower case words.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Blizzard

That won't work. The original text will never be modified but only the copy that gets returned by downcase.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

nathmatt

i figured out a way the entire word gets replaced so if crap is filtered fcrap gets replaced too but i can live with that because i added the non_filtered array to fix words so that you can put scrap
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


ForeverZer0

Quote from: Blizzard on January 08, 2011, 03:10:42 pm
That won't work. The original text will never be modified but only the copy that gets returned by downcase.


I didn't think of that. You ay have to go with Regular Expressions.
Do the old [Cc][Rr][Aa][Pp].
This is going to hamper performance a bit though, especially if it is checking for a lot of words.

I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Blizzard

Actually it's a lot simpler than that. Use a regular expression with the word as exact sequence and just turn on the option for case insensitive. I'm not sure, but I think it was \i or /i. Check out Z's tute on regex.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

ForeverZer0

Quote from: Blizzard on January 08, 2011, 03:46:42 pm
Actually it's a lot simpler than that. Use a regular expression with the word as exact sequence and just turn on the option for case insensitive. I'm not sure, but I think it was \i or /i. Check out Z's tute on regex.


I figured there was an easier way than what I showed, but I couldn't remember. I never did memorize all the commands and syntaz of regexpr. I always just looked up what I needed for any given situation.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Blizzard

I don't know all possibilities of regex by memory either. I know the general stuff and look up the details when I need them.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Zeriab

I don't remember either  :shy:
The reference part of my tut I actually wrote for myself. >_>

*hugs*