Jump to content
Sign in to follow this  
Winters

Scripting Dialog Sequences

Recommended Posts

Hello,

I was wondering if it was possible to script a sequence of dialogs.

I am trying to show a series of pics that would flash on the screen for a few seconds each. So far i am not having any luck at all. Here is a form of the script i have tried.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">opndlg = createdialog "dialog1"

~3

closedialog 0

opndlg = createdialog "dialog2"

and so on....

any ideas how to make this work?

Share this post


Link to post
Share on other sites

Best way to do this right now is to take a look at the code for the COC tomahawk intro pack and see how it got handled. I have a massive tutorial on dialog processing nearly done, but like other massive projects, its not done yet, but soon.

Share this post


Link to post
Share on other sites

Actually winters it's not too hard to do at all....

it's been a while since i've played with the scripting so I could be a lil rusty with my answer but I know it is possible....

define the picture within the dialog...and take note of the ID number that you assign it

Then I think the line to remove the picture is this....

CtrlShow[<ID NUMBER>, false] (or you could use true to show the picture)

There's no need to create separate dialogs ever (well in normal cases), all you have to do is hide and show the controls or pictures with the ctrlshow[....] code syntax

You can also take it another step further and actually check to see whether a control or picture is being shown...

?!(ctrlvisible <id number>):

I hope this helps

Sorry for the bad explination... I've only had 3 hours sleep for the past few days and I'm sick crazy_o.gif

Share this post


Link to post
Share on other sites

Thanks for the info, could i use this in a script with the: ~3 to set up a delay?

I never used the ctrlshow command before so thats why i ask. I will consult the comref and experiment a bit until i hear back from you as well as to take a look at COC Tomahawk.

Hope you feel better.

Share this post


Link to post
Share on other sites

You should better use (in a control that is an image)

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

CtrlSetText [_id, _path_to_picture];

you can let the picture disappear with

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

ctrlSetText [_id, ""]

Share this post


Link to post
Share on other sites

I think i've used that technique too, just seemed easier for me to use false, or true ...so i wouldn't have to search for the file or change the file path later.

But yes you can use the pause in your scripts, everything works exactly the same within the dialog scripts as it does in just normal ones...

just set up a sequence of displaying the image or something....

if you didn't mind using the ctrlshow sequence you could set up a loop...such as for example...

set up the picture ID's in order of appearance in your resource file

pic 1 --> 100

pic 2 --> 101

pic 3 -->102

and so on....

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_idc=100

#loop

ctrlshow[_idc, true]

~3

ctrlshow[_idc, false]

_idc = _idc +1

?(_idc< (your number)): goto "loop"

this could save in having to write sequences of the file path ...either way works

p.s. thanks for all of the tutorials also vektor, I learned a great deal from them!!

Share this post


Link to post
Share on other sites

Well i worked it all out, thanks for the help all. I tried it many ways and when i used ctrlshow nothing happened and when i used ctrlsettext i got an unknown operator error message. I finally managed to get it working by doing this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">opndlg = createdialog "dialog1"

~3

action= closedialog 0

opndlg = createdialog "dialog2"

and so on....

so all i really did was add "action=" and it works like a charm now.

Share this post


Link to post
Share on other sites

Hmmm interesting..

It works like a charm for me... maybe it has to do with how the picture is classified in the description file??

All in all I'm glad you have it working

Share this post


Link to post
Share on other sites

maybe, i used the dialog maker to set it all up. but thanks to all the suggestions given here i was able to try different things and that eventually led me to the solution biggrin_o.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×