Disabling Hotspot until after dialogue finishes and then Enabling it

Started by 20YearsInTheDakota, Sun 07/09/2014 18:26:42

Previous topic - Next topic

20YearsInTheDakota

Hello,

In my game I have a hotspot, Hotspot1, which is a door that I don't want to be available until after the main character finishes a conversation dSpy with the character cSpy.

I have managed to disable the hotspot using

Code: ags
 hHotspot1.Enabled= false; 


which I put under the function room_Load () for the room where this is happening.

I am just not sure how to get it to become enabled after the conversation is done. I assume I use:

Code: ags
 hHotspot1.Enabled= true; 


But I don't know where to put it. I have read through tutorials on scripting and looked at other forum posts about similar issues but the suggestions didn't work for me. And this scripting stuff is rather confusing for me. I know my question might be simple, but I've really tried to figure it out on my own.

I appreciate any help you can give me.

Thanks


johanvepa

First, you need to disable the hotspot in either game-start in globalscript or in local room_firstload, then it will only disable once, and then stay enabled after the conversation is done. Otherwise it will disable everytime you enter the room and you will need to go through the same conversation again.

Second, to use script in dialog, put the script line in the dialog script, but use two spaces (tap space bar twice) before writing the script that should be played when the dialog option is chosen.

example:
Code: ags


@6
narrator: "Allright, you know the password now. 'Nuff said."
 knowpassword = true;
option-off 6
return

20YearsInTheDakota

Thanks alot! I got it working now.

Moved the disabling code to first load and then figured out I had to type it as hotspot[1].Enabled=true; in the dialogue with the two spaces like you said and it worked!

johanvepa

I am so happy this worked. This is the first time I've had the pleasure of helping someone else ;-D

SMF spam blocked by CleanTalk