jkingery25

Villager
Member
Joined
Aug 10, 2013
Messages
8
Reaction score
4
First Language
English
Primarily Uses
I know this has been mentioned before, but the scripts that were mentioned don't seem to work. I want to be able to teach my characters to use a Magic spell through a book. But only those who can use the Magic or those who don't already have the spell can learn it.
Does anyone have the updated script on how to do this with a common event?

P.s. If I just do learn skill through an item, it will teach it to anyone, even if they cant use magic. Thus wasting the item.
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
2,146
Reaction score
659
First Language
English
Primarily Uses
N/A
Hold on, I'll look at conditional branches in events and see if I can come up with something

Edit: ok i think i thought of something. The item adds a state then calls a common event; some characters are immune to the state.
It then goes through conditional branches checking each member of the party. If they have the state, it adds the skill, removes the state and does nothing. If no one has the state, it says "This person can't use this item." and nothing else happens
 

Dwesper

Veteran
Veteran
Joined
Mar 9, 2022
Messages
49
Reaction score
93
First Language
French
Primarily Uses
RMMV
1•Go in Common Event

2•Pick a blank common event

3•Do a conditional branch

4•Go to actor section.

5•Chose which character you want to give the skill.

6•Click else.

7•Put the skill you want to add to your specific character.

8•Put in Else "This party member cannot learn this skill."

9•Put the common event in the effects of the item.

10• Choose if the item is consumable or not.
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
2,146
Reaction score
659
First Language
English
Primarily Uses
N/A
1•Go in Common Event

2•Pick a blank common event

3•Do a conditional branch

4•Go to actor section.

5•Chose which character you want to give the skill.

6•Click else.

7•Put the skill you want to add to your specific character.

8•Put in Else "This party member cannot learn this skill."

9•Put the common event in the effects of the item.

10• Choose if the item is consumable or not.
But how will the game know which character the item was used on? You need to add a marker state for that. They want the option for multiple people using it, but your solution doesn't include that
 

Dwesper

Veteran
Veteran
Joined
Mar 9, 2022
Messages
49
Reaction score
93
First Language
French
Primarily Uses
RMMV
But how will the game know which character the item was used on? You need to add a marker state for that. They want the option for multiple people using it, but your solution doesn't include that

Sorry, here is a optional upgrade.

•Do first a choices option.

•Put all the characters ID codes or the names.

•Do conditional branch to all characters.

•Or simply give the skill to which character you want without making it complicated.
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
2,146
Reaction score
659
First Language
English
Primarily Uses
N/A
Sorry, here is a optional upgrade.

•Do first a choices option.

•Put all the characters ID codes or the names.

•Do conditional branch to all characters.

•Or simply give the skill to which character you want without making it complicated.
Doing a choice ironically complicates things. what if a certain character isn't in the party when they use it? they'll have to do branch after branch of conditions.

But having the item add a state, and some characters being immune to the sate and having the event go over each character and check if they have the state adding it that way (while removing the state) is a much simpler way to handle it then choices

Edit: the state would of course have to be removed afterwards
 

Dwesper

Veteran
Veteran
Joined
Mar 9, 2022
Messages
49
Reaction score
93
First Language
French
Primarily Uses
RMMV
Doing a choice ironically complicates things. what if a certain character isn't in the party when they use it? they'll have to do branch after branch of conditions.

But having the item add a state, and some characters being immune to the sate and having the event go over each character and check if they have the state adding it that way (while removing the state) is a much simpler way to handle it then choices


... I like complicated stuff

•Add a variable that is added to your main event then..

Like, if your main character is starting and do magic.

Variable: Magic Party member= 1

Then you are two magic users.

Variable: Magic Party Members = 2

• Book demands in a conditional branch variable to reach 2
Or else.

You cannot.

• Then give the spell to to character of your choice.
 

jkingery25

Villager
Member
Joined
Aug 10, 2013
Messages
8
Reaction score
4
First Language
English
Primarily Uses
The other thing that complicates this is I give the main character a choice of weather they are a fighting class or magic class. So I can't target the main character as someone who can use the spell unless they have the ability to use magic. I need something that targets characters who have that particular skill set, and not by name, if possible.
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
2,146
Reaction score
659
First Language
English
Primarily Uses
N/A
The other thing that complicates this is I give the main character a choice of weather they are a fighting class or magic class. So I can't target the main character as someone who can use the spell unless they have the ability to use magic. I need something that targets characters who have that particular skill set, and not by name, if possible.
with what i suggested. You can add a state that makes the charecter immune to the marker state in the choice if they dont choose magic

