Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Lua to spawn entities #63

Closed
squeek502 opened this issue Nov 11, 2014 · 1 comment
Closed

Allow Lua to spawn entities #63

squeek502 opened this issue Nov 11, 2014 · 1 comment
Assignees

Comments

@squeek502
Copy link
Member

Can be done in Hammer using https://developer.valvesoftware.com/wiki/Env_entity_maker, but it'd be nice to be able to do it map-agnostically.

7:48 PM - squeek.: what were you intending to spawn?
7:49 PM - ルーキー: i havent really thought of it yet
7:49 PM - ルーキー: but it would be really useful
7:49 PM - ルーキー: lol
7:49 PM - ルーキー: being able to spawn flags at some points or anything else really
7:50 PM - ルーキー: just spawn new things when someone dies
7:50 PM - squeek.: you can use env_entity_maker to do that
7:50 PM - squeek.: and OutputEvent
7:50 PM - squeek.: to trigger it through lua
7:50 PM - ルーキー: what if it isnt in a map but
7:50 PM - ルーキー: ive been more modding other maps
7:50 PM - squeek.: right
7:50 PM - ルーキー: to use with ff as a whole

@R00Ki3
Copy link
Member

R00Ki3 commented Jan 13, 2015

Looking up how to use the entity_maker it seems that the point_template actually copies an entity to be spawned. So here's some more information on it. https://developer.valvesoftware.com/wiki/Point_template

squeek502 added a commit that referenced this issue Jun 18, 2016
 - Not very well tested, but is able to spawn info_ff_scripts like flags and have them work like normal
 - Added baseentity:SetName(string name)
 - Added global function SpawnEntity(string entity_class_name, string entity_name) that returns the entity spawned or nil if unsuccessful (example: `local entity = SpawnEntity("info_ff_script", "red_flag")`)
 - Added global function SpawnEntity(string entity_class_name) that returns the entity spawned or nil if unsuccessful (example: `local entity = SpawnEntity("info_ff_script")`)
 - Closes #63
@squeek502 squeek502 self-assigned this Jun 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants