RINE'S PROFILE
Rine
1378
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.
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.
Search
Filter
[RMVX ACE] Calling a custom scripted class through an event.
And of course, when one solution is achieved, another pops up, though I think this one should be simple, and is down to my lack of full syntax understanding of Ruby.
I have changed a few things in the script, so now .goto just returns all the variables for a proper player transport. However, when I call it, it seems to think the array locator is a method.
The error I'm getting is:
The whole thing compiles fine, so I assume its just in my event call. Here is my event as of now:
Just in case I'm wrong though, here's what I changed in the Data Manager:
And the adjusted Mission class
Edit: Of course, as soon as I posted this, I saw my major error, I was calling Mission in the script, instead of $mission, derp.
Now its saying I'm returning an incorrect number of arguements, the error is as follows:
Which sounds like to me $mission.goto is returning only one argument to the player port script, but I'm not sure how to change it so it returns all the factors correctly without calling multiple scripts.
I have changed a few things in the script, so now .goto just returns all the variables for a proper player transport. However, when I call it, it seems to think the array locator is a method.
The error I'm getting is:
Script Game Interpeter line 1411: NoMethodError occurred
undefined method '[]' for Mission:Class
The whole thing compiles fine, so I assume its just in my event call. Here is my event as of now:
$game_temp.fade_type = 0
$game_player.reserve_transfer($mission[0].goto)
Just in case I'm wrong though, here's what I changed in the Data Manager:
#Mission Array
$mission = Array.new
$mission[0] = Mission.new(1, 10, 10, 10, 8, 0)
$mission[1] = Mission.new(2, 20, 20, 20, 8, 0)
$mission[2] = Mission.new(3, 90, 5, 17, 8, 0)
#$mission[next number] = Mission.new(mapID, threat, xstart, ystart, dir, location)
#######
# Mission
# A class for creating/holding missions for selection in the mission menu.
#######
class Mission < Game_Interpreter
def initialize(map, threat, startx, starty, dir, location)
@completed = 0
#Unfound [0], Found [1], Completed [2] or Failed [3]
@map = map
#Map ID
@startX = startx
#X start location
@startY = starty
#Y Start Location
@threat = threat
#The threat this map adds to an area if failed
@dir = dir
#Direction player starts facing
@location = location
#Which locale it is in. [0] = None, [1-4] Bureu areas
end
#returns the map id
def map
@map
end
#returns the threat
def threat
@threat
end
#returns whether this was completed
def completed
@completed
end
#changes completed variable
def finish(var)
@completed = var
end
#returns where we're going
def goto
return @map, @startX, @startY, @dir
end
end
Edit: Of course, as soon as I posted this, I saw my major error, I was calling Mission in the script, instead of $mission, derp.
Now its saying I'm returning an incorrect number of arguements, the error is as follows:
Script 'Game_Interpreter' line 1411: ArgumentError occurred.
wrong number of arguments (1 for 3)
Which sounds like to me $mission.goto is returning only one argument to the player port script, but I'm not sure how to change it so it returns all the factors correctly without calling multiple scripts.
[RMVX ACE] Calling a custom scripted class through an event.
Would work, check completed, if its 0, its not discovered yet. If its 1, its discovered and can show up on the mission list, if its 2, its been completed successfully (and thus can be checked for linked missions), if its 3, its been failed and won't activate further missions.
[RMVX ACE] Calling a custom scripted class through an event.
I suppose that would work actually, since I will have the missions predefined to a degree (They'll each be seperate maps as such), and will just be available when a certain event activates them. I guess I could have the event reference the array and flip a switch to have them 'active'.
[RMVX ACE] Calling a custom scripted class through an event.
Well, while I'm sure that would work to get it to compile, creating the object in the data manager would only create one specific instance of it. I need this script to create a reference to a map, start location, etc, when an event is triggered, so I can reference it with another scene later. Basic idea being, event A is triggered, creates Mission A, later on scene is opened and player can choose Mission A, B, C, etc.
[RMVX ACE] Calling a custom scripted class through an event.
Well, the key is I want to make sure the Mission object is created correctly. I'm doing a simple script call to check and make sure its returning the right variable. Later, I'll be assigning these into an array of 'available' missions, and and allowing players to select them (hence the start coords, so I can just port them right to the map in question).
[RMVX ACE] Calling a custom scripted class through an event.
So, tried both, with the game interpreter as a superclass of mission and without. For both attempts, I get:
Script 'Game_Interpreter line 1411: NameError occured.
undefined local variable or method 'alley' for #<Game_Interpeter:0x8b67990>
So I'm gathering for whatever reason, its not realizing what 'alley' is.
Script 'Game_Interpreter line 1411: NameError occured.
undefined local variable or method 'alley' for #<Game_Interpeter:0x8b67990>
So I'm gathering for whatever reason, its not realizing what 'alley' is.
[RMVX ACE] Calling a custom scripted class through an event.
Well, that's where probably my other fundamental lack of understanding is. I don't really know how to call the class we just created that's titled alley. I've tried Mission.alley.goto, and alley.goto. The first line of the script should create an 'alley' Mission, and I'm trying to call the 'goto' function of that 'alley'.
Edit: The error its returning now is:
Script 'Game_Interpreter line 1411: NameError occured.
undefined local variable or method 'alley' for #<Game_Interpeter:0x8b67990>
Probably another thing really simple I'm borking up.
Edit: The error its returning now is:
Script 'Game_Interpreter line 1411: NameError occured.
undefined local variable or method 'alley' for #<Game_Interpeter:0x8b67990>
Probably another thing really simple I'm borking up.
[RMVX ACE] Calling a custom scripted class through an event.
I figured I had to make it a sub-class somewhere, but didn't know the appropriate place.
Weirdly, as soon as I inherit the Game interpreter class, I immediately get a syntax error related to the end of the script and my end command. No syntax errors before, so its making me wonder what the hell happened there.
Side note: For things you want to call in events, should they all be inheriting Game_interpreter?
Edit: Ah ha, need < Game_Interpreter, not < Class Game Interpreter
Weirdly, as soon as I inherit the Game interpreter class, I immediately get a syntax error related to the end of the script and my end command. No syntax errors before, so its making me wonder what the hell happened there.
Side note: For things you want to call in events, should they all be inheriting Game_interpreter?
Edit: Ah ha, need < Game_Interpreter, not < Class Game Interpreter
[RMVX ACE] Calling a custom scripted class through an event.
So, this will probably be uber silly to most people here, but for the life of me I can't figure out how to do this.
I have a class script that creates missions for use later by creating a class with the map id, starting location on the map, and a variable i'll use later.
So, when I call this script through an event to create a mission, no errors whatsoever. When I try to check the variables by calling the created mission to return a string, I get "Script 'Game_Interpreter line 1411: NoMethodError occurred. undefined method 'alley' for Mission:Class'
Obviously, I'm not calling the created class correctly in the event, but I don't know how to tell the game to look at that class first before recognizing the name (alley in this case). Probably uber simple and I'll bang my head once someone points it out...
Here is the event script I'm using:
Any help would be appreciated, thanks!
I have a class script that creates missions for use later by creating a class with the map id, starting location on the map, and a variable i'll use later.
#######
# Mission
# A class for creating/holding missions for selection in the mission menu.
#######
class Mission
def initialize(map, threat, startx, starty)
@completed = 0
#Whether its hasn't been tried yet (0), completed (1) or failed (2)
@map = map
#Map ID
@startX = startx
#X start location
@startY = starty
#Y Start Location
@threat = threat
#The threat this map adds to an area if failed
end
#returns the map id
def map
@map
end
#returns the threat
def threat
@threat
end
#returns whether this was completed
def completed
@completed
end
#changes completed variable
def finish(var)
@completed = var
end
#returns where we're going
def goto
@string = "@map, @startX, @startY"
@string
end
end
So, when I call this script through an event to create a mission, no errors whatsoever. When I try to check the variables by calling the created mission to return a string, I get "Script 'Game_Interpreter line 1411: NoMethodError occurred. undefined method 'alley' for Mission:Class'
Obviously, I'm not calling the created class correctly in the event, but I don't know how to tell the game to look at that class first before recognizing the name (alley in this case). Probably uber simple and I'll bang my head once someone points it out...
Here is the event script I'm using:
@Script: alley = Mission.new(1, 10, 10, 10)
@Script $game_variables[10] = Mission.alley.goto
Text: -, -, Normal, Bottom
:\V[10]
Any help would be appreciated, thanks!
The Bad End
I feel Bad Ends tends to be another way of saying a Game Over, just in a longer term fashion. I find the best games with Bad Ends have them as true endings, just with consequences for your actions during the game. A good example are the Ogre Battle games, where if you completely crush enemies, act like an unrighteous bastard, and flip towns to get cards, then let them get flipped to get more, in the end you are viewed as just as bad as the people you overthrew.
Not having them be binary is also very important. If its just one choice at the end, it just feels like you made a wrong choice and you should do it over, not as a series of choices leading to a result.
Not having them be binary is also very important. If its just one choice at the end, it just feels like you made a wrong choice and you should do it over, not as a series of choices leading to a result.













