+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Learning Entity Discovery.

  1. #1
    Wirererer vortexnl's Avatar
    Join Date
    Sep 2007
    Posts
    114

    Default Learning Entity Discovery.

    I want to learn the basics of Entity Discovery.
    Just a simple thing, like getting the entity of a barrel that is near.
    So I can afterwards applyForce it or something :P

    I have no clue where to start, I hope that someone can help....



  2. #2
    Wirererer Zanik's Avatar
    Join Date
    Sep 2008
    Posts
    118

    Default Re: Learning Entity Discovery.

    Code:
    interval(500)
    findInSphere(Vectorofbarrel)
    Target = find()
    Iirc thats how you do it, you would make Target a persist of course, and you can raise or lower the interval according to how fast you need to update it. This code is also assuming you know how to use vectors, if you dont, go read the wiki.

  3. #3
    Wirererer vortexnl's Avatar
    Join Date
    Sep 2007
    Posts
    114

    Default Re: Learning Entity Discovery.

    so Target = Find() means that the variable Target is the output of the findInSphere?

  4. #4
    Wirererer vortexnl's Avatar
    Join Date
    Sep 2007
    Posts
    114

    Default Re: Learning Entity Discovery.

    God freaking damnit, I get the same fcking error!..
    Code:
    Expression 2: entities\gmod_wire_expression2\core\find.lua:84: attempt to index local 'ent' (a nil value)
    This is my code:
    Code:
    @name Barrel lolz
    @inputs 
    @outputs Name:string
    @persist Barrel:entity
    interval(100)
    findInSphere(vec(0,0,0),1000)
    Barrel=find()

  5. #5
    Wire Sofaking Officer Tibbles's Avatar
    Join Date
    Aug 2008
    Location
    Barnus Philbert Boulevard
    Posts
    867

    Default Re: Learning Entity Discovery.

    Update your wire.

    If you get Lua errors -> YOU IS OUTDATED

  6. #6
    Spucatum Tauri Bull's Avatar
    Join Date
    Jun 2008
    Location
    Finland
    Posts
    6,005

    Default Re: Learning Entity Discovery.

    He's not outdated.
    My signature has a point.
    Quote Originally Posted by Squeakyneb View Post
    when l3ulletje says do it, do it.
    That

    Quote Originally Posted by Anticept View Post
    By the way, Bull is in charge.

  7. #7
    Wirererer Zanik's Avatar
    Join Date
    Sep 2008
    Posts
    118

    Default Re: Learning Entity Discovery.

    Should work, the vec(0,0,0) is the center of the map so the barrel would have to be close to the center of the map. Make sure you are up to date.

  8. #8
    Wirererer vortexnl's Avatar
    Join Date
    Sep 2007
    Posts
    114

    Default Re: Learning Entity Discovery.

    I removed my entire wire, and updated via SVN, I am not outdated.
    This is weird

  9. #9
    Wirererer Eirath245's Avatar
    Join Date
    Feb 2008
    Location
    England
    Posts
    208

    Default Re: Learning Entity Discovery.

    Vortex, I have to say, you're sig severely freaks me out :P

  10. #10
    Spucatum Tauri Bull's Avatar
    Join Date
    Jun 2008
    Location
    Finland
    Posts
    6,005

    Default Re: Learning Entity Discovery.

    Hehe, I blocked his sig already, together with tibbles

    On topic:
    From find.lua
    Code:
    82: local ent = exp2Discoveries[myId].entities[i - indexOffset]
    83: local entSteamId = nil
    84: if ent:IsPlayer() then entSteamId = ent:SteamID() end
    Is it possible something is messing up with the singleplayer steamID?
    My signature has a point.
    Quote Originally Posted by Squeakyneb View Post
    when l3ulletje says do it, do it.
    That

    Quote Originally Posted by Anticept View Post
    By the way, Bull is in charge.

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Entity Discovery Bugs
    By goluch in forum Expression 2 Discussion & Help
    Replies: 9
    Last Post: 04-19-2009, 02:06 PM
  2. Learning Lua
    By turck3 in forum Off-Topic
    Replies: 42
    Last Post: 04-13-2009, 08:11 AM
  3. Expression 2 - Entity Discovery
    By chiss in forum Expression 2 Discussion & Help
    Replies: 12
    Last Post: 03-17-2009, 01:02 PM
  4. E2 Entity Discovery, findResult , Loops?
    By Dave-X in forum Expression 2 Discussion & Help
    Replies: 4
    Last Post: 02-09-2009, 01:13 PM
  5. Learning CPU
    By Kupo in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 5
    Last Post: 09-28-2008, 11:17 AM

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
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots