News:

Happy 20th, FFvT3R!

Main Menu

Assigning prestige to alternate material types

Started by hoss20, January 16, 2010, 12:46:32 AM

Previous topic - Next topic

hoss20

Is it possible to assign prestige points to the concrete, air, and cloth material types (and for that matter, get the material type text to show up in the FF character creator). I use concrete quite often in my hero files and wouldn't mind being able to do this. I'm using the latest version of FFX with FFVTTR. Thanks for any assistance.

catwhowalksbyhimself

I believe that's all in the engine and can't be changed or modded in any way.
I am the cat that walks by himself, all ways are alike to me.

hoss20

In looking through all the files that I knew to look at, I figured that was the case. Thanks for the response, Cat.

Epimethee

Actually it's possible; the "very unstable molecules" attributes is the proof of this.

You just need to use Object_SetAttr(char, "material" some_number) where the number corresponds to the material. I don't jhave access to FF right now (need to reinstall Windows from scratch), but I can try to give you pointers if you wish.
FFX add-on for FFvsTTR at ffx.freedomforce4ever.com

stumpy

#4
hoss20, I don't quite understand what you mean by "assign prestige points". As Epimethee says, one can assign those material types as a character's material pretty easily. But, it is built in to the game engine (and not changeable via scripting) that those materials are unavailable in the in-game character creator and do not have a cost in terms of character points (CP) when building a character. So, if you are looking to, for instance, have concrete available as a character material when building a custom hero and make it so that the game adds 1200 CP or something to the character cost for selecting that material type, then I don't think that is possible.

If you mean something other than one of those, you might need to clarify a bit.
Courage is knowing it might hurt, and doing it anyway. Stupidity is the same. And that's why life is hard. - Jeremy Goldberg

hoss20

QuoteSo, if you are looking to, for instance, have concrete available as a character material when building a custom hero and make it so that the game adds 1200 CP or something to the character cost for selecting that material type, then I don't think that is possible.
That's exactly what I wanted to do, Stumpy. I apologize for using the wrong terminology (prestige points instead of character points).
Thanks to all for responding.

Epimethee

You could create an attribute with say a 1200 CP cost called "Concrete skin", no?
FFX add-on for FFvsTTR at ffx.freedomforce4ever.com

catwhowalksbyhimself

That would certainly be one way around the problem alright.
I am the cat that walks by himself, all ways are alike to me.

hoss20

   Thanks for the advice, gentlemen. I have tried in vain to make the attribute. I have tried to find a similar attribute in FFX to copy and make the proper changes, but the only ones I found were resistant to states, not damage types. I'm just not skilled enough in scripting to get what I want. I read the instructions in the FFX manual and wasn't sure if they included everything that needs to be done to add a new attribute. I thought if I could take an attribute like Solid Skeleton or Hirsute, then I could just copy the format and put in additional lines for all the damage types I wanted to include. Unfortunately, I can't find the built-in attributes in order to copy them (I hope they're not somewhere obvious. I feel stupid enough as it is).
   If someone could just point me in the right direction, I would appreciate it. I would like to be able to do this on my own, albeit with some obvious help, so that I can learn how to do it. Thanks for any help.

catwhowalksbyhimself

You don't need to touch FFX at all.  You also don't need to actually make the attribute set the material type.  Just add a new attrubute and FFEdit, give the appropriate point value and save.  No need to do anything with the attribute, it's just a dummy.  Now set the material type as you have before, separately.
I am the cat that walks by himself, all ways are alike to me.

stumpy

If you are up for twiddling with ffx.py or ffx2.py, the following (UNTESTED!) code will get you started to get the base materials set as FFX materials. Rough notes on how to set it up are in the code comments.

