RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Script Call Request for Existing Script

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 75
What the...?
http://rmrk.net/index.php/topic,34056.0.html

I need a script call to perform an action based on the above script, MA's "Show Variable-Based Stats".   The script basically creates new stats, based on variables.   These stats then show up in the Status Menu.  I've been using the script for a while now and really like it.  But there's a place in my project during which I need to alter the entire party's variable-based stats at the same time.   Since, there are any number of actors who could be in the party at any point, I need this to be summed up in a single script call. 

EXAMPLE:
We'll use a variable-based stat called 'INT', or Intelligence.
I need something that can say:

Add +2 to everyone in the party's INT.

There are event commands for the real stats, but unfortunately this script gives no direct call to perform the task. 

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Best IRC Quote2014 Zero to Hero2014 Most Missed Member2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
To get the IDs of all the actors in the party, you could use this.
Code: [Select]
v = 14 # -> The ID of the base variable
a = []
for actor in $game_party.members
  a.push(actor.id)
end
for i in a
  $game_variables[v + i] += 2 # -> The operation you want to take out on the variable
end
For example, if I wanted to multiply the base variable 5 by 2, I would do this.
Code: [Select]
v = 5 # -> The ID of the base variable
a = []
for actor in $game_party.members
  a.push(actor.id)
end
for i in a
  $game_variables[v + i] *= 2 # -> The operation you want to take out on the variable
end
If I understood that correctly.
it's like a metaphor or something i don't know

***
Rep:
Level 75
What the...?
Thanks for the reply, Pacman.

So the 'base variable' in these examples are the variables which store the stat for the first actor?

In example 1, you are saying, start at variable 14 (actor 1's variable), and add to the array "a" the variable for all actors in the party. 
Then, in the second part, you iterate through them, adding to '2' to all of them.

I'll try it and post results.

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Best IRC Quote2014 Zero to Hero2014 Most Missed Member2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
Yes. That's what I was doing.
it's like a metaphor or something i don't know

***
Rep:
Level 75
What the...?
Thanks Pacman.  This works fine.  This topic can be closed.