playMaker

Author Topic: [SOLVED] i cant seem to add  (Read 1972 times)

teagus

  • Playmaker Newbie
  • *
  • Posts: 2
[SOLVED] i cant seem to add
« on: February 24, 2014, 04:36:01 PM »
hi im working on a character generator for an rpg i play using playmaker and daikonforge gui. The rpg has an ability modifier for each stat so ive built a slider that goes from 1-10, a box on the left showing the stat number which is set by the slider and a box on the right which shows the modifier for the stat.

All the above works fine but my problem is i need to be able to force a +1 to a stat when a specific race is selected and have it read correctly on the stat and modifier display. A player sets the slider from a 10 sided die roll so i cant just increase the max slider it needs to be +1 on top of whatever they roll. aside from race there is also advantages the player can pick at creation which have the same effect.

My attempt at this was to add a new float variable actualstr and a bool variable for the race that gives the bonus and continued to use the str variable set by the slider. in my fsm i have a compare to see if the slider has moved and sets the str according and a compare bool to check if the race is selected. if it is selected then it moves to a +1 state and loops back to the start state. if the race is not selected then it moves to the equal state that compares actualstr and str and if not equal it makes them equal then loops back to the start state. my problem is that when i hit start the fsm goes thru the check once but sits at the equal state and doesn't go back to the bool compare so the stat readout is stuck on 1 and doesnt change when the slider is moved. if anyone can tell me what im doing wrong id greatly appreciate it. if it helps i can post the actual fsm after work tonight.

you can see the start of it below i'm getting ready to start on the advantages but am stuck trying to get this last race bonus bit fixed https://sites.google.com/site/animachargen/chargen
« Last Edit: February 25, 2014, 03:52:27 PM by Lane »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: i cant seem to add
« Reply #1 on: February 25, 2014, 10:46:38 AM »
You need three variables here.

baseStat + sliderValue = totalStatValue

Each stat needs to be added up individually this way. It's pretty simple, just a matter of storing the base stats somewhere and loading them at the menu, then keeping the totals after the character is created.

Your sliders don't need to know what the base stat is, you just need to add them together for the total.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

teagus

  • Playmaker Newbie
  • *
  • Posts: 2
Re: i cant seem to add
« Reply #2 on: February 25, 2014, 02:46:44 PM »
ok i was over thinking it, i was doing slidervalue = totalvalue and then further down my fsm adding in the basestat to the totalvalue.

this makes much more sense and gives more room for the extra bonuses i have to add later thanks

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: i cant seem to add
« Reply #3 on: February 25, 2014, 03:51:58 PM »
Yep, that way should scale much better.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D