I've looked through all the tutorials and googled for hours, yet I cannot find help for this.
???Simple explanation: I want to trigger a cut scene when I click "Yes" on a GUI.
The GUI and the cut scene work fine apart, but not together.
What happens is if I post the script in the room, the GUI does not respond.
If I post the script in the global area, the cut scene in that room does not respond. (The script doesn't recognize the objects in the room's scene. If I try to define them, it says they already are defined).
Example:
Player interacts with the trash can. GUI appears: "Do you want to tip it over?" Yes/No?
Yes: GUI closed. Player tips the trash over.
No: GUI closed.
The GUI closed just fine with Yes and No, but no cut scene on Yes.
Here is my script:
//In the room. Click trashcan and GUI opens.
function Can_Interact()
{
gTrash.Visible = true;
}
//For buttons in the global area.
function bNo_OnClick(GUIControl *control, MouseButton button)
{
gTrash.Visible = false;
}
function bYes_OnClick(GUIControl *control, MouseButton button)
{
gTrash.Visible = false;
StartCutscene(eSkipESCOnly);
cAlice.Walk(163, 103, eBlock, eWalkableAreas);
Can.Visible = false;
CanTip.Visible = true;
EndCutscene;
}
//Alice walks over and knocks over the trashcan.
Please help if you can.
???Simple explanation: I want to trigger a cut scene when I click "Yes" on a GUI.
The GUI and the cut scene work fine apart, but not together.
What happens is if I post the script in the room, the GUI does not respond.
If I post the script in the global area, the cut scene in that room does not respond. (The script doesn't recognize the objects in the room's scene. If I try to define them, it says they already are defined).
Example:
Player interacts with the trash can. GUI appears: "Do you want to tip it over?" Yes/No?
Yes: GUI closed. Player tips the trash over.
No: GUI closed.
The GUI closed just fine with Yes and No, but no cut scene on Yes.
Here is my script:
//In the room. Click trashcan and GUI opens.
function Can_Interact()
{
gTrash.Visible = true;
}
//For buttons in the global area.
function bNo_OnClick(GUIControl *control, MouseButton button)
{
gTrash.Visible = false;
}
function bYes_OnClick(GUIControl *control, MouseButton button)
{
gTrash.Visible = false;
StartCutscene(eSkipESCOnly);
cAlice.Walk(163, 103, eBlock, eWalkableAreas);
Can.Visible = false;
CanTip.Visible = true;
EndCutscene;
}
//Alice walks over and knocks over the trashcan.
Please help if you can.