View unanswered posts | View active topics It is currently Thu Mar 28, 2024 2:15 pm



Reply to topic  [ 4 posts ] 
 [mod] Problem with combining multiple poses in one command 
Author Message
Rank 2
Rank 2

Joined: Sat Mar 18, 2017 9:00 pm
Posts: 5
Hi All
I have got stuck in a simple problem.
I am trying to make combine 3 poses in one command
the command is "show ass" (ass.show.you.set in the basic_ref_command.dat file)
Basically i want the character to move, turn and then bend.

My problem is that the character does not complete each individual actions but goes straight to "bend"
I need some kind of check the each individual pose has been complete before proceeding to the next.

The file "assup0_state" and the addition to basic_ref_command.dat shown below.
I have tried with
A time delay:
do_set_timer(2);

or to add:
loc.ts = GetTs();
[loc.ts < state.dyn.me.do.ts] return;

But it is not doing the trick!!

Does anyone have the answer?

Regards
Nolimit


Addition to basic_ref_command.dat

ass.show.you.set =
{

loc.ss.state = ASSUP0;
loc.ss.state2 = MOVETURN;
set_state(loc.ss);

}
ass.you.show.you.set = ass.show.you.set;
ass.show.you.if = ass.show.you.set;
ass.you.show.you.if = ass.show.you.set;



File assup0_state

<assup0_state>

loc.res = pose_state();
[loc.res] return;

case (state.dyn.me.do.state2)
{

[MOVETURN]
{
loc.sp.pose_type = STAND;
loc.sp.speed = 0;
loc.sp.par = 0.5;

loc.sp.pose_id = 0;
loc.sp.waypoint = "#MAIN+front";
loc.sp.exact = 0;

SetPose(loc.sp);
state.dyn.me.do.pose.sp = loc.sp;
state.dyn.me.do.pose.state = RUN0;

//do_set_timer(10);


state.dyn.me.do.state2 = TURN;
//state.dyn.me.do.state2 = POSE_WAIT;

//state.dyn.me.do.pose.fstate2 = FINISH;
}

[TURN]
{
//loc.ts = GetTs();
//[loc.ts < state.dyn.me.do.ts] return;

// Turn around
loc.sp.pose_type = STAND;
loc.sp.pose_id = 0;
loc.sp.waypoint = "#MAIN+turn_away";
loc.sp.exact = 0;

SetPose(loc.sp);
state.dyn.me.do.pose.sp = loc.sp;
state.dyn.me.do.pose.state = RUN0;

state.dyn.me.do.state2 = BACKASS;

}

[BACKASS]
{
// Backass
loc.sp.pose_type = BUTT_BACK0;
loc.sp.pose_id = 0;
loc.state2 = BACKASS_READY;

SetPose(loc.sp);
state.dyn.me.do.pose.sp = loc.sp;
state.dyn.me.do.pose.state = RUN0;

}
}
</assup0_state>


Wed May 10, 2017 6:37 am
Profile
Rank 17
Rank 17
User avatar

Joined: Fri Feb 27, 2015 2:06 pm
Posts: 682
Location: Australia
Yes you need to check to see if the action has been completed

Code:
[state.dyn.me.pose.result == NONE] return;


and if interrupted

Code:
[state.dyn.me.pose.result != READY]
    {
      do_set_timer(5);
      state.dyn.me.do.state2 = ENTERBAR;
      return;
    }



As a completed example
Code:
[ENTERBAR]
{      
loc.ts = GetTs(); 
[loc.ts < state.dyn.me.do.ts] return;
      
loc.sp.pose_type = STAND;
loc.sp.waypoint  = "SaikoStand_01";
loc.sp.speed     = 1;
SetPose(loc.sp);
do_set_timer(6);
state.dyn.me.do.state2 = STANDATBAR;   
}
 
[STANDATBAR]
{
loc.ts = GetTs(); 
[loc.ts < state.dyn.me.do.ts] return;
 
[state.dyn.me.pose.result == NONE] return;

[state.dyn.me.pose.result != READY]
{
do_set_timer(5);
state.dyn.me.do.state2 = ENTERBAR;
return;
}
state.dyn.me.do.state2 = NOTHING;
}

_________________
To install a mod

ESKARN'S TUTORIALS

Eskarn's Dungeon Mod(BETA)

Eskarn's puzzle map (story)


Wed May 10, 2017 11:14 am
Profile
Rank 2
Rank 2

Joined: Sat Mar 18, 2017 9:00 pm
Posts: 5
Thanks Eskarn
I finally understood how the timers work...
You have spared me from hours of trial and error.

There is one thing the I have difficulties understanding
When I look at the "If-structure" shown below

[state.dyn.me.pose.result != READY]
{
do_set_timer(5);
state.dyn.me.do.state2 = ENTERBAR;
return;
}

Why the return?
I mean the above line

state.dyn.me.do.state2 = ENTERBAR;

will make the program switch to the ENTERBAR sequence so it will never reach the return line?
Or will the program always run a sequence to the end and then switch unless a return is added?

Regards
Nolimit


Wed May 10, 2017 10:06 pm
Profile
Rank 17
Rank 17
User avatar

Joined: Fri Feb 27, 2015 2:06 pm
Posts: 682
Location: Australia
It will always run from top to bottom and wont stop until it reaches the end

so if you had something like

Code:
[STANDATBAR]
{
loc.ts = GetTs();
[loc.ts < state.dyn.me.do.ts] return;
 
[state.dyn.me.pose.result == NONE] return;

[state.dyn.me.pose.result != READY]
{
do_set_timer(5);
state.dyn.me.do.state2 = ENTERBAR;
return;//If you hit this don't continue go back, directly back, do not pass go, do not continue script
}
state.dyn.me.do.state2 = NOTHING;
}


whenever you don't want it to continue you have a return;
if we don't have the return on the interrupt the script will set state2 to ENTERBAR but it will continue
and then set state2 to NOTHING

_________________
To install a mod

ESKARN'S TUTORIALS

Eskarn's Dungeon Mod(BETA)

Eskarn's puzzle map (story)


Wed May 10, 2017 11:51 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 20 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group.
Designed by X-Moon Productions.