Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: daidokoro on October 05, 2015, 02:01:58 PM
-
Hi
I have a fsm for my boss health and everything is working fine. When trigger is hit then health is lossing health until dead. But when the player is dead and respawned (3 lifes) then the boss gui and health value are not resetting. So i have tried to use a get property to access the m_health of the player script and compare int. If int is 0 or less then i will go back and restart the fsm or i'm missing something. Thanks for the help...
-
Ok my system is working now with the first spawn (life1) of my player but no with second and Third life...i can't find what i'm doing wrong.
Basically i'm checking health variable on player and if 0 then sending event to Boss to reset Int to 10
If someone can help as i'm loosing my mind...
-
Hi,
In the 1st post i can see that the int compare should be above the trigger
In the 2nd post in your check health fsm,
when you have reached 0 it goes to "state 2" and send event but after that it stay on "state 2" so it is not checking anymore
-
Hi
Thanks i'm using the second method. Yes the state 2 is the end at the moment as every time i'm doing a transition to come back to state 1 i have an error message like :
Third Person Character : check health : Loop count exceeded maximum: 1000 Default is 1000. Override in Fsm Inspector.
UnityEngine.Debug:LogError(Object)
HutongGames.PlayMaker.FsmLog:AddEntry(FsmLogEntry)
HutongGames.PlayMaker.FsmLog:Log(FsmLogType, String)
HutongGames.PlayMaker.FsmLog:LogError(String)
HutongGames.PlayMaker.Fsm:EnterState(FsmState)
HutongGames.PlayMaker.Fsm:SwitchState(FsmState)
HutongGames.PlayMaker.Fsm:UpdateStateChanges()
HutongGames.PlayMaker.Fsm:UpdateState(FsmState)
HutongGames.PlayMaker.Fsm:Update()
PlayMakerFSM:Update()
-
ok solve the issue of the infinite loop by adding a Next Frame Event action but still can't get the reset for player spawn 2 and 3... any idea?
-
Hi,
i don't think you should loop this, but use a Global transition on the 1st state
and then send a event to it after players health is reset
-
Do you mean on the player or on the health boss ? I'm confuse...sorry
I have a global transition sent from the player when health is 0 to the boss but it is looking only working for the second player (after death of first one) then it is not working anymore...
-
Also now the Health of Boss is updating to original value when player is dead but my trigger is not working anymore...
Attached are my latest FSM
-
Hi,
I mean do not loop the check health fsm, but add a global transition on the first state (start state)
then you need to send an event to it after the player health is reset.
Or you can add a 3th state to check if player health is not 0 anymore
(same way as on the 1st state but then only "greater than")
and then loop back to the 1st state
-
wonderful :D
Thanks a lot it is working with this method. Tomorrow i will post the final FSM so people can see what i have done