XenoBot Forums - Powered by vBulletin

User Tag List

Page 3 of 6 FirstFirst 12345 ... LastLast
Results 21 to 30 of 51

Thread: [Discussion] Scripter: Variables, Functions, and Events

  1. #21
    Technical Support jo3bingham's Avatar
    Join Date
    Dec 2010
    Posts
    697
    Mentioned
    107 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Efren View Post
    They exist, Check the Creature.lua
    Code:
    ---------------------------------------------------
    -----------  Relational Properties	---------------
    ---------------------------------------------------
    
    function Creature:isSelf()
    	return self._id == getSelfID()
    end
    
    function Creature:isTarget()
    	return self._id == getSelfTargetID()
    end
    
    function Creature:isFollowed()
    	return self._id == getSelfFollowID()
    end
    Burn! Ohhh, but seriously, he probably wasn't aware of the Creature.lua file, or unable to read. Which is correct? I'm unsure.

  2. #22

    Join Date
    Dec 2011
    Posts
    164
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Efren View Post
    They exist, Check the Creature.lua
    Code:
    ---------------------------------------------------
    -----------  Relational Properties	---------------
    ---------------------------------------------------
    
    function Creature:isSelf()
    	return self._id == getSelfID()
    end
    
    function Creature:isTarget()
    	return self._id == getSelfTargetID()
    end
    
    function Creature:isFollowed()
    	return self._id == getSelfFollowID()
    end
    Well, they're not documented.

  3. #23
    Lifetime Subscriber Efren's Avatar
    Join Date
    Dec 2010
    Location
    Mexico NL, Monterrey
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Raphael View Post
    Well, they're not documented.
    They are, is the same as writing
    Code:
    Creature:isSelf()
    Creature:isTarget()
    Creature:isFollowed()
    
    or maybe just (correct me if I'm wrong.)
    isSelf()
    isTarget()
    isFollowed()

  4. #24

    Join Date
    Dec 2011
    Posts
    164
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Efren View Post
    They are, is the same as writing
    Code:
    Creature:isSelf()
    Creature:isTarget()
    Creature:isFollowed()
    
    or maybe just (correct me if I'm wrong.)
    isSelf()
    isTarget()
    isFollowed()
    That's not documentation, that's implementation. This is documentation, and is where the thread starter states that ALL variables and functions would be.

  5. #25
    Lifetime Subscriber Efren's Avatar
    Join Date
    Dec 2010
    Location
    Mexico NL, Monterrey
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Raphael View Post
    That's not documentation, that's implementation. This is documentation, and is where the thread starter states that ALL variables and functions would be.
    There's no need of writing getSelfID() instead of Creature:isSelf() or isSelf(), both works the same way just that they are written with a "diferent name". and writing EVERY SINGLE "variable" that is used for a variable that already exist would be a pain on the ass.

    For example
    Code:
    LookDirection() is the same as writing getCreatureLookDirection(self._id)
    Speed() is the same as writing getCreatureSpeed(self._id)
    Outfit() is the same as writing getCreatureOutfit(self._id)
    HealthPercent() is the same as writing getCreatureHealthPercent(self._id)
    There's no need for the users/customers of knowing the "return value" of each variable.

  6. #26

    Join Date
    Dec 2011
    Posts
    164
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Efren View Post
    There's no need of writing getSelfID() instead of Creature:isSelf() or isSelf(), both works the same way just that they are written with a "diferent name". and writing EVERY SINGLE "variable" that is used for a variable that already exist would be a pain on the ass.

    For example
    Code:
    LookDirection() is the same as writing getCreatureLookDirection(self._id)
    Speed() is the same as writing getCreatureSpeed(self._id)
    Outfit() is the same as writing getCreatureOutfit(self._id)
    HealthPercent() is the same as writing getCreatureHealthPercent(self._id)
    There's no need for the users/customers of knowing the "return value" of each variable.
    No, they are different things.

  7. #27
    Lifetime Subscriber Efren's Avatar
    Join Date
    Dec 2010
    Location
    Mexico NL, Monterrey
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Raphael View Post
    No, they are different things.
    Is the same thing, all of 'em are the return values of a variable, just look at this code.
    Code:
    -- On this code the variable is "Speed()"
    -- and the return value (for the variable to work) is getCreatureSpeed(self._id)
    -- So There's no need for the users/customers of knowing the "return value" of each variable.
    
    -- code starts here
    function Creature:Speed()
    	return getCreatureSpeed(self._id)
    end

  8. #28

    Join Date
    Dec 2011
    Posts
    164
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Ok then. Tell me how you find the Name of your target only using isTarget().

  9. #29
    Lifetime Subscriber Efren's Avatar
    Join Date
    Dec 2010
    Location
    Mexico NL, Monterrey
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Raphael View Post
    Ok then. Tell me how you find the Name of your target only using isTarget().
    maybe with getById(isTarget())

    --comment, You will never find the name of your target only using the isTarget() the only thing you get is their id, so you need to convert that id to a name, using the getById.
    (If I'm not mistaken)
    Last edited by Efren; 01-06-2012 at 10:22 PM. Reason: Added comment

  10. #30

    Join Date
    Dec 2011
    Posts
    164
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Efren View Post
    maybe with getById(isTarget())

    --comment, You will never find the name of your target only using the isTarget() the only thing you get is their id, so you need to convert that id to a name, using the getById.
    (If I'm not mistaken)
    You don't get the fucking id using isTarget(). That only proves they're different things.
    What I meant is, find the name of your target without directly using getTargetId().
    Last edited by Raphael; 01-06-2012 at 11:05 PM.

Posting Permissions

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