Conversation Between Colbex and Maruno
Showing Visitor Messages 1 to 8 of 8
  1. Maruno
    July 1st, 2010 2:01 PM
    That's... I didn't follow any of that. I'm just glad I found the answer before having to wade through all that thinking it might help.

    I've also extensively modified the scripts too to incorporate a different control style (sorry, no spoilers, but it's good!), so it may have been that any answers wouldn't have helped me in my situation anyway.
  2. Colbex
    June 30th, 2010 3:38 PM
    well you see good sir... o.o;;
    @Maruno: I copied your piece of code into my scripts and commented mine out. I tested giving, taking, canceling out of giving an item, and giving/taking mail. All of it worked fine. Then I tried giving it straight from the bag screen which is where I found your error. It's this one, correct?
    Exception: NameError
    Message: undefined local variable or method `ret' for #<PokemonScreen:0x999df68>
    PokemonScreen++:998:in `pbPokemonGiveScreen'
    PokemonBag++:1038:in `pbStartScreen'
    PokemonBag++:1035:in `pbFadeOutIn'
    PokemonBag++:1035:in `pbStartScreen'
    PokemonBag++:961:in `loop'
    PokemonBag++:1053:in `pbStartScreen'
    PokemonMenu+++:172:in `pbStartPokemonMenu'
    PokemonMenu+++:171:in `pbFadeOutIn'
    PokemonMenu+++:171:in `pbStartPokemonMenu'
    PokemonMenu+++:140:in `loop'

    I'm not sure if you noticed, but it's not just giving mail that will give you that error. I can't really tell you how to fix it, but I think it has something to do with how items/mail are given from PokemonBag and the cmdGive function that's used. yours may be a bit different, but here's where I think the hang up is at.
    def pbStartScreen
    loop do
    [email protected]
    break if item==0
    ---Skips a few lines talking about pockets---
    itemname=PBItems.getName(item) # Get item name
    [email protected](_INTL("{1} is selected.",itemname),commands)
    if cmdUse>=0 && command==cmdUse
    # ret==0: Item wasn't used; ret==1: Item was used
    if ret==2 # End screen
    elsif cmdCheck>=0 && command==cmdCheck
    elsif cmdTag>=0 && command==cmdTag # Berry tag
    elsif cmdRegister>=0 && command==cmdRegister # Register key item
    elsif cmdGive>=0 && command==cmdGive # Give item to Pokémon
    if $Trainer.pokemonCount==0
    @scene.pbDisplay(_INTL("There is no Pokémon."))
    elsif pbIsImportantItem?(item)
    @scene.pbDisplay(_INTL("The {1} can't be held.",itemname))
    # Give item to a Pokémon
    elsif cmdToss>=0 && command==cmdToss
    [email protected](item)
    helptext=_INTL("Toss out how many {1}(s)?",itemname)
    [email protected](helptext,qty)
    if qty>0
    if pbConfirm(_INTL("Is it OK to throw away {1} {2}(s)?",qty,itemname))
    pbDisplay(_INTL("Threw away {1} {2}(s).",qty,itemname))
    qty.times { @bag.pbDeleteItem(item) }
    return item
    I can't actually script in RGSS but my intuition tells me that since ret is handled differently in the bag screen yet the function in the bag calls your edited version of it. The ret's clash or something and causes the problem. I'm 100% not sure if this is correct but hopefully it helped you a litte. =\

    After this deduction it soon occurred to me that the original version did the exact same thing. At this point I was saying crap repeatedly as I had already pressed submit. (your part was beneath the other two folks). Luckily it didn't go through, so I didn't look like an idiot. o-o; I mean... I guess I could just edit the post out but then it looks suspicious... Anyway, after further deduction I realized a lot of things are handled with the aforementioned cmd thingies and their ret thingies and my intuition is severely flawed.........or I'm just a little stupid. o-o On a side note however, reading my submission in a sherlock holmes accent makes it that much funnier.
  3. Maruno
    June 29th, 2010 9:45 AM
    Humour me...
  4. Colbex
    June 28th, 2010 12:18 PM
    actually my work is something more along the lines of comedy... o-o;;
  5. Maruno
    June 28th, 2010 9:50 AM
    I solved it just now, actually, while replying to you. Turns out Ruby is weird, and if a variable is defined within a block (e.g. a "do" loop), then it becomes undefined again once you exit that block. The solution is to define the variable before the "do" loop begins (i.e. copy the line "ret=false" to before the "do" loop), and then it'll be usable after the loop finishes.

    It's not a bug as such, because sometimes programmers will want to use that property of blocks (e.g. use the same name for two different variables, one of which is in-loop only and the other is out-of-loop only), but in those cases I think it's just bad programming style.

    I considered this possibility before, but I dismissed it because it was a stupid thing for Ruby to do. Turns out that's how it works.

    So yeah, it's fine now. Thanks for the offer of help anyway. Might be interested to see what you came up with, though, if you want to PM me your working.
  6. Colbex
    June 27th, 2010 9:14 PM
    hey, did you ever figure out that problem you were having with your "give" or w/e? The one you posted in general game making help? o.o bc... I tried to pay you back by attempting to solve the mystery using my lackluster detective skills and making a big post, only to realize a few seconds afterwards im an idiot. anywho... the point is even though more than likely im way off your free to read my theory. just tell me. XD I save large posts to my notepad, which is good in this case as it didn't go through, therefore i didnt look like a dumbass over the entire game development thread. o.o; im sorry, at late night I get awfully talkative rather than tired...
  7. Maruno
    May 27th, 2010 7:02 AM
    No problem. Just pass on the good deed, if you can.
  8. Colbex
    May 26th, 2010 7:24 PM
    Hey, just thought I'd drop by and say, "You are the man, and thanks for the help with the battle scene." You literally just saved me loads of time and from frustration... a lot of frustration... like... the "Go curse people out on Youtube for making stupid/racist comments just because you're already mad yourself frustration". No lie.

All times are GMT -8. The time now is 8:02 PM.