Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,502
Reaction score
411
First Language
German
Primarily Uses
RMMV
Thank you this is exactly what i needed.


Iam making a Player Teleport to Event on another Map event scriptsnippet.


But i figured out its easier to change the Eventname in the Editor than choosing another graphic.


Thats why i will go with the Event Name to test for now.


load_data("Data/Map001.rvdata2").events[1].name


If the name is 0 player keeps his direction. if its 2,4,6 or 8 he will apear in that direction after the teleport.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,305
Reaction score
11,726
First Language
English
Primarily Uses
RMVXA
I have lost my note (if I ever had it) telling me how to do a script call to check if an actor (in this case actor #4) is alive.  I know that I could do it using a conditional to check if actor #4 has the death state, and then use the 'Else' branch, but that is going to get very cumbersome as I cycle through the battle party until I find someone who is alive and can, therefore, speak after the battle.


Can anyone help out?


Thanks.
 

KanaX

Just being a sleepy
Veteran
Joined
Apr 3, 2013
Messages
1,455
Reaction score
1,298
First Language
Broken English.
Primarily Uses
N/A
$game_actors[4].dead?


Unless I misunderstood something, that should work.


This also works.
 

Code:
$game_actors[4].alive?
 
Last edited by a moderator:
  • Like
Reactions: Kes

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,305
Reaction score
11,726
First Language
English
Primarily Uses
RMVXA
@KanaX That looks familiar.  I'm off to try it out.


Thanks a lot.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,305
Reaction score
11,726
First Language
English
Primarily Uses
RMVXA
I am trying to determine if any member of the active party has a particular accessory equipped, for use in a conditional branch.  So far I have this:


$game_party.battle_members::armors.include?($data_armors[96])


This gives the error message


undefined method 'armors'


I have tried adjusting it to


$game_party.battle_members::a.armors.include?($data_armors[96])


but then it says that there is an undefined method 'a'


Can anyone give me the correct formulation?


Thanks.
 

KanaX

Just being a sleepy
Veteran
Joined
Apr 3, 2013
Messages
1,455
Reaction score
1,298
First Language
Broken English.
Primarily Uses
N/A
I made this little bugger work:


$game_party.battle_members.each do |actor|

if actor.armors.include?($data_armors[1])

else

end
end


Turns out, I have had no idea how to execute a battle. Never done it before. See if it works for you.
 
Last edited by a moderator:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,305
Reaction score
11,726
First Language
English
Primarily Uses
RMVXA
I think I'm doing it wrong - in fact, I know I must be, because I get an error message no matter what I do.


I have tried putting the whole of those 2 lines of code into the script part of a conditional branch.


I have tried 2 conditionals, line one i.e. $game_party.battle_members.each do |actor| in the first and the other line in a nested conditional.


Could you show me a screen shot of your event page so that I can see how you did it?


Sorry to be so dumb about scripting.
 

KanaX

Just being a sleepy
Veteran
Joined
Apr 3, 2013
Messages
1,455
Reaction score
1,298
First Language
Broken English.
Primarily Uses
N/A
So sorry for taking so long. Had a rough day!
Now sure why you get an error. I've tried it on both the overworld and the battle scene.
 

oHxPvbd.png

The variables are there for me to confirm if the event is doing what I want it to be doing.


What error are you getting?
 
Last edited by a moderator:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,305
Reaction score
11,726
First Language
English
Primarily Uses
RMVXA
I've got it do something as simple as alter a game variable, but I don't know how to call a force action (in this case, skill 99) by script call.  That is why originally I was trying to do it within a conditional branch from the event command menu, because then I can use the other event commands, specifically force action for one instance and change state for all enemies on another occasion.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,305
Reaction score
11,726
First Language
English
Primarily Uses
RMVXA
Having got my query resolved, I'm back with another one.


I need to be able to inflict a state at a specific percent chance of success from a Common Event.  This is because I want the chance of it being inflicted to rise in line with a variable.


I therefore need to be able to use a conditional branch, but the event menu commands only allow states to be inflicted (100%) or removed.


So, what would be the script call for the conditional such that I can say inflict state X at YZ rate of success?


Thanks.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,231
Reaction score
14,252
First Language
English
Primarily Uses
RMMV
You're trying to be too clever :)


Set a variable to a random number between 1 and 100, then use that in a conditional branch, and if it's greater than the % chance you want to use, inflict the state.


So you're not randomizing the chance the state will be inflicted, but the chance that your Add State command will be called.  Should give you the same result :)
 
Last edited by a moderator:
  • Like
Reactions: Kes

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,305
Reaction score
11,726
First Language
English
Primarily Uses
RMVXA
@Shaz You're right I was over thinking it.  


Thanks 


EDIT


Now I've had time to think this through, I'm no longer sure that I can see how this works.  To give more precise details:


At levels 10 - 18 : a 40% chance that the state will be inflicted.


At levels 19 - 25 : a 50% chance


At levels 26 - 32 : a 60% chance


and so on.


So, I set a variable to the actor's current level.  Conditional branch: 


v is greater than 18 and less than 26 


how then do I specify the 40% chance?
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,231
Reaction score
14,252
First Language
English
Primarily Uses
RMMV
Ah - I didn't realize you wanted the % to be different based on the actor level.  However, you can still do it - you just need an extra step.


Put the actor's level into a variable.


Do a series of conditional branches to set a second variable to the % chance based on the actor level ranges.


Now set a third variable to the random number between 1 and 100.


Finally make a conditional branch that compares the second and third variables - if third variable (random number) is higher than second variable (% chance based on level), apply the state.
 

Rokazulu

Veteran
Veteran
Joined
Aug 31, 2016
Messages
103
Reaction score
2
First Language
English
Primarily Uses
RMVXA
Is there a script call that can change all sfx volume?


RPG::BGS.new("BGS Name", volume, pitch).play




Such as this one but instead of one BGS it changes all BGS's, all SFX, all menu sounds.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,231
Reaction score
14,252
First Language
English
Primarily Uses
RMMV
nope - you need a script to adjust the volume as each sfx is played.
 

BCj

Veteran
Veteran
Joined
Jun 19, 2014
Messages
1,749
Reaction score
935
First Language
Dutch
Primarily Uses
N/A
Is it possible to recover health (in battle) as a percentage with a script-call? I don't like the fact that "Add HP" has a flat number.. I mean 40 may be a lot at lvl 1, but not at 99..
 

Brigg

Veteran
Veteran
Joined
Apr 22, 2015
Messages
129
Reaction score
4
First Language
English
Primarily Uses
How can I compare a variable within a list of variables.


For instance, if I have 20 random numbers set to 20 different variables, using Script Call, how can I check to see if a separate variable number is in that list of 20 random numbers. There has to be an easier way than to do a 20 different Conditional Branches to check.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,305
Reaction score
11,726
First Language
English
Primarily Uses
RMVXA
I need to be able to identify if actor 2 is the first follower (i.e. the second person in the party). I have tried this script call and although it doesn't crash, it doesn't give me the right information. It says it's not him, when I can clearly see that it is.
$game_player.followers[0] == $game_actors[2]
I have also tried
$game_player.followers[1] == $game_actors[2]
and that doesn't work either.

Can someone tell me what I've done wrong here.
Thanks.
 

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
579
Reaction score
220
First Language
English
Primarily Uses
RMVXA
@Kes My best guess is that it's returning a follower object from Game_Follower.
You need need the actor method to get the actor object from that class.
$game_player.followers[0].actor == $game_actors[2]

Since your first follower is your second party member, this works as well.
$game_party.members[1] == $game_actors[2]
 
Last edited:
  • Like
Reactions: Kes

Latest Threads

Latest Posts

Latest Profile Posts

I just wanna Covid to be over and I have my normal life back... Feeling so bad these days, what can I do?
Holy Moly BlackJack is Finally finished!
Don't judge me, I'm not great at the game.
BlackJack.png
Jatopian wrote on war40k's profile.
What did you find for your plugin request?
Progress on my game for RSE is almost done! I should be able to release it next week.

Forum statistics

Threads
109,069
Messages
1,041,800
Members
141,558
Latest member
AppleBees
Top