Welcome, Guest. Please login or register.

Author Topic: How To: NoBlock & Change Player Model Without Server plugins  (Read 10273 times)

Offline unt0uch4bl3

  • Full Member
  • ***
  • Posts: 357
    • View Profile
How To: NoBlock & Change Player Model Without Server plugins
« on: January 21, 2011, 01:37:26 AM »
How To: Make players non-solid & changing player models

These two things can be done effectively without any server plugins simply by changing key values of the 'player' entity. This method is no longer really that important since all the servers have admin plugins but it is still good to know and you can definitely use this to your advantage in your future map.

I decided to share this today after seeing some old topic in the questions forum although I've known how to do this for years.

Noblock:
The regular noblock plugins that are being used on servers edit the collision group of the player to make them not collide with each other. This is a good method but it is not possible without an external plugin because the 'm_CollisionGroup' property does not have a keyvalue associated with it. Instead to achieve a similar effect you can edit the solid type of an entity (m_nSolidType). The keyvalue for this property is simply "solid" and you may have seen this in the properties of some entities.

To do this in hammer you can simply create an output on a button/trigger/anything else you like that is triggered by a player or otherwise:
Code: [Select]
Output: OnStartTouch/OnPressed/etc
target: !activator
via this input: addoutput
parameter: solid 1

Alternatively the target can be simply 'player' which is the classname of the player entity. (Yes you can run outputs using classnames instead of targetnames)

Code: [Select]
Output: OnStartTouch/OnPressed/etc
target: player
via this input: addoutput
parameter: solid 1
Note: When using 'player', it will only apply to living players at that moment. If new players are spawned they will not have this property even if they were dead.

Parameter explanation:
  • In the parameter field you are setting the solid keyvalue to be 1. This value will make the player non solid to others. This means that everyone will be able to walk through that player but that player will not be able to walk through others unless their solid value is also 1.
  • Setting a value of 2 will return things to normal and make that player solid again.
  • Setting a value of 0 will make that player non solid to all triggers. This means trigger_teleport for example will not teleport the player.

IMPORTANT SIDE EFFECT: A player that has a solid value of 1 will not be able to be knifed (he can still be shot) (Knife immunity any one?). This is why this method is NOT used to replace noblock BUT it can be used if this effect is desired. This technique can also be used while beta testing a map on a server with no noblock and you either have friends join you or you add bots that you don't want to stick together.

This can be done using sv_cheats the following way:
Code: [Select]
ent_fire player addoutput "solid 1"!self - can also be used to apply it to your self or a different targetname if you are using those.

Changing Player Models:
This is a little trickier but uses the same concept an admin plugin would use (at least thats how eventscripts does it).
The basic idea is that models are applied to entities by a model index of currently cached models. The engine obviously doesn't cache all the models at all times, only the ones that are needed. When you have an admin plugin set a certain model, it would generally have the engine precache the model, get the model index and apply this index to the player.

This is how you would do it in hammer:
Code: [Select]
Output: OnStartTouch/OnPressed/etc
target: !activator
via this input: addoutput
parameter: modelindex 200

