Raised This Month: $ Target: $400
 0% 

Create Prop at Coordinates


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Luke Penny
Senior Member
Join Date: Jan 2010
Location: Canada
Old 01-23-2010 , 23:16   Create Prop at Coordinates
Reply With Quote #1

I am trying to create something that will create a specific prop at specific coordinates for each map. How would I create something that finds what map is currently playing, and places the props according to that, at specific coordinates? I plan to have different props and different locations per map, and if possible have the props rotated. (Dynamic props) How would I go about doing this?

Any ideas? Show examples if you happen to have any.

Last edited by Luke Penny; 01-23-2010 at 23:19.
Luke Penny is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 01-24-2010 , 02:51   Re: Create Prop at Coordinates
Reply With Quote #2

I know you love links

GetCurrentMap

As for putting a certain prop on certain maps, you have several options, but I think I'd recommend the following:

You can use keyvalues

So if you create for example

mapprops.txt

Code:
"mapprops"
{
    "de_dust"
    {
         "prop_model"    "models/props/whatever.mdl"
         "coordinate"     "x y z"
    }
    "cs_office"
    {
        ...
    }
}

Once you learn how to use keyvalues it should be pretty straight forward.

One thing i'm not sure about is KvGetVector. I guess it just takes the 3 numbers (separated by a space?) and then puts it into a 3-element Float array for you.


Rotation can be set through SetEntPropVector

Ex:
Code:
SetEntPropVector(entity, Prop_Data or Prop_Send?, "m_angRotation", vec);
I've never been able to identify whether a property is Prop_Data or Prop_Send so someone will have to identify that, or you can test both of them.

"m_angAbsRotation" also exists, I don't know what the difference is though.
__________________
Greyscale is offline
Luke Penny
Senior Member
Join Date: Jan 2010
Location: Canada
Old 01-24-2010 , 03:34   Re: Create Prop at Coordinates
Reply With Quote #3

I love links, accompanied by some text and thought (and step by step instructions, hah) Thanks a bundle.

Last edited by Luke Penny; 01-24-2010 at 04:06.
Luke Penny is offline
Luke Penny
Senior Member
Join Date: Jan 2010
Location: Canada
Old 01-29-2010 , 16:36   Re: Create Prop at Coordinates
Reply With Quote #4

Thread got a bit old, still having some troubles. How exactly do I create the prop, and set the coordinates for the prop to be created at?
Luke Penny is offline
=MaTi=
Member
Join Date: Jan 2008
Old 01-29-2010 , 18:32   Re: Create Prop at Coordinates
Reply With Quote #5

I had similar problem some time ago, check out this link:
http://forums.alliedmods.net/showthread.php?t=102638
=MaTi= is offline
Luke Penny
Senior Member
Join Date: Jan 2010
Location: Canada
Old 01-29-2010 , 22:15   Re: Create Prop at Coordinates
Reply With Quote #6

Alright, I am still lost on how to do this. If anyone has any examples of this being done before could you present them to me? It's somewhat urgent I get this thing working, hah.

I need to know how to spawn the prop at a certain position and certain rotation. Is it possible to do something like prop_dynamic_create models/props/something.mdl at certain coordinates? If I could do that then there would be no need for a plugin, but to my knowledge there is no way for that to be done without one.

Last edited by Luke Penny; 01-29-2010 at 22:17.
Luke Penny is offline
meng
Veteran Member
Join Date: Oct 2005
Location: us
Old 01-29-2010 , 23:17   Re: Create Prop at Coordinates
Reply With Quote #7

Maybe try this. You could test by making a cmd to run it and start spawning some props while in spectator.
PHP Code:
decl Float:posVec[3], Float:angVec[3];
GetClientEyePosition(clientposVec);
GetClientEyeAngles(clientangVec);
angVec[0] = 0.0;
angVec[2] = 0.0;
new 
prop CreateEntityByName("prop_dynamic");
SetEntityModel(propYOUR_MDL);
DispatchSpawn(prop);
TeleportEntity(propposVecangVecNULL_VECTOR); 
__________________
.
[ 1 Dumerils Boa | 1 Cali King ]...
.
I'm a lil' spirituous.
meng is offline
Send a message via Yahoo to meng
triggerman
Senior Member
Join Date: Jun 2009
Old 01-30-2010 , 18:44   Re: Create Prop at Coordinates
Reply With Quote #8

why dont you use stripper?
http://forums.alliedmods.net/showthread.php?t=39439
__________________
triggerman is offline
Luke Penny
Senior Member
Join Date: Jan 2010
Location: Canada
Old 01-30-2010 , 22:42   Re: Create Prop at Coordinates
Reply With Quote #9

I didn't realize stripper could add props, but apparently it can, I will look into it! Thanks.

Edit: Had to get some help from a mapping friend on prop_dynamic properties, but I got it working - thanks for the help.

Last edited by Luke Penny; 01-30-2010 at 23:21.
Luke Penny is offline
Luke Penny
Senior Member
Join Date: Jan 2010
Location: Canada
Old 01-31-2010 , 02:36   Re: Create Prop at Coordinates
Reply With Quote #10

Alright, if I am using stripper for doing this task, how could I have a single prop, a group of props, or all of the props I am spawning using stripper (any of those options, preferably the second one) have a percentage chance of being spawned or not being spawned?
Luke Penny is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:47.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode