——— — Before you ask! Read! ;) —
You must have 30+ Posts to create a topic here!
— Thanks for reading! — ———
|
The Script Builders' Help Topic, Get General Script Support Here. |
|
|
|
|
Nov 25 2009, 03:47 PM
|

B★RS Coding Ninja

Group: Global Mod
Posts: 1,414
Type: Scripter
RM Skill: Advanced
Rev Points: 15

|
The Script Builders' Help Topic - Refuge for scripters everywhere, get your problems sorted here. - IntroductionWelcome to the Script Builders' Help Topic. If you have come to this topic, you are probably looking for help with a script you have found, or are making. Well this is the aim of this topic. The Script Builders will try their hardest to help you out with buggy script errors that you may encounter, or maybe you have a question about a function like how to display an item's name from a script. Well all you'll need to do is follow the simple rules and fill in the request form which are found further on. RulesHere are just a few rules to help keep this much easier. Please do not pressure us. Once we have recieved your request, we will work on it and will work in the order that we have recived the scripts in. So please be patient. Also, this is a must: do not spam this topic, this is a serious topic that we have created to bring you the most support we can, if you want to spam please do it in the Off-Topic Cesspool. One more rule, please be kind to the Script builders as we are giving up our spare time to try and help your own problems, we won't have a go at you if it's something very simple, but saying that we do not expect you to have a go at us if we get it wrong. Thank you for following and reading these rules. Request FormTo help us to help you more efficently, try and follow the form bellow to give us the most infomation about the error or question you need. Form:Link to Script Topic (If needed):(If not the above)Actual script:Error or problem you have encountered (Please explain in as much detail as you can, screen shots of the error work wonders):ConclusionPlease post your request here in this topic, or if you think its urgent, you may PM the following people. - Legacy - The Law G14 - Night_Runner - Night5h4d3 - JuanPlease try to explain your problem in full detail, this will make it faster to find the problem. Also, when PMing either of the above members, please try to use the form above. Thank you - Legacy -
This post has been edited by Legacy: Nov 12 2012, 01:35 PM
__________________________
|
|
|
|
|
|
|
|
 |
Replies
|
|
Dec 10 2009, 05:17 PM
|

Level 11

Group: Revolutionary
Posts: 171
Type: Developer
RM Skill: Advanced

