Results 1 to 3 of 3

Thread: Novashell Scripting Reference

  1. #1
    Squire
    Join Date
    Sep 2009
    Location
    Colorado, USA
    Posts
    25

    Default Novashell Scripting Reference

    Having some problems with the syntax or parameters of certain calls...

    At the moment,
    IsCloseToEntity
    "boolean IsCloseToEntity(Entity ent, number distance"
    and,
    IsCloseToEntityByID
    "boolean IsCloseToEntity(number entityID, number distance"
    I've tried the following and get errors like
    -1: no overload of 'Entity:IsCloseToEntityByID' matched the arguments (Entity, Entity, number). Did you forget a parm?
    Brain: Unknown LUA error (Invalid return type maybe?) in Entity 2753 (scalpel) : OnMouseRight
    -1: no overload of 'Entity:IsCloseToEntity' matched the arguments (Entity, number, number). Did you forget a parm?
    Code:
    if (this:IsCloseToEntityByID(GetPlayer:GetID(), 10)) then
     
    if (this:IsCloseToEntity(GetPlayer, 10)) then
    Probably something stupid but I can't figure it out...

  2. #2
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,377

    Default

    Hmm.. you seem to be using it right, I scanned existing scripts I can see IsCloseToEntity is used in RT_StrongAI\script\ents\turret\turret.lua like this:

    Code:
    if (this:IsCloseToEntity(GetPlayer, m_eyesight))then
    Wait..

    -1: no overload of 'Entity:IsCloseToEntityByID' matched the arguments (Entity, Entity, number). Did you forget a parm?

    You should be sending Entity, number, number here. (The first Entity is covered by the this: part)

    And look at this error:
    -1: no overload of 'Entity:IsCloseToEntity' matched the arguments (Entity, number, number). Did you forget a parm?

    Here, you should be sending Entity, Entity, number.

    Is it possible on your test you used IsCloseToEntityByID and IsCloseToEntity in reverse? (Ie, you sent the Entity to the one that wanted the ID and vice-versa?)

    What's weird is your example is written right.
    Seth A. Robinson
    Robinson Technologies

  3. #3
    Squire
    Join Date
    Sep 2009
    Location
    Colorado, USA
    Posts
    25

    Default

    Quote Originally Posted by Seth View Post
    ...

    What's weird is your example is written right.
    Thank's for replying.. and yes it was right... it seems I forgot to put in the "return true;" now it looks like "return"(s) are now my next challenge..
    Code:
     if (this:Data():Get("ObjType") == "action") then
             if (this:IsCloseToEntityByID(GetPlayer:GetID(), 100)) then
                                  GetTextManager:Add("Do what???", GetPlayer);
                                  return true;
             else
                             GetTextManager:Add("Need to get closer", GetPlayer);
                             return true;
             end
             return true;    // Not working... need to find way of returning so that once a object is determined
                        // to be close enough... that other objects aren't returned the same when they really aren't
     end

Similar Threads

  1. Why not pass GraphicContext by reference?
    By SandHawk in forum Official ClanLib SDK Forums
    Replies: 6
    Last Post: 06-23-2009, 07:48 PM
  2. Search feature on the scripting reference
    By Pleng in forum Novashell Game Creation System
    Replies: 5
    Last Post: 06-05-2009, 11:45 AM
  3. Minor reference error
    By mikael in forum Novashell Game Creation System
    Replies: 1
    Last Post: 07-09-2008, 11:12 PM
  4. CL_Slot undefined reference
    By karaman in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 05-30-2008, 11:00 AM
  5. Unofficial Novashell Scripting API Documentation Thread
    By Ian in forum Novashell Game Creation System
    Replies: 5
    Last Post: 01-08-2007, 07:54 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •