Closed PatPeter closed 4 years ago
Intresting ideas, I will get onto adding some of them in the near future, thank you for the suggestions!
It's so ironic that I went through all the effort of 17 builds to prevent zombies from killing themselves with the tesla gates and the developers decided to take tesla gates out of the game entirely :\
In the IEventOnPlayerHurt, why not just check if the player's class is zombie (10) , like
switch ((int)player.Class.ClassType)
{
case 10:
if(type == DamageType.TESLA) { typeOutput = DamageType.NONE; damageOutput = 0f; }
else goto default;
break;
case default:
typeOutput = type;
damageOutput = damage;
break;
}
@Rnen That would have worked for the (now defunct) tesla gates, but I was hoping for a solution that would work for both the tesla gates and the Y-junction infinite pit of deaths. Is there any way to teleport zombies after they've jumped to their own deaths in the infinite pits of death?
Added the suggestions about health modification
1 - OnAssignTeam is only ever called on the initial round start, i know its a confusing event name. Ive renamed it. So previousTeam will always be unassigned or maybe RIP.
2- Player.GetTeamClass should get the previous/current team class (its set after the event)
" Either the ability to fire events from within events (such as killing a player after spawning as a punishment), or chaining events together, (for instance if a class is changed for OnSetClass, it calls another OnSetClass until teamclass == teamclassOutput)" anyone can actually call events. Though this sounds like it could get into infinity loops easy unless im misunderstanding.
Use Player.ChangeRole to change role/teams. I know it can look a little confusing with a TeamRole class, a Team enum and then a Role enum. The TeamRole is just a bridging class and usually its just there to be a packet of information.
With the ability to pipe plugin events between each other, does this fulfill my original use case? I'll try coding event piping tomorrow.
I'm creating my first plugin for Smod2 and I'm having quite a difficult time getting it to work. Here is a list of all the things I'd like to see in the API in the future that would make it easier to use.
Player
class, a readonly public variableHealth
that allows reading the player's health. A methodSetHealth
would probably be needed for setting health positively, unless negative values can be supplied toDamage
OnAssignTeam
is passed aTeams previousTeam
parameter that allows checking the previous team of the playerOnSetClass
is passed aTeamClass previousTeamClass
parameter that allows checking of the previous class of the playerIEvent
,OnPlayerSpawn
, that is fired after theOnAssignTeam
andOnSetClass
events fire only when the player is physically in the server. Example use case: a player does friendly fire damage to other players and on respawn, the player is damaged equal to the damage doneIEvent
,OnPlayerSpectate
, that is fired after theOnPlayerDie
event that functions the same asOnAssignTeam
.IEvent
,OnPlayerEscape
that triggers when Scientists or D-class escape the map. Use case: force scientists and d-class to drop their items when they escape.OnSetClass
, it calls anotherOnSetClass
untilteamclass == teamclassOutput
)Vector
as anout
parameter in events that respawn players, so that players can be respawned in certain saved locationsspawnRagdoll = false
, it should disable the hiddenVector
that controls where a player will be respawned when the player is turned into SCP-049-2. If there's no ragdoll, there should be no respawn point other than SCP-049's spawn point.TeamClass
factory so thatTeamClass
classes for aClasses
value can be retrieved. I tried to donew TeamClass()
, or modify an existingTeamClass
withteamclassOutput.Team = Teams.SCP; teamclassOutput.ClassType = Classes.SCP_049_2;
, but theTeamClass
enums are readonly. I usedServer.getClasses()
and set it to aDictionary
in my plugin to finally get access to all the classes in the game.Vector
to control where they respawn as zombies, or set theVector
to null and have them respawn in SCP-049's baseLet me explain what I am personally trying to do so that my requests will make more sense. I have an epidemic of zombies killing themselves intentionally either by tesla gate or by falling to their deaths in the Heavy Containment Y-junction.
If you're better off reading the code, here is my ZombieSuicideHotlineEventHandler.cs file.
These are all the things I've tried in the past 24-hours to get this working:
player.ChangeClass
inOnPlayerDie
, and then teleport usingplayer.Teleport
to SCP-049's spawnpoint.player.ChangeClass
andplayer.Teleport
do not work inOnPlayerDie
.Dictionary
in the plugin inOnPlayerDie
. Then, inOnSetClass
if a player is flagged inzombieSuicides
, setteamclassOutput
toClasses.SCP_049_2
. The eventOnSetClass
does not trigger when a player is killed and set to Spectator. If the player is spawned in in the next NTF/Chaos wave, the player will respawn as SCP-049-2 and die instantly to the tesla gate or infinite pit of death.Dictionary
inOnPlayerDie
. InOnSetClass
, set the zombies to SCP-049 to respawn them in a safe space. Then, chain anotherOnSetClass
by moving the player fromzombieSuicides
todeadDoctors
and then set the player to SCP-049-2 in the secondOnSetClass
. Cannot chain events.There are more that I thought of during development and I'll add them when I remember them.
I'm also putting all my ideas for plugins here that can't currently be implemented in the API as example use cases for implementing the suggestions above: