YesNoOk
avatar

Config State for a character (Read 1668 times)

Started by NNinja1255, August 19, 2018, 03:18:05 am
Share this topic:
Config State for a character
#1  August 19, 2018, 03:18:05 am
  • avatar
  • So...
So I am trying to make a Config State file that the players can modify the values of the variables, for example, to enable or disable something with the character (kinda like with Dark Donald with the OPTION.txt file), but I'm having a bit of trouble. Any ideas? Suggestions?
Last Edit: August 19, 2018, 07:18:01 pm by NNinja1255
Re: Config State for a character
#2  August 19, 2018, 03:21:42 am
  • avatar
  • So...
If you are wondering, I am planning to have the varset like dark donald:

Code:
[State -2, <Something here>]
Trigger1 = RoundState <= 1
trigger2 = roundsexisted = 0
v = <blah>
value = <0 for false, 1 for true>

(Triggers might not be accurate to what the Dark Donald code actually is since I tried to remember what it was)
Last Edit: August 19, 2018, 07:18:27 pm by NNinja1255
Re: Config State for a character
#3  August 19, 2018, 10:05:05 am
  • avatar
  • **
    • USA
Step 0 is to make a text file like config.txt.  It's going to contain nothing but statedef 5900.  That statedef will establish your variables.

Code:
[Statedef 5900]
type = S

[State 5900, 1]
type = VarRangeSet
trigger1 = !RoundsExisted
value = 0

[State 5900, 2]
type = VarRangeSet
trigger1 = !RoundsExisted
fvalue = 0

[State 5900, An Example]
type = varset
trigger1 = 1
; SET THIS TO 0 TO SET AN EXAMPLE VARIABLE TO 0
; SET THIS TO 1 TO SET AN EXAMPLE VARIABLE TO 1

var(0) = 0


[State 5900, 3]
type = ChangeState
trigger1 = roundno = 1
value = 190

[State 5900, End]
type = ChangeState
trigger1 = 1
value = 0

Add your variables for the user to change there and make sure the character DEF loads your config.txt file as a state file (st1 or whatever number is available).

Of course, you have to actually use those variables as options in the character's code.  This is really something you would do WHILE making the character.  Trying to add this feature long after the fact is going to be a chore.  It can be done, but there's a lot of editing to do and you need to make sure your configuration variables are actually available for use.
Re: Config State for a character
#4  August 19, 2018, 07:13:30 pm
  • avatar
  • So...
Thanks for the help. It's working now.