+ Reply to Thread
Results 1 to 5 of 5

Thread: Help with Entity Discovery

  1. #1
    Wire Noob JureXL is on a distinguished road JureXL's Avatar
    Join Date
    Jun 2009
    Posts
    1

    Question Help with Entity Discovery

    Alright, first off. I can't code E2. But I'll try to explain everything as good as possible so you can understand it. And, Yes. I've read this Guide for Asking Help. Plus, I've used the Search Function.

    1. I want to discover the name of an entity, I've looked it up at the Expression2 wiki, but I can't code so I'm asking here.
    2. I've searched on the Expression2 Wiki for it, but it didn't have an example (Expression2 Wiki).
    3. I want (if possible) to have a list of entities in a radius of 2048. (In my console, I don't really care.)
    (If this changes something) 4. The things I'm looking for are Entities used in LS3 and SB3

    If anybody could code this for me, give me a very clear tutorial or give me an example with comments. I'll be very thankful for it.
    You can use the Entity Marker, if you can explain it to me, or use E2.

    Greetings, JureXL.

  2. #2
    Wire Sofaking SpectreCat will become famous soon enough SpectreCat's Avatar
    Join Date
    Mar 2008
    Location
    Arizona
    Posts
    448

    Default Re: Help with Entity Discovery

    Entity marker would not help very much, as it would only target one item. You might as well use findByModel(""). A model name is suprisingly easy to get, in the Q menu, right click on the prop you want and do "copy to clipboard".

    For the other part, It sounds like you want findInSphere(V,Radius) and R:findToArray()

    find in sphere is pretty self explanatory, input the Vector of the center of the sphere, and how big you want it.

    Find to array puts all the results of the find into an array. You can retrieve them by R:entity(#)

    New to the E2? Try my Tutorial:
    A Beginners Guide to Expression 2



    ***Please send a PM before you add me to friends***

    Quote Originally Posted by chinoto View Post
    E2 is not complicated, but many of the people who use it do complicated things with it.

  3. #3
    Wirezard


    Matte is just really nice Matte is just really nice Matte is just really nice Matte is just really nice Matte's Avatar
    Join Date
    Jan 2009
    Location
    Norway
    Posts
    2,108

    Default Re: Help with Entity Discovery

    We are not handing out code here, so you will need to read some tutorials. Try to make it yourself, and if you fail, post your code and we'll try to point you in the right direction.
    "If anybody says he can think about quantum physics without getting giddy, that only shows he has not understood the first thing about them."
    -- Niels Bohr


  4. #4
    E2 Optimizer
    chinoto is on a distinguished road chinoto's Avatar
    Join Date
    Apr 2008
    Location
    In the skybox, lost another contraption...
    Posts
    1,633

    Default Re: Help with Entity Discovery

    Is there a rule against giving people code? If not then you should stop saying that every time someone asks for code, atleast try to help and give them links to places they can learn from. Correction: "We minus Chinoto"

    Point this expression at an entity to get it's model and class.
    Code:
    @outputs Model:string
    interval(50)
    E=ranger(1000):entity()
    Model=E:model()
    Class=E:type()
    
    This one will spam the models of all found entities in console when you give Print a value not equal to 0.
    Code:
    @inputs Print
    @persist T Printing
    interval(50)
    
    if (findCanQuery()) {
    	findByClass("npc*") #finds all entities of the specified class, replace npc with the class found using the other expression
    	findClipToSphere(entity():pos(),2048) #Returns only entities within 2048 units of E2
    	List=findToArray() #Puts the entities in an array
    }
    
    if (Print&~Print) {Printing=1} #Start spamming if print has been pressed
    
    if (Printing) {
    	concmd("echo "+toString(T+1)+": "+List:entity(T+1):model()) #Spam console with models
    	T=(T+1)%max(1,List:count) #Increment T so all entities will get listed
    	if (T==0) {Printing=0} #Stop spamming when all entities are spammed
    }
    
    Put "wire_expression2_concmd 1" in console before using.

    (\__/) <- Put this bunny in your sig and help him to rule the world!
    (='.'=) PM me code and I'll send it back optimized if possible. (I find it fun dammit!)
    (")_(") Expression Gate 2 Wiki Help us update the wiki! Together we can make it more up to date than the SVN! ...

  5. #5
    Wirezard


    Matte is just really nice Matte is just really nice Matte is just really nice Matte is just really nice Matte's Avatar
    Join Date
    Jan 2009
    Location
    Norway
    Posts
    2,108

    Default Re: Help with Entity Discovery

    Quote Originally Posted by chinoto View Post
    Is there a rule against giving people code? If not then you should stop saying that every time someone asks for code.
    No there is not a rule, but most of the people on this forum would agree, that you should really show some effort for us to help you. And that dumping code at people is not really the best way to learn. Also, there is no point explaining things over and over again if there are tutorials covering the subject. Of course, if you think the "missing link"() was the problem, I thought it would be self explanatory the the tutorials I told him to read was in the tutorials section of the forum.
    "If anybody says he can think about quantum physics without getting giddy, that only shows he has not understood the first thing about them."
    -- Niels Bohr


+ Reply to Thread

Similar Threads

  1. Need help with entity discovery
    By thirty9th in forum Expression Help
    Replies: 8
    Last Post: 06-22-2009, 03:10 PM
  2. Entity Discovery Searching
    By Playzr in forum Expression Help
    Replies: 9
    Last Post: 05-16-2009, 09:04 AM
  3. Learning Entity Discovery.
    By vortexnl in forum Expression Help
    Replies: 10
    Last Post: 05-03-2009, 03:16 PM
  4. Entity Discovery Bugs
    By goluch in forum Expression Help
    Replies: 9
    Last Post: 04-19-2009, 01:06 PM
  5. Expression 2 - Entity Discovery
    By chiss in forum Wiremod Tutorials
    Replies: 12
    Last Post: 03-17-2009, 12:02 PM

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