Forcing Round_end correctly

Please post any questions about developing your plugin here. Please use the search function before posting!
RoOF
Junior Member
Posts: 5
Joined: Fri Jul 13, 2012 9:58 pm

Forcing Round_end correctly

Postby RoOF » Sun May 03, 2015 8:44 pm

Yo Guys,

I have a Problem with Forcing Round_End Event correctly.

I currently make a Zombiemod for Source Python.



The ground structure is already done :) . But i have now Problems with the Ending of the Rounds.



What is a Zombiemod:

1 Player gets selceted at round_start as Zombie. -> He gets forced to [color="#FF0000"]Terrorist Team[/color].

This Player have to kill all CT Players. ( All hidden CT players by knife gets automatically swichted to Terrorist Team)

Or the other way. All Zombies (T) get killed from the CT's so the Round ends normally.


At the End all CT's are in Terrorist Team. So there we go.


There is the Problem which i can't solve myself.



When all CT's in T Team the round does not end. So I have to force the round_end event by SP.


Syntax: Select all

# I think the imports are clear :)


@Event
def player_death(game_event):
tick_delays.delay(0.1, zombie_round_end) # Check for Alive CT

def zombie_round_end():
if get_ALv_Player('ct') == 0: # Get alive CT Player | Function isn't included in Snipped Code
zombie_end_round_event(3) # Terrorist won



def zombie_end_round_event(condition):

for info_map_parameters in EntityIter('info_map_parameters', return_types='entity'):

break
else:
info_map_parameters = BaseEntity.create('info_map_parameters')

info_map_parameters.call_input('FireWinCondition', condition)



The Problem is now:


The Round ends and starts again but..

.. sometimes I don't get teleportet back to spawn. I just can walk around like the round never end.

Or sometimes death Players get not respawned anymore.


* I should say: Tested it with bots. But Gameplay also should work with bots. *



So I wanted to know if somebody has another solution for Forcing End_Round:


I thought about:

To Check if it's the last CT Player which get killed: If this is true. Don't switch him to T but his LIFESTATUS to DEATH without killing him :D Just a thought.
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Mon May 04, 2015 1:39 am

http://forums.sourcepython.com/showthread.php?701

I believe the issue with my implementation might be that an activator or caller needs to be passed. However, I have not had any time lately to really do any testing and probably won't for the next several weeks.

You can definitely use Doldol's implementation, though, as that will certainly work. Though, AddOutput and FireUser1 have been changed to add_output and fire_user1 respectively.
Image
RoOF
Junior Member
Posts: 5
Joined: Fri Jul 13, 2012 9:58 pm

Postby RoOF » Wed May 06, 2015 9:55 pm

Thanks satoon for your reply.


The Round_end gets forced correctly... but 2 of 3 Player get not teleportet back to spawn. Or when one Player is death this Player don't get spawned again...


I noticed then sometimes the Players are "walkable". You can walk into and through the Players and you can't hit or hurt the other Player Also the other Player can't hurt or hit me. So I wanted to ask.. Does the switch_team function (PlayerEntity(<index>).switch_team(<team>, false, false)) change Players settings ? (Like noclip or nsolid (CCSPlayer.baseclass.baseclass.baseclass.baseclass.baseclass.baseclass.m_CollisionGroup) or anthing which can force this Problem ??

Could be this the Problem why some player get not switched back to spawn ?

Hope you could help me


-

RoOF
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Postby L'In20Cible » Wed May 06, 2015 10:50 pm

RoOF
Junior Member
Posts: 5
Joined: Fri Jul 13, 2012 9:58 pm

Postby RoOF » Thu May 07, 2015 4:51 pm

The Link you posted is for CS:GO. I tested the script in CSS :/


But as I see you describe the same problem in this topic that i have:

L'In20Cible wrote:And faced ton of weird issues (player not respawning or spawning with no weapon in hand but still attacking, etc.) so indvestigated why and PlayerEntity.switch_team is not calling the function it should. Currently, it calls CBasePlayer::ChangeTeam.
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Postby L'In20Cible » Thu May 07, 2015 7:20 pm

RoOF
Junior Member
Posts: 5
Joined: Fri Jul 13, 2012 9:58 pm

Postby RoOF » Sat May 09, 2015 1:35 am

Thanks Guy's for the fast reaction :) :cool:

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 132 guests