Turn character (SOLVED) (and about the reason for some things in AGS)

Started by Hans, Fri 05/01/2007 21:58:12

Previous topic - Next topic

Hans

Quote from: Ishmael on Mon 08/01/2007 10:16:54
Dialog.Start runs last so the script block can finish before the engine starts parsing the dialog out, so it doesn't have to retain the old code suspended in the background when for example running dialog_requests, I believe.

I think you're missing my point. "Dialog.Start" doesn't run last, when placed in "Run script". I am talking about that noob thing without any codes. If you have first "Run script", that makes the character turn and second "Run dialog", that starts a dialog, the script will be the last to be run. This makes the character turn after saying something.
Why is the "Run script" always the last to be run?

(Not important: Dialog.Start IN a "Run script" is not last. That one is done in the right order.)

Ashen

Kind of off-topis but:
Quote
Dialog.Start IN a "Run script" is not last. That one is done in the right order.

No. As both Ishmael and I have said Dialog.Start() will be queued to the end of the Run Script interaction - it's just that in your code, it's the last thing that should be run anyway so you don't notice. Try something like this and see:
Code: ags

MyDialog.Start(); // Replace with actual dialog name
Display("Hello!");


It should display "Hello!" before it starts the Dialog.

If,as Ishmael says, there's a valid reason for it to behave like that then OK. It's easy enough to have code that runs after the dialogue anyway (use two 'Run script's, and split them at Dialog.Start()). It's still a little strange that the 'Run script' commands are queued to after Interaction Editor commands, but I can't see that changing - Chris has said the Interaction Editor is VERY low priority to be fixed up as so few people actually use it in the long term. (And everyone on the forums will advise them to learn scripting anyway...)
I know what you're thinking ... Don't think that.

Hans

Okay... I'm sorry. I mixed "first" and "last" up. You're right when you say that Dialogs are the last in scripts.
But that doesn't count for things like cEgo.Say("Hello"); .
That will be done in the right order.

So if you want a dialog to start and something to happen after that, you'll have to make a second "Run script". But why? What is the purpose of it?
The interaction editor may be for noobs, but when you want to make a good program, you also want that tot work good if it really isn't done by purpose. And it looks so unlogic. It looks like it has been done with a purpose, because else it would probably just run in the right order. Wouldn't it?
Is there anyone who knows why dialogs are run last in a script and why scripts are run last in the interaction editor?

Ishmael

I already explained why dialogs are ran last in a script block.

I can't find the diagram right now, but it's somewhere in the manual. AGS handles three script threads, one is blocking, one is non-blocking and the third is IIRC always ran in the background, handling on_mouse_clicks and such. I might remember that wrong, tho. AGS can so only run one non-blocking user script at a time. I think the interaction editor functionality has to do with this; AGS parses the interactions out of the way and then takes on the script thread. Probably to prevent memory access conflicts and other causes of possible crashes.

None of this is certified information, I'm just guessing.
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Hans

I am sorry that I am going to post again, but there are no new reaction. Does this mean that nobody really knows the exact reason for all this?

Khris

Quote from: James Blast on Mon 08/01/2007 16:43:05It looks like it has been done with a purpose, because else it would probably just run in the right order. Wouldn't it?
Is there anyone who knows why dialogs are run last in a script and why scripts are run last in the interaction editor?
As Ishmael already explained, this behavior has probably internal reasons. I really doubt it's done on purpose to confuse noobs.
It is absolutely no problem to work around that "wrong" execution order, so why the hell is this so important to you?

Hans

I know that it doesn't seem relevant, but I am really fascinated by this. If it isn't done on purpose, why is it still there? You see, I think it is done on purpose, because it doesn't make sense to still have that sort of bugs in this version of AGS. So why is it like that? And you keep saying your own ideas, but nobody really does know the answer.
If it is a bug, it should be repaired. Yes, yes... It is not a big problem (for you), but if it is a bug, it is a bug! And bugs have to be repaired. And what about noobs? Isn't it a problem for them? Like this, it's almost impossible for them to avoid scripting.
If nobody knows the answer, the reason, the positive side of it... why not change it?

Khris

Ok, let me rephrase: It has internal reasons. It's certainly not a bug.
And newbies who avoid scripting won't even encounter this, unless they use the RunScript action, which they aren't, right?

It's like loving to eat cookies but complaining about them crumbling. Just deal with it ;)

Hans

You're right. Noobs don't even use Run script... Unless they want to do something that's not possible with the Interaction Editor, just something simple, like turning your character! And then they have to learn scripting...
*sigh*
I'll stop posting on this topic now (, but I am still wondering..).

Thanks a lot  for all your reactions!

Khris

If it really bothers you that much, why don't you write a PM to Pumaman?

Hans

Because I've never done that before and I don't know how.  ;D


Pumaman

Quote from: James Blast on Wed 10/01/2007 11:44:03
If it isn't done on purpose, why is it still there? You see, I think it is done on purpose, because it doesn't make sense to still have that sort of bugs in this version of AGS. So why is it like that? And you keep saying your own ideas, but nobody really does know the answer.
If it is a bug, it should be repaired. Yes, yes... It is not a big problem (for you), but if it is a bug, it is a bug! And bugs have to be repaired. And what about noobs? Isn't it a problem for them? Like this, it's almost impossible for them to avoid scripting.
If nobody knows the answer, the reason, the positive side of it... why not change it?

You could think of it as a bug, yes. However, because of the fact that the interaction editor is only used by new people starting out, who will generally progress quickly onto scripting, the time it would take to fix the issue isn't worthwhile compared to the seriousness of it.

And KhrisMUC, please don't encourage people to PM me technical questions. If it needs an answer, please ask a moderator to move the thread to the main Technical Forum.

Ashen

Indeed.

James, if you still need an answer, PM me (now that you know how), and I'll re-open the thread and move it to the Tech forum (the proper location for suggestions / discussions of the engine). Otherwise, can we FINALLY let this rest?
I know what you're thinking ... Don't think that.

SMF spam blocked by CleanTalk