Modding Help world.callScriptedEntity

Discussion in 'Starbound Modding' started by poweredbygamespy, Mar 12, 2016.

  1. poweredbygamespy

    poweredbygamespy Subatomic Cosmonaut

    I have some problems with world.callScriptedEntity. Im using this code
    Code:
    world.callScriptedEntity(id, "entity.say", "hi")
    
    where id contains a valid npcs id and everything works fine. When I try
    Code:
    world.callScriptedEntity(id, "entity.setVelocity", {0, 20})
    
    or
    Code:
    world.callScriptedEntity(id, "entity.setVelocity", {0, 20})
    
    nothing happens.
     
  2. TheElderScroller

    TheElderScroller Pangalactic Porcupine

    use

    Code:
    world.callScriptedEntity(id, "mcontroller.setVelocity", {0, 20})
     
  3. poweredbygamespy

    poweredbygamespy Subatomic Cosmonaut

    worked, thanks. but why does the official wiki say that setVelocity is member of entity if it really is member of mcontroller?
     
  4. Errors4l

    Errors4l Spaceman Spiff

    I'm not going to say what's written there is wrong (it could very well apply for different types of entities), but keep in mind that the Wiki can also contain outdated information: http://starbounder.org/mediawiki/index.php?title=Modding:Lua/Tables/Entity&action=history
    For example, in tech scripts the only values/functions found inside the entity table are:
    entity.id, entity.damageTeam, entity.distanceToEntity, entity.isValidTarget, entity.entityInSight, entity.closestValidTarget.
     

Share This Page