and by making some charectrs immune to the marker state and putting a message that says "this cant be used on that charecter", it does target the subset. Though ill try to think of a system thats not by name
 
Last edited:

jkingery25

Villager
Member
Joined
Aug 10, 2013
Messages
8
Reaction score
4
First Language
English
Primarily Uses
Hold on, I'll look at conditional branches in events and see if I can come up with something

Edit: ok i think i thought of something. The item adds a state then calls a common event; some characters are immune to the state.
It then goes through conditional branches checking each member of the party. If they have the state, it adds the skill, removes the state and does nothing. If no one has the state, it says "This person can't use this item." and nothing else happens
OK this worked for me, mostly. It did only allow those with magic to learn the skill. Yay, got that. But after that it still says, "Player can't use magic" weather it works or not. Because it's in another character's Else: section that wasn't chosen. I've added a screenshot of my process if it helps.
 

Attachments

  • Screenshot (1).png
    Screenshot (1).png
    944.2 KB · Views: 5

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,820
Reaction score
1,369
First Language
English
Primarily Uses
RMVXA
Do this process in the common event

Item setup - item # 17 - change the price and stuff how you like and the variables you want to use
1648038981403.png

CE setup - id.data_id == 1 - special, 2 - magic, ...
1648038579077.png

And here it is for checking if you have the skill - checks for skill 26 (heal)
Ruby:
act = $game_actors[$game_variables[2]].class
act.features.each do |id|
if id.code == 41
if id.data_id == 2
$game_switches[1] = true
char = $game_actors[$game_variables[2]].skills
char.each do |sk|
if sk.id == 26
$game_switches[1] = false
end
end
end
end
end

equals
1648038129699.png1648038709338.png
 
Last edited:

jkingery25

Villager
Member
Joined
Aug 10, 2013
Messages
8
Reaction score
4
First Language
English
Primarily Uses
Do this process in the common event

Item setup - item # 17 - change the price and stuff how you like and the variables you want to use
View attachment 220763

CE setup - id.data_id == 1 - special, 2 - magic, ...
View attachment 220761

And here it is for checking if you have the skill - checks for skill 26 (heal)
Ruby:
act = $game_actors[$game_variables[2]].class
act.features.each do |id|
if id.code == 41
if id.data_id == 2
$game_switches[1] = true
char = $game_actors[$game_variables[2]].skills
char.each do |sk|
if sk.id == 26
$game_switches[1] = false
end
end
end
end
end

equals
View attachment 220754View attachment 220762
I tried this but kept getting this error.
 

Attachments

  • Screenshot (3).png
    Screenshot (3).png
    1.1 MB · Views: 3

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,820
Reaction score
1,369
First Language
English
Primarily Uses
RMVXA
what do you have for the damage formula? and did you copy the code I gave exactly?
I think you used a : in the formula and not a ;
 

jkingery25

Villager
Member
Joined
Aug 10, 2013
Messages
8
Reaction score
4
First Language
English
Primarily Uses
what do you have for the damage formula? and did you copy the code I gave exactly?
I think you used a : in the formula and not a ;
Ok I figured out what I did wrong. I'm still a bit of noob when it comes to the coding. I typed in Script: at the start of the script. hehe. But yes, It worked. Thank you all very much.
 

Latest Threads

Latest Posts

Latest Profile Posts

Me: *sudden burst of motivation to do something amazing*
Me, 5 minutes later: "Yeah, that's not happening"
1iVi6I.png


Continuing our countdown with Capsule Monster #13 Tomey Thomas! I loved the idea of a tiny book gaining sentience and being a little wizard. It’s a shame none of his spells are useful XD
Have to be more organised and serious. It helps that im running out of time at work :|. so much to do. Trying to make game studio professional. www.bmpgames.com
imgur links are back!
now I CAN keep getting away with NOT replacing them with updated renders!
yay!
I forgot RPG Maker even existed. Such good memories. Might boot up steam and download MV one more time

Forum statistics

Threads
131,552
Messages
1,220,792
Members
173,220
Latest member
ZecaVn
Top