Script Call Support Boards

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.
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.
$game_actors[4].dead?


Unless I misunderstood something, that should work.


This also works.
 

Code:
$game_actors[4].alive?
@KanaX That looks familiar.  I'm off to try it out.


Thanks a lot.
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.
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.
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.
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.
 

Spoiler
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?
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.
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.
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 🙂
@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?
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.
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.
nope - you need a script to adjust the volume as each sfx is played.
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..
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.
[Removed by OP]
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.
@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]

Original thread: https://forums.rpgmakerweb.com/threads/script-call-support-boards.25767/