Puzzle Design Thread (for classic adventure Lucasarts style or Sierra)

  • #20, z gabartsWednesday, 24. May 2017, 13:47 hodinky 7 years ago
    Yes! This is great! Thanks

    Fanoušek fóra

    137 Posts


  • #21, z gabartsMonday, 05. June 2017, 12:48 hodinky 7 years ago
    I'd like to execute the same action on a scene object, I've linked 3 conditions and each time the action is different. My command is "execute command" on object but the problem is that the character is performing all the actions at once.

    I mean, the first time he peforms the command I change the 1 condition to true, but I've put the code for the "new condition" with an if in the same execute command, so is basically checking 3 conditions in a row...

    How to perform the 1 action, then stop and only the second time I click to check for the second condition?

    Fanoušek fóra

    137 Posts

  • #22, z afrlmeMonday, 05. June 2017, 12:54 hodinky 7 years ago
    I'd like to execute the same action on a scene object, I've linked 3 conditions and each time the action is different. My command is "execute command" on object but the problem is that the character is performing all the actions at once.

    I mean, the first time he peforms the command I change the 1 condition to true, but I've put the code for the "new condition" with an if in the same execute command, so is basically checking 3 conditions in a row...

    How to perform the 1 action, then stop and only the second time I click to check for the second condition?
    Use a value instead. wink

    if value "example" equals 3
     add some action parts here
    endif
    if value "example" equals 2
     add some action parts here
    endif
    if value "example" equals 1
     add some action parts here
    endif

    Notice the reverse order of values. If you do it the other way then you need to include a quit current action action part just before each of the endif action parts.

    Imperátor

    7285 Posts

  • #23, z gabartsMonday, 05. June 2017, 13:52 hodinky 7 years ago
    Thanks! I tought also to another solution, much more longer, of using different duplicate objects but this is the quickest if I manage to make it working smile

    Fanoušek fóra

    137 Posts

  • #24, z sebastianMonday, 05. June 2017, 14:18 hodinky 7 years ago
    if value "example" equals 3
     add some action parts here
    endif
    if value "example" equals 2
     add some action parts here
    endif
    if value "example" equals 1
     add some action parts here
    endif

    Notice the reverse order of values. If you do it the other way then you need to include a quit current action action part just before each of the endif action parts.

    In case you check for "equal" it doesn't matter which order you sort them...

    Kapitán

    2346 Posts

  • #25, z afrlmeMonday, 05. June 2017, 14:27 hodinky 7 years ago
    hehe, but if they incremented the value inside of the if query then it would matter.

    if value x = 1
     some actions
     value x +1 or value x = 2
    end if
    if value x = 2
    ... etc.

    it would end up triggering the actions in the next query.

    Imperátor

    7285 Posts

  • #26, z gabartsMonday, 05. June 2017, 14:36 hodinky 7 years ago
    Worked perfectly, thanks!

    Fanoušek fóra

    137 Posts

  • #27, z MachtnixMonday, 05. June 2017, 15:22 hodinky 7 years ago
    Notice the reverse order of values. If you do it the other way then you need to include a quit current action action part just before each of the endif action parts.

    What is this "quit"? I have learned that "quit" works in loops only (which I can confirm). 

    Kapitán

    1097 Posts

  • #28, z MachtnixMonday, 05. June 2017, 15:43 hodinky 7 years ago
    @AFRLme: I need to log in on dropbox to download your puzzle example. But I haven't an account, And I don't want one. 

    Kapitán

    1097 Posts

  • #29, z sebastianMonday, 05. June 2017, 16:41 hodinky 7 years ago
    Notice the reverse order of values. If you do it the other way then you need to include a quit current action action part just before each of the endif action parts.

    What is this "quit"? I have learned that "quit" works in loops only (which I can confirm). 
    "quit action" is an action part in VS. The "code" he posted was pseudocode representing only action parts, not lua.
    Quitting an action in VS itself can be done everytime. It just "kills" the containing action parts (if any).


    Kapitán

    2346 Posts

  • #30, z afrlmeMonday, 05. June 2017, 16:44 hodinky 7 years ago
    @AFRLme: I need to log in on dropbox to download your puzzle example. But I haven't an account, And I don't want one. 
    Anyone should be able to download it. There is usually 2 download options with dropbox. Add to your dropbox account or download directly. I'm pretty sure you don't need an account or need to be logged in.

    @ Machtnix: quit current action is an action part that prevents the rest of the action parts listed after it from being executed. Basically it kills the entire action block.

    *edit: sorry. I shared the wrong link. Here you go: https://www.dropbox.com/s/tbm3v3p0zf0zjw1/CyclePuzzle.zip?dl=0 Just click on the no thanks & continue button & you should be able to access the page with a download button on it.

    If you ever see me talking about actions or if queries & they are written in italic, then I'm likely referring to action parts. I will always write Lua script in code boxes.

    Imperátor

    7285 Posts