Suggestion: More parameters for run-script

Started by Janik, Thu 03/11/2005 04:37:37

Previous topic - Next topic

Janik

Hi,

I would like to suggest allowing several parameters to the run-script command in dialogs, say, four or five integers. The way I would use it would be, for example:

run-script 101, 2, 5

where 101 is a command ID, say that here this is to change the expression used in the speech view;
2 would be the character ID;
5 would be the loop to use.

an other parameter might allow for a delay before changing the expression, etc. All the parameters (other than the first) would be optional. With many parameters, it makes it possible to do a lot from within a dialog script with much less code, and in a much more maintanable way.

Thanks!
Play pen and paper D&D? Then try DM Genie - software for Dungeons and Dragons!

Gilbert

It can be handy having that, so maybe the dialog_request() function can be defined like this:

function dialog_request(int val1, int val2=0, int val3=0, int val4=0, int val5=0) { ...}
Having optional parameters makes it flexible.


However, it's currently possible with a not-so-annoying method, like:
Dialog Script:
set-globalint 10 2
set-globalint 11 5
run- script 101

dialog_request():
if (value==101) {
  int charid=GetGlobalInt(10);
  int charview=GetGlobalInt(11);
  bla bla bla...


I think it's not of high priority.

Elliott Hird

A bit clogged up really...

You should just do what gilbot suggested really, I don't think that many people would use it.

Janik

Yes, it's a reasonable work around. Though the optional parameters to dialog_request would make it less clogged-up, definitely not more.
Play pen and paper D&D? Then try DM Genie - software for Dungeons and Dragons!

Pumaman

Really I'd like to change the whole way this works, dialog_request is rather a messy way of doing it. However, I'm still not sure what the best solution is.

Janik

Hmm, how about having a chunk of script code right there in the dialog script? Perhaps just have curly brackets indicate the start/end of it.

For example:
Code: ags

@1
ego: "Hello. How are you?"
narrator: The man looks you in the eye.
{
cOtherman.Walk(220, 330, eBlock);
cOtherman.LockView(12);
cOtherman.Animate(0,0, eOnce, eBlock, eForwards);
cOtherman.UnlockView;
}
otherman: ...
otherman: "I'm fine."
return


I'm not sure how that would work behind the scenes - perhaps each code block would have a function automatically created for them - sort of like an on-the-fly dialog_request().
But it would be very neat, keeping all the related conversations and code together.
Play pen and paper D&D? Then try DM Genie - software for Dungeons and Dragons!

Pumaman

That would be a really handy way of doing it; how practical it is depends on technical considerations though, but I'll certainly think about it.

Elliott Hird

how about run_script myscript 1 2 3 calls dialog_myscript(1, 2, 3); and dialog_myscript would be defined as function dialog_myscript(int 1, optional int 2, optional int 3) - this would allow varible amount of paramaters, and would be similar to the gui _click functions.

strazer

#8
Quote from: Janik on Sat 05/11/2005 07:01:46
Hmm, how about having a chunk of script code right there in the dialog script? Perhaps just have curly brackets indicate the start/end of it.

That looks really neat. I hope something like this can be implemented.

Edit:

Tracker'd: http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=550

SMF spam blocked by CleanTalk