Sam and Max interface question

  • #10, by afrlmeSaturday, 30. May 2015, 11:31 10 years ago
    You mean for changing commands? I believe you would have to do an if query for that with action parts or with Lua script as there's no set previous command action part available at the minute.
    -- action part example...
    
    if command is 'walk'
     set command 'use'
    else
     if command is 'use'
      set command 'talk'
     else
      if command is 'talk'
       set command 'walk'
      end if
     end if
    end if
    

    or here's a quick Lua example, if you are feeling adventurous...
    -- add this inside of an "execute a script" action part...
    
    if game.ActiveCommand:getName() == "Walk" then
     game.ActiveCommand = Buttons["Look"]
    elseif game.ActiveCommand:getName() == "Look" then
     game.ActiveCommand = Buttons["Use"]
    elseif game.ActiveCommand:getName() == "Use" then
     game.ActiveCommand = Buttons["Talk"]
    elseif game.ActiveCommand:getName() == "Talk" then
     game.ActiveCommand = Buttons["Walk"]
    end
    

    ... the Lua example above would be for updating to the next command. To set previous command you just need to change the names to suit. If "walk" then set talk instead of look etc.

    As for the reason why it automatically jumps back to the default command after you click on something, it is because you have: Activate Standard Command in the game tab set to: Only after successful execution. This means that if you left click on something & it contains an action for the currently active command, that it will return success & automatically jump back to the default command. Just change the option to Never if you want the players to always have to change the command manually via right clicking or the mouse wheel.

    P.S: by the way, all command will allow the character to walk. If you don't want character to walk for the other commands then it might be an idea to add an if query to the left mouse actions under mouse properties. Just create an execute a script action & add this code to it...
    if game.ActiveCommand:getName() ~= "Walk" and not game.CurrentObject:isEmpty() then
     game.CurrentCharacter.CharacterState = 2 -- stop character
    end
    

    ... the code above will check if walk is not current command & there's no object / character below the cursor & if not then it will stop character from walking to a new destination. I've not tested the code, but it should work ok.

    Imperator

    7285 Posts


  • #11, by AmandaDaySaturday, 30. May 2015, 13:58 10 years ago
    Thank you sooo much! It all has worked beautifully. I finally feel like I'm starting to understand what all the interface controls mean. I stayed away from the LUA scripting for now, but I've copied down all the code you wrote and what it corresponds to in case I want to play with it in future. You are extremely helpful, thank you grin

    Newbie

    32 Posts

  • #12, by inlaidrosesWednesday, 10. June 2015, 23:36 10 years ago
    I would like to thank you loads as well! Just starting out, and was similarly confused by not finding a simple "execute action" in the left mouse button command menu.

    Newbie

    1 Posts

  • #13, by afrlmeWednesday, 10. June 2015, 23:42 10 years ago
    No problem. smile

    Imperator

    7285 Posts