Have a state add a static amount to a parameter?

BaronHurfVonDurf

Villager
Member
Joined
Dec 14, 2015
Messages
16
Reaction score
1
First Language
English
Primarily Uses
Like say I want a state to do Atk + 5. Is there any way to do this? Or a script available?
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,528
Reaction score
14,261
First Language
English
Primarily Uses
RMVXA
Only with a script, and I don't remember any that do this for ACE. What I'd suggest instead is figure out what % would result in an average gain of +5 in your game, and use that instead, it will be easier. But I'll put it in script requests in case someone can find one that does this.

I've moved this thread to RGSSx Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.

 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
823
First Language
Hungarian
Primarily Uses
RMVXA
Here, I threw this together just now:
 
Last edited:

BaronHurfVonDurf

Villager
Member
Joined
Dec 14, 2015
Messages
16
Reaction score
1
First Language
English
Primarily Uses
Here, I threw this together just now:
Thanks man. This works in a vacuum, but for some reason it isn't compatible with the Passive Skill script I was using.
Still I appreciate you already going out of your way.

##-----------------------------------------------------------------------------
# CP Passive Skills v1.1
# Created by Neon Black
# v1.1 - 12.9.2014 - Slight optimization
# v1.0b - 9.5.2012 - Slight bug fix
# v1.0 - 9.5.2012 - Wrote and debugged main script
# For both commercial and non-commercial use as long as credit is given to
# Neon Black and any additional authors. Licensed under Creative Commons
# CC BY 4.0 - http://creativecommons.org/licenses/by/4.0/
##-----------------------------------------------------------------------------

##-----------------------------------------------------------------------------
# Instructions:
# Place this script in the "Materials" section of the scripts above main.
# This script has no customization options and is plug and play. To use this
# script just follow two fairly simple steps.
# 1. Create a state with the passive buffs you would like a skill to add.
# 2. Add the line "passive[x]" without the quotes to a skill's notebox where
# "x" is the ID of the state to be applied while the skill is learned.
# Note that passives do not apply to enemies.
##-----------------------------------------------------------------------------


##-----------------------------------------------------------------------------
# The following lines are the actual core code of the script. While you are
# certainly invited to look, modifying it may result in undesirable results.
# Modify at your own risk!
##-----------------------------------------------------------------------------


$imported ||= {}
$imported["CP_PASSIVES"] = 1.1

class Game_BattlerBase ## Alias the feature objects to get states and passives.
alias cp_passive_f_objects feature_objects
def feature_objects
return cp_passive_f_objects if @passover
return cp_passive_f_objects + passives
end

def passives ## Returns an empty passive array for all battlers.
return []
end
end

class Game_Actor < Game_Battler ## Gets passive states on a character.
def passives
res = []
@passover = true
skills.each do |skill|
next if skill.passives.empty?
res += skill.passives
end
@passover = false
return res.collect {|ps| $data_states[ps]}
end
end

class RPG::Skill < RPG::UsableItem
def passives
return @passives if @passives
@passives = []
self.note.split(/[\r\n]+/).each do |line|
case line
when /passive\[(\d+)\]/i
@passives.push($1.to_i)
end
end
@passives
end
end


##-----------------------------------------------------------------------------
# End of script.
##-----------------------------------------------------------------------------
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
823
First Language
Hungarian
Primarily Uses
RMVXA
If you replace this line:
Code:
return states.inject(add_st_prms9927(pid)) {|r, st| r += st.static_prm[pid] }
With this one:
Code:
return (states+passives).inject(add_st_prms9927(pid)) {|r, st| r += st.static_prm[pid] }
It should work with that script too. Didn't test it, though. :p
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,713
First Language
English
Primarily Uses
RMVXA
@BaronHurfVonDurf In future please post a link to the web page where you got the script. Scripter's usually don't like their scripts being reposted.
 

BaronHurfVonDurf

Villager
Member
Joined
Dec 14, 2015
Messages
16
Reaction score
1
First Language
English
Primarily Uses
That worked. Thanks. tbh I'm surprised this isn't a default feature.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,040
Messages
1,018,470
Members
137,821
Latest member
Capterson
Top