06-19-2010, 12:30 PM | #1 |
WhenNailGrenWillOut?
Beta Tester
Join Date: May 2009
Gametype: mp_prematch Affiliations: [:)] - Frag Happy, babe| Posts Rated Helpful 29 Times
|
Making players not suicide when changing class?
I would like to have a trigger area where players would not die when changing class. I'd like them to just spawn as the class they've chosen since it's kind of gay dying in spawn just because you want to change your class.
__________________
[[ ff_hotfudge - bhop_theonlyone ]] "As the the new year approaches I await for it like an case of explosive fecalomania otherwise know as diareha or the massive shits. I am gripping the sides of the toilet as my stomach produces the first hollow thud out of the anus of the year to come." DarkeN_HellspawN |
|
06-19-2010, 04:31 PM | #2 | |
Heartless Threadkiller
Beta Tester
Forum Moderator Join Date: Apr 2007
Class/Position: D-Solly / O-Medic Gametype: CTF Affiliations: [AE] AssEaters Posts Rated Helpful 42 Times
|
You could just turn off "Immediate Class Change" in your settings...
__________________
Quote:
Friend me on Facebook Follow me on Twitter |
|
|
06-19-2010, 05:28 PM | #3 | |
WhenNailGrenWillOut?
Beta Tester
Join Date: May 2009
Gametype: mp_prematch Affiliations: [:)] - Frag Happy, babe| Posts Rated Helpful 29 Times
|
Quote:
What I want to do is not have a death penalty for changing class in your spawnroom.
__________________
[[ ff_hotfudge - bhop_theonlyone ]] "As the the new year approaches I await for it like an case of explosive fecalomania otherwise know as diareha or the massive shits. I am gripping the sides of the toilet as my stomach produces the first hollow thud out of the anus of the year to come." DarkeN_HellspawN Last edited by moosh; 06-19-2010 at 05:29 PM. |
|
|
06-19-2010, 08:27 PM | #4 |
Banned
Join Date: Sep 2008
Class/Position: Soldier Gametype: AVD Affiliations: TALOS Posts Rated Helpful 5 Times
|
It can't be done manually with Lua (there's no switchclass() callback) until the development team hardcodes no suicides and instant class switching in spawns. However, ApplyToPlayer() can change people's team and class without a respawn or a suicide. You can make some brushes that change people to specific classes when they touch them. Unfortunately, that means taking up a lot of room in or around your spawn. I tested some of the following code (which probably sucks dick) and it works out if the class you're trying to switch to is enabled for your team with SetClassLimit().
Code:
baseClassChanger = trigger_ff_script:new({switchClass='class_name_here'}) scoutClassChanger = baseClassChanger:new({switchClass='Scout'}) sniperClassChanger = baseClassChanger:new({switchClass='Sniper'}) soldierClassChanger = baseClassChanger:new({switchClass='Soldier'}) demomanClassChanger = baseClassChanger:new({switchClass='Demoman'}) medicClassChanger = baseClassChanger:new({switchClass='Medic'}) hwguyClassChanger = baseClassChanger:new({switchClass='HWGuy'}) pyroClassChanger = baseClassChanger:new({switchClass='Pyro'}) spyClassChanger = baseClassChanger:new({switchClass='Spy'}) engineerClassChanger = baseClassChanger:new({switchClass='Engineer'}) civilianClassChanger = baseClassChanger:new({switchClass='Civilian'}) function baseClassChanger:ontouch(touch_entity) if IsPlayer(touch_entity) then local player = CastToPlayer(touch_entity) if self.switchClass == 'Scout' then ApplyToPlayer(player,{AT.kChangeClassScout}) elseif self.switchClass == 'Sniper' then ApplyToPlayer(player,{AT.kChangeClassSniper}) elseif self.switchClass == 'Soldier' then ApplyToPlayer(player,{AT.kChangeClassSoldier}) elseif self.switchClass == 'Demoman' then ApplyToPlayer(player,{AT.kChangeClassDemoman}) elseif self.switchClass == 'Medic' then ApplyToPlayer(player,{AT.kChangeClassMedic}) elseif self.switchClass == 'HWGuy' then ApplyToPlayer(player,{AT.kChangeClassHWGuy}) elseif self.switchClass == 'Pyro' then ApplyToPlayer(player,{AT.kChangeClassPyro}) elseif self.switchClass == 'Spy' then ApplyToPlayer(player,{AT.kChangeClassSpy}) elseif self.switchClass == 'Engineer' then ApplyToPlayer(player,{AT.kChangeClassEngineer}) elseif self.switchClass == 'Civilian' then ApplyToPlayer(player,{AT.kChangeClassCivilian}) else ApplyToPlayer(player,{AT.kChangeClassRandom}) end end end Last edited by Bridget; 06-19-2010 at 08:39 PM. |
|
06-19-2010, 08:29 PM | #5 | |
WhenNailGrenWillOut?
Beta Tester
Join Date: May 2009
Gametype: mp_prematch Affiliations: [:)] - Frag Happy, babe| Posts Rated Helpful 29 Times
|
Quote:
__________________
[[ ff_hotfudge - bhop_theonlyone ]] "As the the new year approaches I await for it like an case of explosive fecalomania otherwise know as diareha or the massive shits. I am gripping the sides of the toilet as my stomach produces the first hollow thud out of the anus of the year to come." DarkeN_HellspawN |
|
|
06-19-2010, 08:40 PM | #6 |
Banned
Join Date: Sep 2008
Class/Position: Soldier Gametype: AVD Affiliations: TALOS Posts Rated Helpful 5 Times
|
Since edits don't update the thread, look above for (bad) workaround.
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|