Tuesday, 6 May 2014

Script Commands A Plenty

A quick blog today as it's been all code and no play.  More great work on on the AI back-end by Dave, our trees have a whole new collision mode which uses physics cylinders for super smooth and appropriate collision for trees large and small, and I have added more commands to flesh out the scripting system and to help Dave on the AI.  As a way to beef up my blog, here is a complete cut and paste list of the current LUA commands. Remember, these do not include the new DarkAI commands which hook 'directly' into the DarkAI module :)

function Prompt(str)
function StartTimer(e)
function GetTimer(e)
function Destroy(e)
function CollisionOn(e)
function CollisionOff(e)
function Hide(e)
function Show(e)
function Spawn(e)
function Collected(e)
function MoveUp(e,v)
function MoveForward(e,v)
function MoveBackward(e,v)
function SetAnimation(e)
function SetAnimationFrames(e,v)
function PlayAnimation(e)
function LoopAnimation(e)
function StopAnimation(e)
function SetAnimationSpeed(e,v)
function GetAnimationFrame(e)
function CharacterControlUnarmed(e)
function CharacterControlLimbo(e)
function CharacterControlArmed(e)
function CharacterControlFidget(e)
function SetCharacterToWalk(e)
function SetCharacterToRun(e)
function RotateToPlayer(e)
function AddPlayerWeapon(e)
function AddPlayerAmmo(e)
function AddPlayerHealth(e)
function WinZone(e)
function Checkpoint(e)
function GetPlayerInZone(e)
function PlaySound(e,v)
function LoopSound(e,v)
function StopSound(e,v)
function SetSoundSpeed(freq)
function SetSoundVolume(vol)
function FireWeapon(e)

Most of my remaining work this week will be to support the AI system so the character can do more things, and of course plug those essential gaps in the general script command library as required.

11 comments:

  1. hey lee, big list :).. anyway you could add 1 more please man?, 1 to control deaths of enemies and say award points for kills lol please?!. or 1 we can alter to allow this to happen? thanks for all your hard work m8 keep it coming :)

    ReplyDelete
  2. Sounds like things are coming along nicely. :) I hope with the next update that more characters will be released or even for purchase. The game contest (which ends in only 3 weeks!) wants a game of "any genre" but the only enemy so far is a modern day soldier. At this point the 10 winning games are all going to look like Call of Duty or Battlefield, unless some different types of characters are released (sword & sorcery/aliens/horror/etc.). Anyway, I love how everything is finally coming together. Keep up the great work!

    ReplyDelete
  3. How bout some more key press functions so we can use more then E :D and the possibility of displaying a value on the screen somewhere without having to use prompt I.e cash amounts or current score ?,

    But it is all coming along very nicely

    ReplyDelete
  4. Looks really good.

    Nit-picky point: parameters should ALWAYS be self-explanatory whole words; the old-fashioned method of using single letters as function parameters is silly. Yeah, you might save maybe 2 minutes of typing in the whole day, but you lose 2 hours in trying to remember what the letters stand for.

    ReplyDelete
  5. Lee, can we please get a function to set an entity's xyz rotation? Moving forward, backward, and up is awesome, but without precise rotation, we are going to be handcuffed with certain things that would really be useful.

    ReplyDelete
  6. Is it possible yet to check whether mouse buttons are being pressed? If not, that would also be an awesome addition to v1.007.

    ReplyDelete
  7. I second Tom Scott's request: commands TurnLeft(e,v), TurnRight(e,v).
    These would be the analogs of MoveBackward(e,v), MoveForward(e,v).

    And even better if we had things like GetX(e,v), SetX(e,v), GetY(e,v), ....
    and GetTheta(e,v), SetTheta(e,v) etc.

    Thn

    ReplyDelete
  8. Instead of TurnLeft/Right you have RotateX command. GetX can be done with g_entity[e,'x'] :)

    ReplyDelete
    Replies
    1. RotateX? Does that mean around X (as it appears) or by X (which is silly)? Because rotating by X would make the entity roll over forward.

      Delete
    2. Think bigger! P.S. We also have RotateY...

      Delete
    3. Oh ok :) For some reason I assumed you only had RotateX... :P

      Delete