rollout

hi everybody

I have a little problem and I can't find a solution.

Code :

if b<0 then
(

open rollout
button yes do
button no do
close rollout
)
else
(

)
if d
open rollout
button yes do
button no do
close rollout
)

here is what look like my code, the problem is that he doesn't stop when I open a rollout waiting for an answer of the user and directly go to the next if and open the next rollout immediately before the user could even answer at the first rollout.

I don't know why, thank you very much for your help.

sorry for my english.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jos's picture

createDialog/destroyDialog?

You can use createDialog and destroyDialog
Is this what you need?

(
local test,test2
rollout test "test"
(
	button btnNew "open new"
	button btnClose "close this"
	on btnNew pressed do
		createDialog test2
	on btnClose pressed do
		destroyDialog test
)
 
rollout test2 "test"
(
	button btnClose "close this"
	on btnClose pressed do
		destroyDialog test2
)
createDialog test
)
plug's picture

thank, it wasn't what is was

thank, it wasn't what is was looking for but it helped me to find a solution at my problem

plug's picture

her is the real code , b , d

her is the real code , b , d was just name for show that it was a variable but nvm.

on btnLoad pressed do
(
-----------Variables---------------
global firstframe = start_frame.text as number
nextframe = firstframe + 1
nameclip = Name_Load.selected as string
myBip = myBiped.transform.controller
tempFil = (DirFile + "TempFile.bip")
format "f : % \n " firstframe
--animationRange = interval firstframe nextframe
bipRange = biped.getCurrentRange myBiped.controller
lastFrame = bipRange.end
interv = firstframe - lastframe
format " intervalle : % \n" interv
-- If FigureMode activated, show an error message
-- otherwise open motion mixer, load the bip file in it
-- then mixdown the clip or clips and copy them to the biped

max motion mode

if myBiped.controller.figureMode == true then ( messageBox "Please Exit Figure Mode." )
else (
global BipedPastFile = (DirFile + Name_Load.selected +".bip")
disablesceneredraw()
format "time : % \n" currentTime
global mymixer = myBip.mixer
if getTrackgroup mymixer 1 == false do
(
insertTrackgroup mymixer 1
)
global mytrackgroup = getTrackgroup mymixer 1
global mytrack = getTrack mytrackgroup 1
if interv < 0 then
(
global CleanDialog = newRolloutFloater "clean" 300 85
rollout CleanRollout "there is already an animation at this frame, do you want to remplace it ? " width:350 height:70
(
button go_yes2 "Yes" pos:[170,17] width:72 height:31
button go_no2 "No" pos:[50,17] width:72 height:31
on go_yes2 pressed do
(
clearTrackgroup mytrackgroup
appendClip mytrack BipedPastFile true 0
myclip= getclip mytrack mytrack.numClips
moveClip myclip firstframe
format "clean\n "
closeRolloutFloater CleanDialog
mixdown mymixer false true 0 false 180.0
format " mixdown \n"
copyMixdownToBiped mymixer
format "copy biped \n"
enablesceneredraw()
max views redraw
format " load \n"
)
on go_no pressed do
(
format " noclean \n"
closeRolloutFloater CleanDialog
mixdown mymixer false true 0 false 180.0
format " mixdown \n"
copyMixdownToBiped mymixer
format "copy biped \n"
enablesceneredraw()
max views redraw
format " load \n"
)
)
addrollout CleanRollout CleanDialog
)
else
(
appendClip mytrack BipedPastFile true 0
myclip= getclip mytrack mytrack.numClips
moveClip myclip interv
mixdown mymixer false true 0 false 180.0
format " mixdown \n"
copyMixdownToBiped mymixer
format "copy biped \n"
enablesceneredraw()
max views redraw
format " load \n"
)

)
-- If the animation is a Run or a Jump, show a message box asking if you want to modify the animation, if yes open the "Run Custom" or the " Jump Custom"
if matchpattern Name_Load.selected pattern:"*run*" == true or matchpattern Name_Load.selected pattern:"*jump*" == true then
(
format "run or jump \n"
global CustomDialog = newRolloutFloater "Custom" 300 85
rollout CustomRollout "Do you want to customize your animation ? " width:350 height:70
(
button go_yes "Yes" pos:[170,17] width:72 height:31
button go_no "No" pos:[50,17] width:72 height:31
on go_yes pressed do
(
if matchpattern Name_Load.selected pattern:"*run*" then
(
fileIn "customRunFin.ms"
format "run \n"
closeRolloutFloater CustomDialog
)
else
(
fileIn "customJumpFin.ms"
format "jump \n "
closeRolloutFloater CustomDialog
)
)
on go_no pressed do
(
closeRolloutFloater CustomDialog
)
)
addrollout CustomRollout CustomDialog
)
)
)

so when i press load, the code start, enter in the 1st if, show the rollout and before and answer user, go directly in the second if and open another rollout.

fredCastonguay's picture

can you post the real code?

can you post the real code? and a bit before and after so we can see whats really going on.

what's B and d?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.