• Vector Positions of Props?
    9 replies, posted
I've been trying to create a basic script that spawns a pre-built shack/house thing composed of frozen props. I've got it down basically, but I'm wondering if there is an easier way to find out the perfect vector positions and angles? The way I'm doing it right now, is basically guessing. Here's a basic code snipit. [CODE] Model = "models/props_wasteland/wood_fence02a.mdl", Size = Vector(1,1,1), Pos = Vector(34,-180,40), Ang = Angle(0,180,0),[/CODE]
Well you could spawn the model ingame, then use code like this: [code] local p=player.GetAll()[1] // this is you, assuming you're the only person in server or in singleplayer local e=p:GetEyeTraceNoCursor().Entity // entity you're looking at print(e:GetPos()) // world pos of entity print(e:GetAngles()) // world angles of entity [/code]
Have there been any addons or tools already created for this type of thing?
This might be what you are looking for: [url]http://www.garrysmod.org/downloads/?a=view&id=102387[/url]
You could shove what I put above into lua/posfinder.lua and then ingame just use the command lua_openscript posfinder.lua whenever you want to use it, and it should do it for you. [editline]12th January 2014[/editline] Assuming you mean the position finding - not the spawning pre-built house thing
[QUOTE=MattJeanes;43514569]You could shove what I put above into lua/posfinder.lua and then ingame just use the command lua_openscript posfinder.lua and it should do it for you. [editline]12th January 2014[/editline] Assuming you mean the position finding - not the spawning pre-built house thing[/QUOTE] Hmm, so assuming that. I'd just be able to build what I want, use that for each prop. And plop that into my script, to be spawned like that each time?
[QUOTE=sarge997;43514611]Hmm, so assuming that. I'd just be able to build what I want, use that for each prop. And plop that into my script, to be spawned like that each time?[/QUOTE] What gamemode are you running? If it is just sandbox or DarkRP than this would save alot of time and coding efforts. [url]http://www.garrysmod.org/downloads/?a=view&id=102387[/url]
Its a custom gamemode, and I'm not trying to have the props spawn on a map load, but rather like an item. [editline]12th January 2014[/editline] I should mention again, I'm not trying to find WORLD positions, but rather model angles and positions, forgive me for explaining like shit. But not really sure how else to explain it.
Okay, but if you're looking for local positions - they need to be local to something.
The duplication library exists for this exact purpose. You don't need the duplicator tool in order to use it.
Sorry, you need to Log In to post a reply to this thread.