Please login or register.

Login with email, password and session length
 

News:

Happy 15th Birthday, Freedom Force!


Author Topic: Stat Values Beyond 10  (Read 497 times)

Offline kkhohoho

  • Evil (but a hero) Santa Claus look-a-like
  • Hero Member
  • Posts: 3036
  • "He sees you when you're sleeping...
    • The Golden Age: Not Your Ordinary Fanfic
Stat Values Beyond 10
« on: July 23, 2015, 08:55:02 PM »
Hi there. Basically, I'm trying to figure how to increase a characters' stats' beyond 10. I know that it's the normal maximum in either FF game, but for me, 10 just isn't enough for some characters, particularly the speedsters. With the Human Rocket attributes, you can get a flying characters' speed up to 25, but there don't seem to be any such attributes for ground speed, which means compared to, say, Red Tornado, (whose flying speed for me is at 15,) Flash isn't really living up to his name. Upping the stats would also help characters like Galactus or Spectre, whose strength and endurance should be on a different level compared to just about everyone else.

Now, I actually remember that there was a way to edit the herofiles or some sort of script that allowed for pushing the stats past that 10 maximum, but I can't remember how I did it. In any case, if anyone knows of a way to do this, please let me know.
The Golden Age; 'A different look at a different era.'

http://archiveofourown.org/works/1089779/chapters/2193203

Offline spydermann93

  • Hero Member
  • Posts: 3743
Re: Stat Values Beyond 10
« Reply #1 on: July 23, 2015, 09:55:01 PM »
Well, what I did was make some attributes like "Resilient", but instead of increasing health, it increases Speed and/or Agility, namely.

