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....
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....
[IMG]http://img39.imageshack.us/img39/5140/imtehpro.jpg[/IMG][URL="http://img291.imageshack.us/img291/3626/p10102811fc5.gif"]
[/URL]
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.Code:interval(500) findInSphere(Vectorofbarrel) Target = find()
[url=http://www.game-monitor.com/garrysmod2_GameServer/69.162.79.109:27015/Archils_247_build_server._PhxSVNWiremodSVNLagfree.html][img]http://module.game-monitor.com/69.162.79.109:27015/image/default/p:99FFD6/ps:110300/t:FF2011/h:220400/l:FFF1BB/crysis-05.png[/img][/url]
so Target = Find() means that the variable Target is the output of the findInSphere?
[IMG]http://img39.imageshack.us/img39/5140/imtehpro.jpg[/IMG][URL="http://img291.imageshack.us/img291/3626/p10102811fc5.gif"]
[/URL]
God freaking damnit, I get the same fcking error!..
This is my code:Code:Expression 2: entities\gmod_wire_expression2\core\find.lua:84: attempt to index local 'ent' (a nil value)
Code:@name Barrel lolz @inputs @outputs Name:string @persist Barrel:entity interval(100) findInSphere(vec(0,0,0),1000) Barrel=find()
[IMG]http://img39.imageshack.us/img39/5140/imtehpro.jpg[/IMG][URL="http://img291.imageshack.us/img291/3626/p10102811fc5.gif"]
[/URL]
Update your wire.
If you get Lua errors -> YOU IS OUTDATED
No
He's not outdated.
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.
[url=http://www.game-monitor.com/garrysmod2_GameServer/69.162.79.109:27015/Archils_247_build_server._PhxSVNWiremodSVNLagfree.html][img]http://module.game-monitor.com/69.162.79.109:27015/image/default/p:99FFD6/ps:110300/t:FF2011/h:220400/l:FFF1BB/crysis-05.png[/img][/url]
I removed my entire wire, and updated via SVN, I am not outdated.
This is weird
[IMG]http://img39.imageshack.us/img39/5140/imtehpro.jpg[/IMG][URL="http://img291.imageshack.us/img291/3626/p10102811fc5.gif"]
[/URL]
Vortex, I have to say, you're sig severely freaks me out :P
[URL="http://www.sloganizer.net/en/"][IMG]http://www.sloganizer.net/en/image,Wire,lblue,blue.png[/IMG][/URL]
Hehe, I blocked his sig already, together with tibbles
On topic:
From find.lua
Is it possible something is messing up with the singleplayer steamID?Code:82: local ent = exp2Discoveries[myId].entities[i - indexOffset] 83: local entSteamId = nil 84: if ent:IsPlayer() then entSteamId = ent:SteamID() end
Bookmarks