Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Doubt about a puzzle idea (script)
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: Doubt about a puzzle idea (script)

Feel free to use CheckPoint() to restart the room, but to call it the player has to die. CheckPoints are only really used upon death if I remember correctly. Unsure if a CheckPoint will reset the vases though, so use ResetProp() for that.

As for the order itself, since breaking the wrong order will force you to restart, it can simply be an incrementing local variable.

PHP Code: (Select All)
int vasesBroken 0;

void BreakVase(string &in asEntitystring &in type)//This can be a standard SetEntityFuncCallback as OnBreak
{
    if(
type != "OnBreak") return;

    if(
vasesBroken == && asEntity == "vase_1") {
        
vasesBroken++;
        return;
    } 
    if(
vasesBroken == && asEntity == "vase_2") {
        
vasesBroken++;
        return;
    }
    if(
vasesBroken == && asEntity == "vase_3") {
        
//Success, you reached the end of the order. Add your success code here, before return;
        
return;
    }

    
//If you get here, it's the wrong order, restart code here, call CheckPoint, ResetProp etc...


This code might do it. I'm sure there are better ways to write it but this is the first that popped into my head. I haven't tested it though.
Change the vase names to the order you need, and add this callback to all your vases.
(If nothing happens, try removing the OnBreak line. I might be remembering it wrong)

(This post was last modified: 03-07-2016, 02:54 AM by Mudbill.)
03-07-2016, 02:48 AM
Find


Messages In This Thread
RE: Doubt about a puzzle idea (script) - by Mudbill - 03-07-2016, 02:48 AM



Users browsing this thread: 1 Guest(s)