How to: Learn Skills based on Job and Level requirements ?
#1
Posted 30 October 2012 - 04:03 AM
Now to my question:
Im in the progress of creating a Final Fantasy XI like skill system where charakters (that can have a variety of 8 selectable different jobs) learn new skills through the use of certain scrolls (items). My idea to do this is creating some item that calls a common event. In the common event there have to be 3 things happen: 1. check if the one that is using the item meets the job requirement; 2. check if he meets the level requirement and if the conditions before are complied 3. learn the skill.
If i have only one character this is easy to do and i got it working as intended. If however there are more possible characters i cant imagine how to do this in some elegant way. Is there a way to avoid having to write the common event to check all 8 charakters for there job and there level (what makes 64 possibilities in total) or is it possible to tell the game only to check the users conditions ? If i could do this, i also would not have the problem i got when 2 charakters meet the requirements at the same time (as checking all 8 characters for jobs and levels would learn the skill to both of them).
If there is a script or something that could do this in some more comfortable way, i did not find it through my search or my imagination wasnt good enough what that script can do. So any help with this would be appreciated.
#2
Posted 30 October 2012 - 09:35 AM
1. add a common event effect using this script: http://www.rpgmakerv...vator-outdated/ (actually I might have to modify this script to better handle common event arguments)
2. Use this script to setup common event arguments: http://www.rpgmakerv...vent-arguments/
3. And then in your common event, you would make conditional checks using the common event arguments.
For example,
In step 1, you would call a specific common event (eg: 4).
In step 2, you would store the user's ID as well as the user's class ID as common event arguments (eg: [user.id, user.class.id]
In step 3, you would use a conditional branch
if $game_temp.cevent_args[1] == 3 # Soldier class ID $game_actors[$game_temp.cevent_args[0]].learn_skill( ... )
Of course this is not very nice to type...
Edited by Tsukihime, 30 October 2012 - 09:35 AM.
End Phase Triggers | Effect Manager | Feature Manager | Note Manager | Tag Manager | Event Wrapper | Custom Database | Command Manager
More scripts at
#3
Posted 30 October 2012 - 09:47 AM
#4
Posted 30 October 2012 - 10:00 AM
cant be handled more easily and comfortable
Sure there are other ways to do it with some clever event
Suppose you have two actors Eric and Natalie, and three common events.
Common event 1:
set variable 1 = eric's actor ID (1)
set variable 2 = eric's class ID
set variable 3 = skill ID to learn
call common event 3
Common event 2:
set variable 1 = natalie's actor ID (2)
set variable 2 = natalie's class ID
set variable 3 = skill ID to learn
call common event 3
Common event 3:
if variable 2 == ? script_call: $game_actors[variable 2].learn_skill(variable 3)
Actually you know what I will write something to make this easier later.
Edited by Tsukihime, 30 October 2012 - 10:03 AM.
End Phase Triggers | Effect Manager | Feature Manager | Note Manager | Tag Manager | Event Wrapper | Custom Database | Command Manager
More scripts at
#5
Posted 30 October 2012 - 10:29 AM
Actually you know what I will write something to make this easier later.
That would be nice. Its not that im not willed to work me into something (i havent bothered to modify scripts myself except replacing some translations). But when over hundred skills need to be written any short way to do it is a big help especally when it comes for troubleshooting later on.
#6
Posted 30 October 2012 - 10:40 AM
End Phase Triggers | Effect Manager | Feature Manager | Note Manager | Tag Manager | Event Wrapper | Custom Database | Command Manager
More scripts at
#7
Posted 30 October 2012 - 10:48 AM
You will probably still have to make 100's of items for each skill though, although they would call the same common event.
Creating a few hundred database entries for items, skills and gear is not the problem , even if it is a lot work. And im aware that i still will have to create one item for every skill to learn : )
Edited by Saphirweapon, 30 October 2012 - 10:49 AM.
#8
Posted 30 October 2012 - 06:52 PM
I simply combined everything up there into one script.
This is a special common event call that allows you to store the person that called the event, the target (because you are likely going to use an item on someone), the item that was used, as well as some arguments.
So for example, if you use the a book on someone, your target will be the person that you want to check (if you use it on yourself, then target == user)
In your case, you would pass in the ID of the skill that you want to learn.
So suppose your learning common event was 4, and you wanted to learn skill 9, with a class ID requirement of 2.
You would tag your item with
<eff: common_event 4 9 2>
(order of arguments does not matter as long as you remember which order you put them)
Then in your common event you would use a conditional branch
$game_temp.event_target.class.id == $game_temp.event_args[1]
And then if that is true, you would use a script call
$game_temp.event_target.learn_skill($game_temp.event_args[0])
If you want level requirements you just need to check the level as well.
Edited by Tsukihime, 30 October 2012 - 07:01 PM.
End Phase Triggers | Effect Manager | Feature Manager | Note Manager | Tag Manager | Event Wrapper | Custom Database | Command Manager
More scripts at
#9
Posted 31 October 2012 - 04:39 AM
So i copied the two scripts and taged some item as described. Also copied the two other lines into some Conditional branch. When now using the item i got the following error message: Script "Common Event" Line 98: NoMethodError occured. undefinded method "map" for 0.0 Float
So i guess i missed something ?
#10
Posted 31 October 2012 - 05:32 AM
I changed the script to use the tag "common_evt" instead of "common_event"
End Phase Triggers | Effect Manager | Feature Manager | Note Manager | Tag Manager | Event Wrapper | Custom Database | Command Manager
More scripts at
#11
Posted 31 October 2012 - 05:46 AM
#12
Posted 31 October 2012 - 05:48 AM
End Phase Triggers | Effect Manager | Feature Manager | Note Manager | Tag Manager | Event Wrapper | Custom Database | Command Manager
More scripts at
#13
Posted 31 October 2012 - 05:56 AM
#14
Posted 31 October 2012 - 09:41 AM
Just do simple tests by printing out each reference
p $game_temp.event_target p $game_temp.event_target.class.id p $game_temp.event_args[1] ...
And you should see in your console the appropriate values.
And if one of them isn't printing out then you know there is an issue there.
Edited by Tsukihime, 31 October 2012 - 09:41 AM.
End Phase Triggers | Effect Manager | Feature Manager | Note Manager | Tag Manager | Event Wrapper | Custom Database | Command Manager
More scripts at
#15
Posted 02 November 2012 - 08:53 AM
I won't have access to RM until 10 hours later.
Just do simple tests by printing out each referencep $game_temp.event_target p $game_temp.event_target.class.id p $game_temp.event_args[1] ...
And you should see in your console the appropriate values.
And if one of them isn't printing out then you know there is an issue there.
Well i`m sorry but as a beginner i dont know how to work with a console and i couldnt find something about this the last minutes.
A picture of the common event how it is supposed to look like would be the best help. Thanks in advance for it : )
#16
Posted 02 November 2012 - 09:13 AM

If you get a new copy of the common event effect plugin you can shorten some of the things to this:
Edited by Tsukihime, 02 November 2012 - 09:38 AM.
End Phase Triggers | Effect Manager | Feature Manager | Note Manager | Tag Manager | Event Wrapper | Custom Database | Command Manager
More scripts at
#17
Posted 02 November 2012 - 10:56 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











