Welcome to the new Diaspora forums, please let us know if you see anything broken! Notice: Some users may need to reupload their avatars due to an issue during forum setup!

E2 chat target finder

SweetOneSweetOne Posts: 39Registered
edited January 2014 in Showcase #1
Hi! I bring you a target finder. This is how it works: when you write to chat like this "target targetnamehere"
@name Simple_Target_Finder
outputs Target:entity
persist Target:entity

#First we make it so this expression2 runs on chat.
runOnChat(1)

#We don't want anyone else to mess with our targeting system so we set it owner only. This line also pick up owners words
from chat 
LS = owner():lastSaid():lower():explode(" ")
#When someone writes on chat and its owner something happens, in this case owner has to say "target"
if (chatClk() & LS[1,string]=="target" ) { 
interval(100)
#We don't to spam chat so we hide our words
hideChat(1)
#Second required word is part of target's name
Target=findPlayerByName(LS[2,string])
#If target is found we continue
if(Target:isValid())
#Then we print the target.
{print(Target:toString())}}
Post edited by Unknown User on

Comments

  • LtBrandonLtBrandon Posts: 506Registered, Administrator
    SweetOne wrote:
    Hi! I bring you a target finder. This is how it works: when you write to chat like this "target targetnamehere"
    @name Simple_Target_Finder
    outputs Target:entity
    persist Target:entity
    
    runOnChat(1)
    
    LS = owner():lastSaid():lower():explode(" ")
    if (chatClk() & LS[1,string]=="target" ) { 
    interval(100)
    hideChat(1)
    Target=findPlayerByName(LS[2,string])
    if(Target:isValid())
    {print(Target:toString())}}
    
    ..This one isn't even a tutorial sweet, its an e2 you're giving away, therefore this time I'm moving it where you had the other one and changing the name until you make it into a tutorial and tell me to move it back.
    This is a block of text that can be added to posts you make. There is a 255 character limit.

    Lλmbdλ: donations for coding the space future of diaspora :>

    Get your extra long EVE trial here!
  • SweetOneSweetOne Posts: 39Registered
    LtBrandon wrote:
    SweetOne wrote:
    Hi! I bring you a target finder. This is how it works: when you write to chat like this "target targetnamehere"
    @name Simple_Target_Finder
    outputs Target:entity
    persist Target:entity
    
    runOnChat(1)
    
    LS = owner():lastSaid():lower():explode(" ")
    if (chatClk() & LS[1,string]=="target" ) { 
    interval(100)
    hideChat(1)
    Target=findPlayerByName(LS[2,string])
    if(Target:isValid())
    {print(Target:toString())}}
    
    ..This one isn't even a tutorial sweet, its an e2 you're giving away, therefore this time I'm moving it where you had the other one and changing the name until you make it into a tutorial and tell me to move it back.

    It is now :3
  • NachotpNachotp Posts: 7Registered
    you should target "ship_core_test" rather than people, Razor remote controls his ship :C
  • SweetOneSweetOne Posts: 39Registered
    Nachotp wrote:
    you should target "ship_core_test" rather than people, Razor remote controls his ship :C

    True but since last update ship_core works only on #1 server.
  • LtBrandonLtBrandon Posts: 506Registered, Administrator
    SweetOne wrote:
    Nachotp wrote:
    you should target "ship_core_test" rather than people, Razor remote controls his ship :C

    True but since last update ship_core works only on #1 server.
    To make it so this is slightly easier to understand(it could be misunderstood that you can no longer target cores), I believe sweet is referring to my change to the entity name of the ship cores. It is now just "ship_core" instead of "ship_core_test", which would be caught with a wildcard anyways so just using "ship_core*" should work on both servers(or it did when I last checked, which was quite some time ago).

    On a side note: I'm waiting on dataschmuck to respond to my messages so I can update server 2.
    This is a block of text that can be added to posts you make. There is a 255 character limit.

    Lλmbdλ: donations for coding the space future of diaspora :>

    Get your extra long EVE trial here!
  • DataSchmuckDataSchmuck Posts: 147Registered, Moderator
    Sorry, I dont check my steam account very often. Use e-mail to contact me. I just logged into steam and replyed with the info, though, feel free to make any changes you wish to the server. Keep in mind it currently gets the addons to the clients via the workshop, not fastDL.

    The file that controls that is in addons\collection addons\lua\autorun\server

    this downloads all the current models/materials/sounds to the client, much faster than fastDL, with no file limit, and no need for them to figure out SVNs or Gits.

    Only downside is if an addon adds new content (excluding lua) the workshop addon needs to be rebuilt.

Leave a Comment

bolditalicunderlinestrikecodeimageurlquotespoiler
Drop image/file