or with sv_cheats
Code: [Select]
ent_fire !self addoutput "modelindex 200"
Now since the models are precached you would need to load up css, go into third person and try all the indexes from about index 2 to whatever number you need to find it (it won't be more than 500 in most cases unless you have a lot of triggers in your map which count as models).

Now you probably are thinking that this can be used to make a CT look like a T and vice versa but that will actually not work out. Yes you can find the index and apply it but on different servers the values are slightly different and you cannot set a specific value in your map and hope it works on every server. However, models that are placed in your map (such as all the triggers) keep the same model index on every server (I'm not 100% sure but this has been true so far after trying on a variety of servers and Operating systems.)

So lets say you want a player to have a crow model. Place a crow on your map somewhere so the model is cached by the engine and has a model index. Load up the map after you have completed your map (so you know modelindexes will not change again) and find the index you want. Like I mentioned before I'm not 100% certain that the index will be the same on every server for models you add on your map but I'm 70% sure so you must do your own testing.

CAUTION: If you apply a bad model that doesn't support holding weapons and the player shooting them (such as a trigger_teleport or something else you made somewhere in your map) will cause clients' games to crash.


Thats all folks.
« Last Edit: January 25, 2011, 04:38:38 AM by unt0uch4bl3 »


Offline S.T.A.L.K.E.R.

  • The Sexiest Man "Alive"
  • SolidSurf Elite
  • Elder Statesman
    of the Surf
  • ******
  • Posts: 2,830
  • daddy is home :^)
    • View Profile
Re: How To: NoBlock & Change Player Model Without Server plugins
« Reply #1 on: January 21, 2011, 01:52:58 AM »
A thank you has been given for that post.

Offline Helix

  • Sr. Member
  • ****
  • Posts: 842
  • ASOT 600!!!
    • View Profile
Re: How To: NoBlock & Change Player Model Without Server plugins
« Reply #2 on: January 21, 2011, 10:03:17 AM »
A thank you has been given for that post.

Offline ChiChiN

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Re: How To: NoBlock & Change Player Model Without Server plugins
« Reply #3 on: January 22, 2011, 07:59:43 AM »
A thank you has been given for that post.

Offline arroba

  • Sr. Member
  • ****
  • Posts: 593
  • srs business
    • View Profile
Re: How To: NoBlock & Change Player Model Without Server plugins
« Reply #4 on: January 22, 2011, 04:12:18 PM »
Thanks, now I can make my xc map with 2 teams :3

Offline pand3mic

  • Modders
  • Full Member
  • *
  • Posts: 233
  • 0.0
    • View Profile
Re: How To: NoBlock & Change Player Model Without Server plugins
« Reply #5 on: January 23, 2011, 01:01:35 AM »
i needed this so fucking much i love you.

when you told me about this I thought it was just the model, but i think i needed the noblock even more thank you very much
I don't want a signature

Offline pand3mic

  • Modders
  • Full Member
  • *
  • Posts: 233
  • 0.0
    • View Profile
Re: How To: NoBlock & Change Player Model Without Server plugins
« Reply #6 on: January 23, 2011, 01:05:35 AM »
just tested in on a hl2dm map (dont ask why)

you cant get crowbarred, stunsticked, crossbowed, or shot with a combine ball.
I don't want a signature

Offline unt0uch4bl3

  • Full Member
  • ***
  • Posts: 357
    • View Profile
Re: How To: NoBlock & Change Player Model Without Server plugins
« Reply #7 on: January 23, 2011, 01:19:10 AM »
Here is an example of the model changing. The model is just a func_rotating brush. While this is probably not safe if the player gets a hold of weapons because it may or may not crash the clients, it still works.

Those razer signs are all players.
« Last Edit: January 23, 2011, 01:21:12 AM by unt0uch4bl3 »


Offline Knife

  • Jerker
  • Elder Statesman
    of the Surf
  • *****
  • Posts: 1,511
  • Stay Classy.
    • View Profile
Re: How To: NoBlock & Change Player Model Without Server plugins
« Reply #8 on: January 23, 2011, 04:55:08 AM »
Here is an example of the model changing. The model is just a func_rotating brush. While this is probably not safe if the player gets a hold of weapons because it may or may not crash the clients, it still works.

Those razer signs are all players.

I giggled.
Why so Ryan?

Offline Lody Blokady

  • Sr. Member
  • ****
  • Posts: 633
  • the saviour of surf
    • View Profile
Re: How To: NoBlock & Change Player Model Without Server plugins
« Reply #9 on: January 23, 2011, 11:58:15 AM »
I tested giving weapons on my vps,


CalcSequenceIndex: can't find 'idle_shoot_knife'.
CalcSequenceIndex: can't find 'walk_shoot_knife'.


no server crash/client crash

Offline RazerSurf

  • Elder Statesman
    of the Surf
  • *****
  • Posts: 1,776
  • mapper of surfs
    • View Profile
Re: How To: NoBlock & Change Player Model Without Server plugins
« Reply #10 on: January 24, 2011, 11:38:00 AM »
I approve.

Offline Skittl35

  • Full Member
  • ***
  • Posts: 325
    • View Profile
Re: How To: NoBlock & Change Player Model Without Server plugins
« Reply #11 on: January 26, 2011, 05:46:18 PM »
Hmm ... this may work out as an excellent use for the big empty room in waterworks. 

Finish map >> go to empty room >> select model.  I'd love to see a tree surfing.

Offline Knife

  • Jerker
  • Elder Statesman
    of the Surf
  • *****
  • Posts: 1,511
  • Stay Classy.
    • View Profile
Re: How To: NoBlock & Change Player Model Without Server plugins
« Reply #12 on: January 26, 2011, 06:10:44 PM »
Hmm ... this may work out as an excellent use for the big empty room in waterworks. 

Finish map >> go to empty room >> select model.  I'd love to see a tree surfing.
Lol I'm trying to do the same thing for a Hide-n-seek game on my minigame map
Why so Ryan?

Offline FAJ

  • Flying Badger Man
  • Admin
  • Elder Statesman
    of the Surf
  • *****
  • Posts: 1,925
  • GAJ
    • View Profile
    • NY-Surf
Re: How To: NoBlock & Change Player Model Without Server plugins
« Reply #13 on: January 26, 2011, 06:28:18 PM »
That should be the the end game in commune. You choose your disguise, and hide in the knife arena with a gun.

Does the chosen player model show up holding a weapon?

Do you have to do anything to set their model back to normal at the beginning of next round?

Offline S.T.A.L.K.E.R.

  • The Sexiest Man "Alive"
  • SolidSurf Elite
  • Elder Statesman
    of the Surf
  • ******
  • Posts: 2,830
  • daddy is home :^)
    • View Profile
