Modding Help Players, status effects, CallScriptedEntity

Discussion in 'Starbound Modding' started by Chipppy, Nov 18, 2015.

  1. Chipppy

    Chipppy Scruffy Nerf-Herder

    Okay, so I need to send a status effect after interacting with an NPC. Sort of like a doctor or something. This is an NPC to Player interaction. Right now I'm trying

    Code:
    world.callScriptedEntity( patient, "status.addEphemeralEffect", { doctord, 30} )
    where patient is the player's id and doctord is the name of the status effect.

    The error I'm getting back is:
    Entity -65536 does not exist or is not a local master scripted entity

    Which makes sense, I understand players don't have normal IDs. Is there anyway to make this work with callScriptedEntity without resorting to projectiles so I can have it work on ships?

    I have also tried
    Code:
    world.callScriptedEntity( world.entityUuid( patient ), "status.addEphemeralEffect", { doctord, 30} )
    It gives me back:
    attempt to call a nil value (field 'entityUuid')

    I have had so many problems with this engine. Please PLEASE tell me this is possible.
     
  2. TheElderScroller

    TheElderScroller Pangalactic Porcupine

    The thing with the world.entityUuid looks like it can't be called by npcs. I wouldn't work like that anyway because you need the ID and not the UUID of the player, so just patient would be enough.
    Now to the world.callScriptedEntity part: As the error says, players aren't the right kind of entities to call scripts on, like projectiles or itemdrops...
    If you could call scripts on players with world.callScriptedEntity this would be devastating...
    I guess the way you imagine won't work.
     
  3. Chipppy

    Chipppy Scruffy Nerf-Herder

    Okay, do you have a different method to add a status effect to the player without using a projectile?
     
  4. TheElderScroller

    TheElderScroller Pangalactic Porcupine

    By tech yes... But I guess that's no option for you...
     
  5. The | Suit

    The | Suit Agent S. Forum Moderator

    Players as far as I am aware are not considered entities either way.
    So it would not work in that direction.
     
  6. Peelz

    Peelz Giant Laser Beams

    Why is spawning a projectile a problem on ships?
     
  7. TheElderScroller

    TheElderScroller Pangalactic Porcupine

    On ships there is commonly combat disabled, projectiles dont hit any entity. And better dont shout out how to workaround it...
     
  8. Chipppy

    Chipppy Scruffy Nerf-Herder

    Then PM me it please. Or if you know how to disable ship immunity, also please tell me.
     

Share This Page