# Attribute to make available material types which are unavailable to
# the in-game character creator. The materials will now be available
# as FFX attributes (which can be used in combos) and the material
# properties are initialized when a mission starts. The assumption is
# that the character will have his material left as flesh in the
# in-game character editor.
#
# (see http://freedomreborn.net/forums/index.php?topic=52172.0)
#
# Note that this means that, though the attribute will be listed for
# the character at the base (for instance, when leveling up), the
# properties won't show up on the resistances page of the character.
#
# NB: These attributes are supposed to be substitutes for chosing the
# actual materials if they were available in the in-game editor. As
# such, 1) they overwrite the base material settings that FFX records
# when the character is initialized, so that other attributes that
# temporarily alter character materials (like unstable molecules,
# absorber, etc.) will revert base to the proper base materials when
# their effects end. 2) These attributes set an attribute
# ('baseMatAltered') so that it doesn't get applied to characters who
# are under the effect of a termporary material effect if they switch
# maps in a freeroam campaign. 3) They are NOT removable.

# IN FFEDIT:
# Under the Attributes tab, define
#    Attribute Name     Cost
#    concretematerial   1250
#    airmaterial        1000
#    clothmaterial      50
#
# IN STRINGS.TXT, add the following lines (without the # characters at
# the beginning)
#ATTRIB_CONCRETEMATERIAL_01, material: concrete
#ATTRIB_CONCRETEMATERIAL_DESC_01, sets character base material to concrete
#ATTRIB_CLOTHMATERIAL_01, material: cloth
#ATTRIB_CLOTHMATERIAL_DESC_01, sets character base material to cloth
#ATTRIB_AIRMATERIAL_01, material: air
#ATTRIB_AIRMATERIAL_DESC_01, sets character base material to air

# NEW CODE BELOW for ffx.py or ffx2.py

# [Add the following line in the initialise() function in ffx.py]
   Global_RegisterAttr('baseMatAltered',0)

# [This goes in the attribute initialization section of ffx.py. (It
# could be written as an attribute module as well.)]

####################################### BASE MATERIAL #########################################
# Generic Function to set character base material
def setNewBaseMaterial(char, MatType):
   if Object_GetAttr(char,'baseMatAltered') != 0:  # base material already set
       return
   # change the material types
   Object_SetAttr(char,'material',MatType)
   Object_SetAttr(char,'mass',Object_GetAttr(char,'mass')*materialFactors[MatType])
   Object_SetAttr(char,'minForce',Object_GetAttr(char,'mass')*10)
   # update FFX bookkeeping attributes
   FFX_ObjectSetAttr(char,'baseMat',Object_GetAttr(char,'material'))
   FFX_ObjectSetAttr(char,'baseMass',Object_GetAttr(char,'mass'))
   FFX_ObjectSetAttr(char,'baseMinForce',Object_GetAttr(char,'minForce'))
   # record that the base material has been altered
   Object_SetAttr(char,'baseMatAltered', 1)

# material-specific functions

def initconcretematerial(char, update=0):
   setNewBaseMaterial(char, 8)

def initclothmaterial(char, update=0):
   setNewBaseMaterial(char, 10)

def initairmaterial(char, update=0):
   setNewBaseMaterial(char, 6)
   
Courage is knowing it might hurt, and doing it anyway. Stupidity is the same. And that's why life is hard. - Jeremy Goldberg

lugaru

Quote from: stumpy on January 20, 2010, 10:31:21 AM
If you are up for twiddling with ffx.py or ffx2.py, the following (UNTESTED!) code will get you started to get the base materials set as FFX materials. Rough notes on how to set it up are in the code comments

Tried doing it for my own work and was unable to get it to assign the material in game. It might be my fault, I'm not quite sure where to instert this:

Quote# [Add the following line in the initialise() function in ffx.py]
    Global_RegisterAttr('baseMatAltered',0)

# [This goes in the attribute initialization section of ffx.py. (It
# could be written as an attribute module as well.)]

Specifically the register line but I left the notes in for cotext. Hopefully we can make this work, it would be  huge time saver. I tried a few experiments of my own aping "unstabe molecules" but unsuprisingly it did not wok (I'm supe new to FF backend).