I have some custom attributes that increase ground speed substantially (it doesn't work well with Human Rocket or Fast Flier, though) and agility.

Here's the code:

Code: [Select]
######################Super Speed Set#########################################
# This power makes Speedster characters all the more faster (adds x amount to speed). With this, Bullet will look like a turtle :P

def initsuperspeed01(char,update=0,remove=0):
    superspeed(char,11,update,remove)

def initsuperspeed02(char,update=0,remove=0):
    superspeed(char,12,update,remove)

def initsuperspeed03(char,update=0,remove=0):
    superspeed(char,13,update,remove)

def initsuperspeed04(char,update=0,remove=0):
    superspeed(char,14,update,remove)

def initsuperspeed05(char,update=0,remove=0):
    superspeed(char,15,update,remove)

def initsuperspeed06(char,update=0,remove=0):
    superspeed(char,16,update,remove)

def initsuperspeed07(char,update=0,remove=0):
    superspeed(char,17,update,remove)

def initsuperspeed08(char,update=0,remove=0):
    superspeed(char,18,update,remove)

def initsuperspeed09(char,update=0,remove=0):
    superspeed(char,19,update,remove)

def initsuperspeed10(char,update=0,remove=0):
    superspeed(char,20,update,remove)

def superspeed(char,grade,update,remove):
    if update==0:
        if remove == 0:
            mlogreader.regFlightStop(char,'ffx.superspeedboost',persistent=1)
            mlogreader.regFlightStart(char,'ffx.superspeedunboost',persistent=1)
            FFX_ObjectSetAttr(char,'superspeedgrade',grade)
            FFX_ObjectSetAttr(char,'superspeed',1)
            if not mlogreader.MLOG_IsFlying(char):
                superspeedboost(char)
        else:
            superspeedunboost(char)
            mlogreader.cancelAnimationCallbackSink(char,'ffx.superspeedboost')
            mlogreader.cancelAnimationCallbackSink(char,'ffx.superspeedunboost')
            FFX_ObjectSetAttr(char,'superspeed',0)

def superspeedboost(event):
    if isinstance(event,types.StringType):  # called with just the character name
        char = event
    else:
        char = event.object                 # called from an event sink
    print "superspeedboost(%s) called: FFX_ObjectGetAttr(%s,'superspeedboosted')==%d Object_GetAttr(%s,'speed')==%d flying==%d" % (repr(event),repr(char),FFX_ObjectGetAttr(char,'superspeedboosted'),repr(char),Object_GetAttr(char,'speed'), mlogreader.MLOG_IsFlying(char))
    if FFX_ObjectGetAttr(char,'superspeedboosted'):
        return  # already boosted
    speed=FFX_ObjectGetAttr(char,'superspeedgrade')
    Object_SetAttr(char,'speed',speed)
    FFX_ObjectSetAttr(char,'baseSpeed',speed)
    FFX_ObjectSetAttr(char,'superspeedboosted',1)

def superspeedunboost(event):
    if isinstance(event,types.StringType):  # called with just the character name
        char = event
    else:
        char = event.object                 # called from an event sink
    print "superspeedunboost(%s) called: FFX_ObjectGetAttr(%s,'superspeedboosted')==%d Object_GetAttr(%s,'speed')==%d flying==%d" % (repr(event),repr(char),FFX_ObjectGetAttr(char,'superspeedboosted'),repr(char),Object_GetAttr(char,'speed'), mlogreader.MLOG_IsFlying(char))
    if not FFX_ObjectGetAttr(char,'superspeedboosted'):
        return  # already not boosted
    speed=Object_GetAttr(char,'templateSpeed')
    Object_SetAttr(char,'speed',speed)
    FFX_ObjectSetAttr(char,'baseSpeed',speed)
    FFX_ObjectSetAttr(char,'superspeedboosted',0)
#    FFX_ObjectSetAttr(char,'baseSpeed',speed)

#######################################
def initffqagile(char,update=0,remove=0):
    if remove:
        if FFX_ObjectGetAttr(char,'ffqagile'):
            FFX_ObjectSetAttr(char,'ffqagile',0)
            agility=Object_GetAttr(char,'agility')
            agility=agility-5
            Object_SetAttr(char,'agility',agility)
            Object_SetAttr(char,'agility',Object_GetAttr(char,'agility')-5)
        return
    if not FFX_ObjectGetAttr(char,'ffqagile'):
        FFX_ObjectSetAttr(char,'ffqagile',1)
        # check that this wasn't already changed by FFX in an earlier freeroam map and already lowered
        if ( 'freeroam_bonus' not in sys.modules.keys() )or \
           ( ( 'freeroam_bonus' in sys.modules.keys() ) and ( freeroam_bonus.heroStates==[] ) ):
            agility=Object_GetAttr(char,'agility')
            agility=agility+5
            Object_SetAttr(char,'agility',agility)
            Object_SetAttr(char,'agility',Object_GetAttr(char,'agility')+5)

Copy and paste this code in your mod folder's "Missions/Scripts/ffx.py" file, right above the "FFX FOOTER" comment box.

You'll then need to add the attributes by name to your mod using FFEdit as well as add any text for the attributes*.

You don't need to add all of the attributes

* If it starts with "init", then that's the name of the attribute you type in FFEdit, minus the init part.  For example, "initffqagile" would be named "ffqagile" in FFEdit and in the "strings.txt" file.

Offline yell0w_lantern

  • Cut-rate Ringslinger
  • Hero Member
  • Posts: 2894
Re: Stat Values Beyond 10
« Reply #2 on: July 24, 2015, 01:32:44 AM »
Remember, there is a maximum number of lines you can have in your ffx file and going beyond that MAY break many attributes AND the state swaps.  It took me a few years to track that down as the problem in 2 of my mods.


Can anyone comment on using the ffx2.py file for this?  Is it just drop and go or would it require some additional code?
« Last Edit: July 24, 2015, 01:39:45 AM by yell0w_lantern »
Yellow Lantern smash!

Offline spydermann93

  • Hero Member
  • Posts: 3743
Re: Stat Values Beyond 10
« Reply #3 on: July 24, 2015, 03:49:49 AM »
There was a tool that I think Stumpy released that allows for ffx.py for reading from another file.  I will look around for it to see if I can find it.

However, this code should fit at the end of most players' ffx.py files, but I'm guessing that you have quite a few customs in your file, YL?

Offline yell0w_lantern

  • Cut-rate Ringslinger
  • Hero Member
  • Posts: 2894
Re: Stat Values Beyond 10
« Reply #4 on: July 24, 2015, 03:43:02 PM »
 :(
I even had to delete the footer.
Yellow Lantern smash!

Offline spydermann93

  • Hero Member
  • Posts: 3743
Re: Stat Values Beyond 10
« Reply #5 on: July 24, 2015, 06:16:14 PM »
Then I'm off to find the tool!

I used it for holding several of my own "Super Healing" attributes, so I know that it works.

Offline kkhohoho

  • Evil (but a hero) Santa Claus look-a-like
  • Hero Member
  • Posts: 3036
  • "He sees you when you're sleeping...
    • The Golden Age: Not Your Ordinary Fanfic
Re: Stat Values Beyond 10
« Reply #6 on: July 26, 2015, 04:18:46 AM »
No offense, and I appreciate the help, but that isn't really what I was looking for. I know there's a way to increase a characters' stats without attributes and by instead editing some script because I did it before, but that was years ago when I first installed the game, and now I can't remember how I did it. I know someone else posted how to do it on the old forums, but I've no idea who it was. But regardless, I was able to give the Flash and the Hulk speed and strength values higher than 10 respectively, without attributes, by raising their stats above the normal maximum. If someone has any clue how to do this, please let me know.
The Golden Age; 'A different look at a different era.'

http://archiveofourown.org/works/1089779/chapters/2193203

Offline stumpy

  • treselgonian dementialist
  • Administrator
  • Hero Member
  • Posts: 4355
Re: Stat Values Beyond 10
« Reply #7 on: July 26, 2015, 05:15:30 PM »
kkhohoho, it seems like the scripted attribute code spydermann93 posted pretty much does what you want for speed. You could do almost the same thing for strength. Keep in mind that the game isn't really designed to handle character attributes beyond 10 and pushing the limits is likely to cause buggy behavior at some point.

spydermann93 and yell0w_lantern: The code I posted to partly automate moving attribute code from ffx.py into separate files in order to keep ffx.py under the size limit is here, along with a very short usage doc. Here is a forum post where I outlined the process.
Currently reading: High Mage (The Spellmonger Series) by Terry Mancour
Just finished reading: Pelya (The Dralin Trilogy) by John H. Carrol