Raised This Month: $ Target: $400
 0% 

How to set an Entity Flag using CreateEntityByName?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 11-20-2009 , 11:45   How to set an Entity Flag using CreateEntityByName?
Reply With Quote #1

Hello there,


im spawning a Point_Spotlight with Sourcemod and attaching it to an entity. I have no idea however how i could set the flags it has:



Flags

1 : Start On Sets the point_spotlight to be turned on when it spawns.

2 : No Dynamic Light Prevents a dynamic light from being generated by the point_spotlight. Dynamic lights can be costly for performance, so this flag should be checked to improve framerate.



Is there a command to do so, before DispatchSpawn or after?
AtomicStryker is offline
Frus
Senior Member
Join Date: Aug 2009
Old 11-20-2009 , 12:21   Re: How to set an Entity Flag using CreateEntityByName?
Reply With Quote #2

You should be able to change the m_fFlags netprop.

EDIT: Actually, I wouldn't know if fFlags would have those specific ones, but you should be able to find the netprop or datamap and change it.

Last edited by Frus; 11-20-2009 at 12:24.
Frus is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 11-20-2009 , 15:13   Re: How to set an Entity Flag using CreateEntityByName?
Reply With Quote #3

The spawnflags datamap property is actually m_spawnflags.

I also looked up the spawnflags values for point_spotlight for you:

Code:
// Spawnflags
#define SF_SPOTLIGHT_START_LIGHT_ON            0x1
#define SF_SPOTLIGHT_NO_DYNAMIC_LIGHT        0x2
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 11-20-2009 , 16:18   Re: How to set an Entity Flag using CreateEntityByName?
Reply With Quote #4

Thank you, ill see if a not-yet-spawned Entity can have its m_spawnflags altered
AtomicStryker is offline
Theme97
Senior Member
Join Date: Mar 2009
Old 11-21-2009 , 04:46   Re: How to set an Entity Flag using CreateEntityByName?
Reply With Quote #5

If I remember correctly,

DispatchKeyValue(ent, "spawnflags", "3");
__________________
I now have very little time to work on stuff and my main computer (which is the only one that can run TF2) is not cooperating with me, so don't expect many updates from me anytime soon.

[ALL] Karaoke
[TF2] Intel Timer | Crabmod | Randomizer | Stopwatch | Crits 4 All
Theme97 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 12:37.


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