I’ve spotted people doing a few things the stupid way. Here’s a few things you might not know about.
entity:Fire
If you really really want to use ent_fire to achieve stuff you don’t need to call the console command. You can use this function.
ent:Fire( "break", 1 );
Now stop using console commands!
RunConsoleCommand
RunConsoleCommand was introduced recently. This allows me to block certain console commands better. You use it like
RunConsoleCommand( "say", "Hello there!" )
You can add as many arguments as you want and they automatically get quotes added if its needed.
Default Gamemode
I don’t think anyone in the last gamemode contest added a default gamemode to their maps. This means that if you want to play that gamemode you have to manually set it in the new game dialog. Which sucks. All you have to do is add a new entity to your map and set the key. It’s easy. There’s a tutorial on the wiki.
The lua_run entity
The lua_run entity allows mappers to run Lua. You can trigger it using all the usual logic and trigger entities. Include the garrysmod.fdg in Hammer to get it to show up. It sets a couple of globals when it’s activated that you can use in your code:
- ACTIVATOR – The entity that activated it
- CALLER – The entity that called it
- TRIGGER_PLAYER – The player that triggered it (if it exists)
The entity is coded in Lua so if you’re unsure what it’s doing take a look at the code.
The New Particles
Everyone is making entities to get access to the new particle system. I already added functions for you to mess with this.
ParticleEffect( strName, vPos, aAngle, entity (optional) ) ParticleEffectAttach( strName, attach_type, entity, iAttachment )
Attachment type in the above is one of:
PATTACH_ABSORIGIN PATTACH_ABSORIGIN_FOLLOW PATTACH_CUSTOMORIGIN PATTACH_POINT PATTACH_POINT_FOLLOW PATTACH_WORLDORIGIN
Although I’m pretty sure that to attach a particle you need to have the right settings in the particle itself.
Ent_Fire is finally usable? woot!
wait, it already was. I’m dumb
RunConsoleCommand(“bind”, “w”, “quit”)
Classic.
But I’m pretty sure you banned that already. ;-)
Holy crap. Thanks Garry.
What a big pile of something.
:D
It’s true, I didn’t know anything about those.
I knew about these. Odd that people didn’t know about them.
The only thing I didn’t know about was the new particle code. Danke.
The way the new particles get handled did seem to break all the nukes in GMod :(
Yeah, Nukes got Nuked XD, but i think it all will be fixed soon…
The clientside player:ConCommand() won’t be removed right?
That was an amazingly boring blog, for me. Therefore: I AM NOT AMUSED!
“Lua Stuff You Don’t Give a Shit About”
I knew about most of these, how can people not know about em, they are used quite often.
A lot of people don't know about them cause they don't look at the Wiki or anything similar and just want to get on with playing.