New account registration is temporarily disabled.

RINE'S PROFILE

Game designer hopeful. Have designed several tabletop RPGs, and have long wanted to start into the video game space.

My focus when designing is to create challenging experiences that force the player to make difficult choices, and change the paradigm when someone thinks of an RPG.
Binding Wyrds
A modern fantasy game, delving into the shadows of the supernatural.

Search

Filter

[Scripting] Stuck in a while loop

Oh, I had no idea that was any different. Weird little 'should work fine's keep tripping me up :P Thanks so much for taking the time to look at it.

[Scripting] Stuck in a while loop

Oh wow, I must have really borked up the code :(

https://drive.google.com/file/d/0B4_pL7t6QETEaDIzWGVCbFo1dWs/view?usp=sharing

There's the link to the compressed project. Its in VXACE, lemme know if I need to include the RTP with it.

[Scripting] Stuck in a while loop

Nope, its set to action button.

[Scripting] Stuck in a while loop

Did so, and it basically did this endlessly.



I'm calling this from an event in game, after doing some test setting (setting all mission completed's to 1 so they can be read), and before calling a scene window to have the player select them. Here is the snippet from the event:

$mission[0].finish(1)
$mission[1].finish(1)
$mission[2].finish(1)

missionListCreate

SceneManager.call(Scene_MissionSelect)

The $mission adjusts, mission list create, and mission select are different script lines, but contiguous, if that matters.

Edit: If its any help, during my testing, I commented out all the ifs except for the one if ... == 0, and got the same results.

[Scripting] Stuck in a while loop

Hey all, this one is definitely more in the code-funk territory and less in the high end RPG Maker, but I've been staring at this code for hours with no progress, and would be infinitely grateful if I could get a few extra eyes on it to see what might be the issue.

The code for this is basically going to loop through a list of missions, check them for certain variables, and add them to an accessible list that will get displayed for mission select. Note, before this function is called, I have a set of missions created with location 0 (So they should all get loaded), and all of them have been set to completed = 1 through a function inside them. However, when this code is ran, the entire thing locks up, meaning we're probably stuck in that while loop.

class Game_Interpreter
  def missionListCreate
    #Clean out the list of any old entries
    $mission_list.clear
    #Get the size of the mission array.
    @size = $mission.size
    #Where are we in the array
    @index = 0
    #Determines if location 1 is already full
    @loc1 = 0
    #Determines if location 2 is already full
    @loc2 = 0
    #Determines if location 3 is already full
    @loc3 = 0
    #Determines of location 4 is already full
    @loc4 = 0
    #Determines if we're done
    @done = 0
    #Determines current location in the $mission_list array
    @current = 0
    #Holder for the location of $mission.location
    @currentloc = 0
    #Start our loop
    while @done == 0
      #Check to see if the mission is available, which is value 1 on completed
      if $mission[@index].completed == 1
        #Set the location of the mission.
         @currentloc = $mission[@index].location
          #Check to see if location of the mission is 1
          if @currentloc == 1
            #See if any other missions have been there on this list
            if @loc1 == 0
              @loc1 = 1
              $mission_list[@current] = $mission[@index]
              @current += 1
            end
          end    
          #Check to see if location of the mission is 1
          if @currentloc == 2
            #See if any other missions have been there on this list
            if @loc2 == 0
              #Set location as used, add mission, increment location in mission 
              # list
              @loc2 = 1
              $mission_list[@current] = $mission[@index]
              @current += 1
            end
          end
          #Check to see if location of the mission is 1
          if @currentloc == 3
            #See if any other missions have been there on this list
            if @loc3 == 0
              #Set location as used, add mission, increment location in mission 
              # list
              @loc3 = 1
              $mission_list[@current] = $mission[@index]
              @current += 1
            end
          end
          #Check to see if location of the mission is 1
          if @currentloc == 4
            #See if any other missions have been there on this list
            if @loc4 == 0
              #Set location as used, add mission, increment location in mission 
              # list
              @loc4 = 1
              $mission_list[@current] = $mission[@index]
              @current += 1
            end
          end
          #check if there is no location set.
         if @currentloc == 0
           #Add mission, increment location in mission list
              $mission_list[@current] = $mission[@index]
              @current += 1
          end 
        end  
      #Make sure we're not going past the size of $mission  
      if @size == @index + 1
        @done = 1
      end
      #Make sure we're not adding more than 5 missions
      if $mission_list.size == 5
        @done = 1
      end
      #Increment where we are in $mission
      @index += 1
    end
  end
end


If any one has any ideas, please let me know, I know its probably something derpingly simple and I just can't see it because I wrote it :P

[RMVX ACE] Closing a Menu after a script

I'm pretty sure at this rate, every piece of my code will be up on these forums.

So, custom menu working out fine so far. Now we need to have them select a mission, and port them to that area. Sounds good right? Except...I can't seem to do that without locking the game up. I think I'm calling my menu closing wrong, but the method handler for close menu isn't working, and my custom calls aren't working either. Both times they leave me with a blurred/black background, and no change to the new location

class Scene_MissionSelect < Scene_MenuBase
  def start
    super
    @list_window = Window_MissionList.new(0, 0, 200)
    @list_window.set_handler(:cancel,  method(:return_scene))
    @list_window.set_handler(:ok,     method(:select_mission))
    @desc_window = Window_MissionDesc.new(@list_window, 200, 0, Graphics.width - 200, Graphics.height - 200)
    @desc_window.viewport = @viewport
  end
  
  def select_mission
    @list_window.item.goto
    @list_window.deactivate
    @list_window.close
    @desc_window.deactivate
    @desc_window.close
    dispose_background
    $game_temp.fade_type = 0
    $game_player.reserve_transfer($game_variables[1], $game_variables[2], 
    $game_variables[3], $game_variables[4])
    Graphics.update
  end
end

I've looked at various other custom menu codes, and I believe I'm doing the same thing they do, but all I end up doing is locking the game up. Probably doing this horribly inefficiently as well, since the menus kinda cut apart when they're closed.

Edit: Solved. Totally didn't realize you could just call return_scene without the cancel method handler.

[RMVX ACE] draw_text creating odd overlapping text.

I actually changed every value, to see what was going on with it. The y didn't matter, nor did the height/width, etc etc. I actually went ahead to make things easier and started using KilloZappit's wrapping message windows script, so I don't have to hand linebreak every description.

[RMVX ACE] draw_text creating odd overlapping text.

Thanks for the help, didn't realize it was that complicated just to get the thing to write a single long line of text and wrap it.

Thanks for your help!

[RMVX ACE] draw_text creating odd overlapping text.

No problem, I figure its that as well. If there's anything I keep getting tripped up over its silly, stupid little mistakes :P

Edit: As a note, went back and triple checked, tried \n, \\n, \r, //n, and /n, no luck

[RMVX ACE] draw_text creating odd overlapping text.

Yeah, I came across that while I was looking as well. Unfortunately that particular one is using puts, which we don't use in VXACE, at the level I'm at at least, and the same one also suggested the \\n line breaks, which did nothing to my output.