How to stop dialog from replaying

Started by dbuske, Sat 16/07/2011 17:08:02

Previous topic - Next topic

dbuske

Search and help files didn't help.
How do I stop a dialog from running after the player returns to the room.
So, they just have to watch it once.
What if your blessings come through raindrops
What if your healing comes through tears...

NickyNyce

I'm not positive about this, but I think it should help you....check... DoOnceOnly in the manual or in the search database, in the search search database you should find lots of code to help you, type in DoOnceOnly.

Khris

Or put it in "first time player enters room" if it is supposed to run after entering.

Care to address your other thread, btw?

dbuske

DoOnceOnly does not work. Documentation says it is not meant for that.
What if your blessings come through raindrops
What if your healing comes through tears...

monkey0506

#4
QuoteGame.DoOnceOnly

static bool Game.DoOnceOnly(const string token)

This function gives you an easy way of making some code run only the first time that the player encounters it. It is commonly used for awarding points.

The token parameter is an arbitrary string. You can pass whatever you like in for this, but IT MUST BE UNIQUE. It is this string that allows AGS to determine whether this section of code has been run before, therefore you should make sure that you do not use the same token string in two different places in your game.

Returns true the first time that it is called with this token, and false thereafter.

NOTE: This is a static function, and thus need to be called with Game. in front of it. See the example below.

Example:

if (Game.DoOnceOnly("open cupboard")) {
 GiveScore(5);
}

will give the player 5 points the first time this script is run.

Quote from: dbuske on Mon 18/07/2011 14:46:26Documentation says it is not meant for that.

I'm sorry, but where the hell are you reading "this function is not meant for" in any of the above documentation? Either that, or what documentation are you using??

Besides, this function works perfectly for what you need. If it's not working then you need to POST SOME CODE to SHOW US WHAT YOU HAVE ALREADY TRIED.

P.S. "commonly used for" is not synonymous with "exclusively only ever possible to use for". Just so you know.

Atelier

Quote from: dbuske on Mon 18/07/2011 14:46:26
DoOnceOnly does not work. Documentation says it is not meant for that.

Are you sure you're not looking at your washing machine or vacuum cleaner manual? "It is commonly used for awarding points" may have mislead you. But really you can use any command with it.

Code: ags

if (Game.DoOnceOnly("start dialog")) {
   dDialog1.Start();
}

monkey0506

Quote from: Atelier on Mon 18/07/2011 15:07:20Are you sure you're not looking at your washing machine

I honestly think he might be. "I push start button but it not compile. WHY YOU LIE?" :=

Khris

dbuske: Are you making stuff up regarding the manual's contents in order to not look stupid? Like in your other thread you still haven't addressed yet?
It certainly looks that way.

dbuske

Thanks for the reply Atelier. I will check it out today.

To the others, This is enough.  This constant attacks on me are dumb.
I am just a guy trying to make games.
I don't make them for anyone but myself.
A hobby.
No matter what I post I am attacked.
Stop this constant attacks or I will have to take steps to stop it.
What if your blessings come through raindrops
What if your healing comes through tears...

NickyNyce

From what I have read, a bunch of people tried to help you. You then told them they are wrong. The truth is...they are right. When someone goes out of their way to help you and you tell them they are wrong when in fact they are right...you should expect a bit of sarcasm.


ddq

Then keep it to yourself. Stop asking so many incredibly stupid questions without searching the forum, Google, or the manual, quit posting incomplete "games" in the wrong section, and cease being a shining example of failure that seems to be plaguing AGS recently. Sorry for being rude, but you are in the wrong here. 

dbuske

That's it.  I have a right to participate in the forums and ask questions.
Now is the time to take action.
What if your blessings come through raindrops
What if your healing comes through tears...

Matti

#12
Wow.. just wow! You are telling other people to grow up?

Quote
DoOnceOnly does not work. Documentation says it is not meant for that.

1. Both statements are wrong.
2. Why don't you tell us what exactly went wrong? Why don't you post any code? Why don't you ask how to use DoOnceOnly?

Quote
Not the same question at all.  Did you even read this thread, or just worry about rules.
Grow up.

This is from your other thread. Why do you act like Ryan did something stupid (or mean) while he actually pointed you to a thread that adresses your problem? Why isn't it the same question? Why don't you clarify what you're trying to achieve? Why don't you even bother to leave a single reply in that thread?

Quote from: dbuske on Tue 19/07/2011 15:32:00
I am just a guy trying to make games.
I don't make them for anyone but myself.
A hobby.

Ah, do you think people are getting money from helping you? Do you think they have nothing else to do then helping beginners out?

Quote from: dbuske on Tue 19/07/2011 15:52:35
Now is the time to take action.

Yeah, take action: Grow up and act like you're caring about what people say to you or leave it be.

Ryan Timothy B

#13
Quote from: dbuske on Tue 19/07/2011 15:52:35
That's it.  I have a right to participate in the forums and ask questions.
Now is the time to take action.
Oh shit guys. He's going to the police!! I'm too young for prison!

No seriously dbuske. You started a thread asking a question about combining multiple rooms. We try to figure out what you're asking for since you didn't even explain yourself OR answer anyone's questions. You simply just told me to grow up... I'm hurt man. Here I was trying to be your best online friend and you attack me with hate.