|
QUOTE (The Law G14 @ Dec 10 2009, 02:05 PM)  This is a rough draft of what I have so far. Just make an event and go to the third page of the list of event commands and click Script. Type in this code: CODE $scene = Scene_Cooking.new To change what variable the item is stored in, go to line 81 of the script. Hope I was at least kind of close lol: CODE #============================================================================== # ** Scene_Cooking #------------------------------------------------------------------------------ # This class performs cooking screen processing. #==============================================================================
class Scene_Cooking #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main # Make help window, item window @help_window = Window_Help.new @cooking_window = Window_Cooking.new # Associate help window @cooking_window.help_window = @help_window # Execute transition Graphics.transition # Main loop loop do # Update game screen Graphics.update # Update input information Input.update # Frame update update # Abort loop if screen is changed if $scene != self break end end # Prepare for transition Graphics.freeze # Dispose of windows @help_window.dispose @cooking_window.dispose end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update windows @help_window.update @cooking_window.update # If cooking window is active: call update_cooking if @cooking_window.active update_cooking return end end #-------------------------------------------------------------------------- # * Frame Update (when item window is active) #-------------------------------------------------------------------------- def update_cooking # If B button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Switch to menu screen $scene = Scene_Map.new return end # If C button was pressed if Input.trigger?(Input::C) # Get currently selected data on the item window @item = @cooking_window.item # If not a use item unless @item.is_a?(RPG::Item) # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # If it can't be used unless $game_party.item_can_use?(@item.id) # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Play decision SE $game_system.se_play($data_system.decision_se) $game_variables[1] = @item $scene = Scene_Map.new # If command event ID is valid if @item.common_event_id > 0 # Command event call reservation $game_temp.common_event_id = @item.common_event_id # Play item use SE $game_system.se_play(@item.menu_se) # If consumable if @item.consumable # Decrease used items by 1 $game_party.lose_item(@item.id, 1) # Draw item window item @item_window.draw_item(@item_window.index) end # Switch to map screen $scene = Scene_Map.new return end end return end end
#============================================================================== # ** Window_Cooking #------------------------------------------------------------------------------ # This window displays cooking items in possession. #==============================================================================
class Window_Cooking < Window_Selectable #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 64, 640, 416) @column_max = 2 refresh self.index = 0 end #-------------------------------------------------------------------------- # * Get Item #-------------------------------------------------------------------------- def item return @data[self.index] end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] # Add item for i in 1...$data_items.size if $game_party.item_number(i) > 0 @data.push($data_items[i]) end end # If item count is not 0, make a bit map and draw all items @item_max = @data.size if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 32) for i in 0...@item_max draw_item(i) end end end #-------------------------------------------------------------------------- # * Draw Item # index : item number #-------------------------------------------------------------------------- def draw_item(index) item = @data[index] case item when RPG::Item number = $game_party.item_number(item.id) end if item.is_a?(RPG::Item) and $game_party.item_can_use?(item.id) self.contents.font.color = normal_color else self.contents.font.color = disabled_color end x = 4 + index % 2 * (288 + 32) y = index / 2 * 32 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) bitmap = RPG::Cache.icon(item.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, 212, 32, item.name, 0) self.contents.draw_text(x + 240, y, 16, 32, ":", 1) self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2) end #-------------------------------------------------------------------------- # * Help Text Update #-------------------------------------------------------------------------- def update_help @help_window.set_text(self.item == nil ? "" : self.item.description) end end Works perfectly up until i pick an item in the inventory prompt, then it errored out. Also the icon for the item showed up but not the name ????? 'Cooking' ? 94 ??? NoMethodError ??????? undefined method 'index' for nil:NilClass
__________________________
|
|
|
|
|
|
|
Posts in this topic
LegacyX The Script Builders' Help Topic Nov 25 2009, 03:47 PM The Law G14 Great work on this Legacy
I fixed all the little... Nov 25 2009, 06:01 PM LegacyX hmm, no requests? None at all... Nov 27 2009, 09:54 AM The Law G14 Hey, no requests at all? Any feedback or ideas for... Dec 3 2009, 01:27 PM dummy1234 I'm not really sure if this question belongs h... Dec 4 2009, 06:29 AM Darkreaper If youre answering questions i have 3
Would it be... Dec 4 2009, 10:43 AM The Law G14 @Dummy: Hm, that seems like something really diffi... Dec 4 2009, 06:22 PM Darkreaper awesome, where would i install that? Dec 4 2009, 08:41 PM Night_Runner Darkreaper? I remember Charlie Lee & Ty tried ... Dec 5 2009, 02:54 AM Darkreaper wow thats awesome Dec 5 2009, 12:29 PM The Law G14 So you got all your questions answered Darkreaper ... Dec 5 2009, 12:33 PM Darkreaper QUOTE (The Law G14 @ Dec 4 2009, 06:22 PM... Dec 5 2009, 01:02 PM The Law G14 Sorry for the late response, but does this item sc... Dec 6 2009, 04:16 PM Darkreaper well id prefer it if it was only "cookable... Dec 6 2009, 07:45 PM The Law G14 Yeah, that's possible so I'll try to get t... Dec 7 2009, 01:51 PM Darkreaper Sweet, thatd be of great help Dec 7 2009, 01:58 PM The Law G14 This is a rough draft of what I have so far. Just ... Dec 10 2009, 02:05 PM Zeriab @Dummy:
Assuming you mean whether it's possibl... Dec 11 2009, 07:50 AM The Law G14 @Darkreaper: Did you put weapons or armor in there... Dec 11 2009, 01:43 PM Darkreaper QUOTE (The Law G14 @ Dec 11 2009, 01:43 P... Dec 11 2009, 03:33 PM The Law G14 Ah, I found out what the problem is, just change t... Dec 11 2009, 05:55 PM Darkreaper QUOTE (The Law G14 @ Dec 11 2009, 05:55 P... Dec 11 2009, 06:45 PM The Law G14 That's weird, it should be displaying the item... Dec 11 2009, 06:52 PM Darkreaper QUOTE (The Law G14 @ Dec 11 2009, 06:52 P... Dec 12 2009, 12:31 AM The Law G14 The cooking event. Also, I've got around makin... Dec 12 2009, 08:10 AM Darkreaper drew this error soon as i tried to cook something
... Dec 12 2009, 01:34 PM The Law G14 Did you put in the game variable for the string of... Dec 12 2009, 01:44 PM Darkreaper oh whoops :S so wait, what? which ones which? im c... Dec 12 2009, 02:48 PM The Law G14 First of all, I've updated the script a little... Dec 12 2009, 03:22 PM Darkreaper ok, very interesting outcome now, when i go to coo... Dec 12 2009, 04:14 PM The Law G14 Weird, just send me a demo of your project via PM ... Dec 12 2009, 05:02 PM Darkreaper how do you upload an attachment into a pm? Dec 13 2009, 12:54 AM The Law G14 Sadly, you can't have any attachments in PMs s... Dec 13 2009, 06:24 AM tagg1080 I am sure you guys would appreciate the necro-post... Jan 8 2010, 08:57 AM The Law G14 Well, you got the syntax for variables a little wr... Jan 8 2010, 02:38 PM tagg1080 QUOTE (The Law G14 @ Jan 8 2010, 05:38 PM... Jan 8 2010, 05:14 PM The Law G14 Then put above that line, this:
CODEx = $gam... Jan 8 2010, 06:00 PM tagg1080 RE: The Script Builders' Help Topic Jan 8 2010, 06:36 PM Night_Runner The problem is that $game_variables isn't... Jan 10 2010, 09:45 PM tagg1080 QUOTE (Night_Runner @ Jan 11 2010, 12:45 ... Jan 13 2010, 04:02 PM  Fixxxer4153 QUOTE (tagg1080 @ Jan 13 2010, 07:02 PM) ... Feb 7 2010, 07:29 AM Darkreaper In RM2k and 2k3 there were the options to swap til... Jan 24 2010, 09:56 AM Holder I'd like to make a suggestion for a future tut... Jan 24 2010, 11:50 AM Darkreaper yeah, now if only i read hiragana Jan 24 2010, 12:49 PM The Law G14 @Darkreaper: So do you still need the script lol?
... Jan 24 2010, 04:02 PM Darkreaper QUOTE (The Law G14 @ Jan 24 2010, 04:02 P... Jan 24 2010, 06:04 PM The Law G14 Populate script? Try posting it and I'll see w... Jan 25 2010, 02:11 PM Darkreaper [Show/Hide] Script#===============================... Jan 25 2010, 06:25 PM mikesp86 i'm getting an error with rpg advpcates two ha... Apr 4 2010, 08:53 AM Night_Runner What are you putting in for: @two_handed_weapons =... Apr 4 2010, 11:39 PM mikesp86 im using [9,10,11,12,13,14,15,16]
i have several ... Apr 5 2010, 07:32 AM Mataris How can I get a script to recongize what terrian t... May 20 2010, 07:47 PM Night_Runner You could run something like this:
return unless ... May 22 2010, 05:35 AM Mataris QUOTE (Night_Runner @ May 22 2010, 05:35 ... May 22 2010, 10:59 AM Scriptless CODEclass Scene_Title < Scene_Base
def start
... May 22 2010, 10:38 AM Night_Runner Glad I could help May 23 2010, 01:06 AM voodooKobra I'm trying to store the event ID of the event ... Sep 14 2010, 10:55 AM Zeriab In a script call you can use this:
$game_vari... Sep 16 2010, 01:02 AM 54tan666 Hey guys,
i have a very easy question (witch is st... Nov 2 2010, 10:14 AM Ed_Ross_Dont_Care @54tan: If you want a really quick and dirty way ... Jan 19 2011, 03:09 PM Ruuku [Show/Hide] The original post
I don't feel ... May 25 2012, 08:38 AM djskagnetti Having trouble with Charlie Fleed's Equipment ... May 29 2012, 04:30 PM
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
RPG RPG Revolution is an Privacy
Policy and Legal
|
|