Re: How To: NoBlock & Change Player Model Without Server plugins
« Reply #14 on: January 26, 2011, 06:35:06 PM »
That should be the the end game in commune. You choose your disguise, and hide in the knife arena with a gun.

Does the chosen player model show up holding a weapon?

Do you have to do anything to set their model back to normal at the beginning of next round?

You can set the gun model to have some sort of RenderFX, like possible fade by distance, so by the time you see their gun it'll be to late to react anyway, testing it now.  Also I hope that the model numbers don't change from server to server :\

Offline unt0uch4bl3

  • Full Member
  • ***
  • Posts: 357
    • View Profile
Re: How To: NoBlock & Change Player Model Without Server plugins
« Reply #15 on: January 26, 2011, 07:57:11 PM »
You can set the gun model to have some sort of RenderFX, like possible fade by distance, so by the time you see their gun it'll be to late to react anyway, testing it now.  Also I hope that the model numbers don't change from server to server :\

The gun can always just be set invisible with onpickup if renderfx isnt suitable and the models reset every round you just cant reset them to original model the same round for reasons stated in first post. Ill try once again lthe model indexes on 4 servers i have access to later tonight.

Offline unt0uch4bl3

  • Full Member
  • ***
  • Posts: 357
    • View Profile
Re: How To: NoBlock & Change Player Model Without Server plugins
« Reply #16 on: January 27, 2011, 04:04:04 AM »
Well I tried with NY momentum's thing here (http://img339.imageshack.us/img339/7217/22445655.png). The model index is 34 and you can try it your self. It kept the same index on each server except when the player held a weapon there was consistent spam (A LOT OF IT) in console because there is no specific attachment for the weapon.

Offline Panzerhandschuh

  • Server Op
  • Sr. Member
  • *****
  • Posts: 407
    • View Profile
Re: How To: NoBlock & Change Player Model Without Server plugins
« Reply #17 on: January 27, 2011, 04:48:40 AM »
I remember fucking around with model index in L4D a while ago and replacing all of the zombies with tanks and changing smokers into boomers. Shit was hilarious.

Offline Paul

  • Sr. Member
  • ****
  • Posts: 537
  • Blinky! :D
    • View Profile
Re: How To: NoBlock & Change Player Model Without Server plugins
« Reply #18 on: January 31, 2011, 10:04:25 PM »
Is there a way to get the model index so you know what you're changing into?

Offline unt0uch4bl3

  • Full Member
  • ***
  • Posts: 357
    • View Profile
Re: How To: NoBlock & Change Player Model Without Server plugins
« Reply #19 on: January 31, 2011, 10:11:00 PM »
The way you get it is by trying the model indexes on your local server. I don't know of a way of finding out what model a model index points to otherwise, even with a server plugin.