Sure my response in the other thread was a little sassy, but it's the bloody internet - and you DID create a thread asking the exact same question as another but denied it, and won't let us know what it really was you were asking.

How do we help you if your only clue is:
Hey guys, I opened AGS, scripted some stuff and now it's giving me an error. How do I fix it?
(Plus what Matti wrote above)

Also don't attack us on our sassy responses while your messages aren't any better.

Khris

Quote from: dbuske on Tue 19/07/2011 15:52:35
That's it.  I have a right to participate in the forums and ask questions.
Now is the time to take action.

Actually, no you don't, at least not in the way you think you do (as in free speech and all that).
For instance if you fail to adhere to the forum rules, the operators of this forum can ban you and there's absolutely nothing you can do about it.

I will also advise you that regardless of what action you're planning to take, if it is anything other than "I will try to understand why people act towards me like the way they do, what I did wrong and will try to use the great resource that this forum provides properly in the future", you're in for some major disappointment.

arj0n

Quote from: dbuske on Tue 19/07/2011 15:52:35
That's it. Now is the time to take action.
Like showing your yet-not-proper-working code so it's way easier for others to help you find what you're doing wrong (code-wise)?
::)

monkey0506

Quote from: monkE3y_05_06 on Mon 18/07/2011 15:02:34I'm sorry, but where the hell are you reading "this function is not meant for" in any of the above documentation? Either that, or what documentation are you using??

Besides, this function works perfectly for what you need. If it's not working then you need to POST SOME CODE to SHOW US WHAT YOU HAVE ALREADY TRIED.

P.S. "commonly used for" is not synonymous with "exclusively only ever possible to use for". Just so you know.

Not an attack. An entirely serious post in which I try to get you to explain what you have actually tried in order to come to these incorrect conclusions that you have. To which, by the way, you totally failed to respond (which is quickly becoming the "norm" of you).

Quote from: monkE3y_05_06 on Mon 18/07/2011 15:10:06
Quote from: Atelier on Mon 18/07/2011 15:07:20Are you sure you're not looking at your washing machine

I honestly think he might be. "I push start button but it not compile. WHY YOU LIE?" :=

Not an attack. Due to the lack of explanation of what you had already done, lack of any posting of code, lack of anything other than telling us that we were all wrong and demanding that we help you properly by giving you something you can directly copy and paste into your project, I decided to post a sarcastic reply, after having first posted one that actually attempted to guide you in the correct direction (to which you totally failed to respond).

Quote from: Khris on Mon 18/07/2011 17:05:45dbuske: Are you making stuff up regarding the manual's contents in order to not look stupid? Like in your other thread you still haven't addressed yet?
It certainly looks that way.

Not an attack. It was clearly and directly proven that the statements you made about the contents of the manual were entirely false, and likely fabricated to try and keep yourself from having appeared to have not actually read the manual. Of course considering you made false statements about the contents of the manual, the illusion is rather broken. Khris simply pointed that out, in addition to pointing out that you have entirely failed to respond to the requests in your other thread to try and understand what you were looking for or trying to achieve (in which thread you also fabricated information about the contents of the manual, and matched your current trend of not responding to the actual attempts to help you).

So, please tell us (although if history serves us, you won't respond to this post at all), who is "constantly" attacking you? Who is constantly going out of their way to do nothing but bombard you with negative and unhelpful statements whilst doing absolutely nothing to try and help you? I demand that you "grow up" (-dbuske) and answer these serious questions before you go around accusing everyone of attacking you.

Bogdan

Quote from: dbuske on Sat 16/07/2011 17:08:02
Search and help files didn't help.
How do I stop a dialog from running after the player returns to the room.
So, they just have to watch it once.

This is how I do that stuff - use variables. Make a global variable called "dialogstart"(or whatever you want) and make it equal to zero when the game starts. Make so that when the dialog will only start if dialogstart is equal to 0, and after the dialog ends change that int to some other number.
Code: ags
 
if (dialogstart == 0) {
dDialog1.Start ();
}

and as I said when inside the dialog you choose option that is stopping the dialog, put
Code: ags
 dialogstart = 1;
before "stop" in the dialog script.
Hope it helps.

Khris

Like was already mentioned in the thread, there's Game.DoOnceOnly() which was specifically introduced in order to avoid having to create and use a variable in cases such as this.

It's very much appreciated that you want to help others and sharing one's solutions is in general a good idea, but digging up an older thread which already contains the correct solution and adding an alternate, not as good or bad one isn't.

Bogdan

Quote from: Khris on Sat 13/08/2011 16:59:31
Like was already mentioned in the thread, there's Game.DoOnceOnly() which was specifically introduced in order to avoid having to create and use a variable in cases such as this.

It's very much appreciated that you want to help others and sharing one's solutions is in general a good idea, but digging up an older thread which already contains the correct solution and adding an alternate, not as good or bad one isn't.

I am really sorry, I did not notice "solved" in the subject, so I thought this was not solved yet. I thought posts before mine were argument for something off topic. Again, I am really sorry for digging up the old thread, I hope I didn't ruin something.

SMF spam blocked by CleanTalk