#plugins-dev-chat
1 messages ยท Page 81 of 1
We all do
:)
You make a plugin for a ton of people on a server and they love it and at the end of the day that's what counts
zero
zero
ive came up with a solution (to CustomRole.TryGet doing mean bad thingy), i overcomplicated it even more
who would like to see the monstrous code that should work
??
paws
@slate flume talk about SRP when your custom items inherit from CustomEventsHandler? 
Yay
I love seeing horrible voice and crashing out
idk like honestly its a year of development
and its almost done
you like this stuff
im sure you record them
No, I'm a toaster
426 reference 
Wdym?
old gradmas are like cameras
always been
it also attaches every event afaik
But it's not really SRP...
How so?
toaster
davy
Attaching to multiple events doesn't mean something doesn't have a single purpose
i've McFucking had it with exileds picky shit
public static bool TryGetCustomRoleFromPlayer(Player player, out CustomRole foundRole)
{
foundRole = null;
if (string.IsNullOrWhiteSpace(player.CustomInfo))
return false;
string[] lines = player.CustomInfo.Split('\n');
if (lines.Length < 2)
return false;
string roleIdentifier = lines[1];
foreach (var role in CustomRole.Registered)
{
if (role.CustomInfo == roleIdentifier)
{
foundRole = role;
return true;
}
}
return false;
}
u wanna help test ruei v3
Because you have the Item information and event handling in one class, probably not fully related
i switched totally to ruei v2
but i could help
fuck
They are because it serve the purpose of defining one item
oooh, the api?
For your use case (no 079 damage) create a subclass, seal the hurting event and create another method that'll handle the event if it's not a recontainnent damage handler
Wha

yea
what the flip
sealed override OnPlayerHurting(...)
{
if (ev.dh is not recontianment)
ProcessHurting(ev);
}
Holy shit new keyword unlocked
So you don't accidentally override the original handler
Fuck but that would still mean I would need to take all the onplayerhurting events and throw the keyword on
Cause it's not just custom items
Rider: extract superclass
And then replace the inherited class where applicable
And the event name too
WAIT YOU RIGHT
Replace the
CustomEventsHandler
Is replacing all my customeventshandler inheritances with my own class going to far to deal with this issue?
Cause I could patch it and get the same effect
Idk which would be considered better
I'm okay with putting in the work for it
Just is it excessive
No need to replace all of them, only where you don't wanna check for 079 damage
I think I have like 10 classes where I don't want to check?
My plugin is very large
it should be a lot easier than ruei v2
Haha
I can help you test, give me a couple minutes
Rider will yell at you 18 times if you use extract class
I love it when rider yells at me
It loves yelling at me
I've learned a lot from it lmao
There isn't a refactoring to change the base type for multiple classes iirc

Rider issues ๐คฃ๐คฃ๐คฃ
My bad if I forgot something that's supposed to be obvious but vs is too dumb to highlight it
I'll just make it so if damage handler is recontainment handler is doesn't call the onplayerhurting events

Bruh okay
Or maybe just
UnAPI-ing the Lab
I gotta do that sometime
The former is easier
Dope
huh
A plugin that un-API-s the Lab
Me when
i feel like people that seperate their event handlers as a means to follow the SRP pattern are overdoing it
code patterns shouldn't be the rule, just guidelines
That's fine but then is it a single responsibility to handle everything there?
I'd make some extension methods to make the in-class code shorter at least
Like
Not the whole handler
But so it's less logic
the thing with SRP is that theres no end to how small you can split things up
I have a resources file where I put extraneous functions that I use in a few different classes
Real
static class Misc
which is the point im making, why have one external event handler class when you can have one for each event?
I just find it easy to go
Abstract Base Class : Handles universal logic for all derived classes
Derived Class : Handles specific logic for that class
im so glad to finally be reworking my custom roles
Rather than
Abstract Base Class : Handles universal logic for all derived classes + niche side cases and bonuses for different derived classes
Derived Class : Handles specific logic + uses base class logic to handle side cases
Depends
E.g. if you're making a C4 then you wouldn't put the planted logic there
Although at that point it's not the item anymore, more so the planted "entity"
bad practice!! starts throwing rocks
chat i feel at peace now...
my custom teams are working
Yep that's correct
I mean your point is correct
๐ฅ I'm usually dumb and stupid
rip (not tide)
nuh uh
also when you follow one rule to its conclusion you usually break other principals which ends in code which is less maintainable
The worst practice I have is my Resources class
It has like
15 extension methods
Of assorted variety
seperate them 
You can get an eclair
I probably should
I've never made docs...
I never learned
I just try to make my classes as intuitive as possible to compensate
Lmao
SRP KISS DI
and you're already cooked
Make ai write docs for you

Realize that it's stupid
im honestly probably also gonna make HasFlagFast for every enum flag i use 
"I don't need docs I'll just remember
"
When source generator or generic splution
idk if it could be done in an easy generic way
actually
it might
I'll just forget that I'm developing a public library
i should @ hubert to add to EnumUtils
I have used AI in code maybe like
3 times
And it's for the boring manual labor-type shit
Like that lmao
@upper vapor PIRATE SOFTWARE
and use that
What
Wait but you're right
But also
Idk how lmao
I'm stupid
You forget
oh you mean
Okay yeah
I thought you meant some kind of interfacing
I'd still need to write the uh
Switch
For the room names
Or do interfacing with the translation file
Which sounds like
So much work
Hmm does dedicated load translations too?
Alt+enter
Convert to switch expression
Either check if dedicated load translations too
or just load the file yourself
Instead of hardcoding it like that ๐ญ
/// <summary>
/// Tries to get a role base from a <see cref="RoleTypeId"/>.
/// </summary>
/// <param name="roleTypeId">The <see cref="RoleTypeId"/> to get base of.</param>
/// <param name="role">The <see cref="PlayerRoleBase"/> found.</param>
/// <typeparam name="T">The <see cref="PlayerRoleBase"/>.</typeparam>
/// <returns>The role base found, else null. </returns>
public static bool TryGetRoleBase<T>(this RoleTypeId roleTypeId, [NotNullWhen(true)] out T? role)
=> PlayerRoleLoader.TryGetRoleTemplate(roleTypeId, out role);
/// <summary>
/// Gets the name of a <see cref="PlayerRoleBase"/> based on it's <see cref="RoleTypeId"/>.
/// </summary>
/// <param name="roleTypeId">The roletypeid to get name of.</param>
/// <returns>The found name.</returns>
public static string GetRoleName(this RoleTypeId roleTypeId)
=> roleTypeId.TryGetRoleBase(out PlayerRoleBase? playerRoleBase) ? playerRoleBase.RoleName : "Unknown";

well
could just use the role

Can the dedi server change language easily
It's peak trust
Seems like dedi only has english version
Does .RoleName format it nicely?
Copy paste it from client build
I use it for UI stuff
it should
I want it to look good
SCP-106
Oh
So it'll have spaces and shi
or smth
I guess thats used
Real shit
You know
I recently learned that
its up to nw what they named it
ye
Generators spawn in nameless rooms
Well until you do
room.Base.name or some shit like that
Get the string name for the unity object rather than the enum
This shit rocked my world
I still need to update my plugin to handle it
That's so tuff
skibidi
thank you
oh its just a room and .Contains
I MEAN THE GAME
MAFIA IS PEAK
I support this statement
Sillyci
silly
@upper vapor why not EnumUtils<RoomType>.Values
Because it's old code
Then I don't fix it cuz you fixed it
yea but ur the the one that should put it on the github
also
i will NOT be giving you working code
probably
oh
actually you cant get attribute from an enum value
yea nvm im not fixing it, its good enough
Kek
EVE
who r u
that one is the dev of RueI
ik
im gonna explode u
who is you
Dementia
im so bored i dont even know.. can someone end me already? We love Lua ๐ฅ get the gmod guys
im doing this shit rn only because im bored
can i eat it?
(and we need more script kids in sl!!!!)
script kiddies?
crazy we already have alot
yeah! then they can create there scp sl rp server!
in lua!!!
i mean check how many people on exiled create chatgpt plugin
why can player be null in PlayerChangingRoleEventArgs
and complain that they don't work
Destroyed
for that we need the LuaLab
(what am i talking about, they will break it too)
i love breaking stuff
especially something called SCP:SL
i think i will just finish my lua API Wrapping and then publish it and then never maintain it again
its there to be broken right
Imma just find some node based programming framework
and make that for Lua
and for SL
can we add brainfuck for sl?
Then do it
can we add SL in SL
is this like ironlua or soem shit
Doom on SL
MoonSharp
yo david you know the chaos keycard instead of shitty snake
doom
omg soulmates
no
cool
Now do it
No
Am i tripping or on this method the List is never returned to the pool ?
Make it from texttoy
What would you get in return then
an empty list?
You can return it to the pool if you want (but not a big deal if you wont)
we plan on looking into this aswell
so its maybe gonna end up as IEnumerable
Why taking a List from the pool if its not for return it. Its not big deal bc i dont think there is a lot of peoples called that methods a lot of times but you rent it and never return it for the next time you need a Pickup List from the pool
idk about ienumberable for this one
ienumerable prob wouldn't work yea
since its lazy it wont work unless you enumerate over it
Well, we do tell you about it.
i didnt have the comment :/
Nuget is available
yea that what im gonna say. Probably cuz im a retard who use Managed Folder
david whats the best piece of code inside the SL src that you like the most?
idk
@unique crane when doing cola + anti cola
is it guaranteed that cola gets disabled
I dont think either does
it does
you just explode and die
Seems like yea
wait actually
oh itll do the one that was on first
so if you drink cola first itll remove the cola
okay
doesnt that mean that if you do cola then anti you can survive

no. it was a no
what about it !
but yeah uh turns out
if anti cola isnt disabled by CokeBase, it jsut disables itself anyway
also turns out dummy 939s cant lunge properly
Anyone knows why would this trigger an exception??
room.IsDestroyed
God bless ๐
ok now i helped you so you help me right
generator.Room?.Base.name.Replace("(CLONE)", string.Empty) ?? "N/A"
why does this nto
replace
Bc ??
It's Clone
what no ?
Lmao
Clone
Skull issue
IM GONNA KILL YOU
Do name.ToLower()
good idea
I do that with names that the user can interact with
cause they can't use proper capitalization for shit
anyone know how to hide the Dummy tag from a dummy when I spawn it?
I figured out how to disable it for all dummies but surely there's an easier way than just changing it to this and back when spawning it
DummyUtils.DummyGroup = null;
:3
But doesn't that do it for all dummies, not just certain ones?
for all dummies
I'm trying to do it for certain dummies ๐
ig patch this code
ServerRoles::Start()
and make it just return when setting up the is dummy
and then make your own method wrapped around to SpawnDummy
I think I'll just uhh.. disable it for all dummies
Oh ok
um
errr
I'm not that smart lol
if you want i can give you the code
directly
just let me open rider
r u trying to create npcs?
I've never done any patch stuff so idk how to do that
let me do it for you
don't worry
Nah I'm making a custom role that spawns a dummy of itself as a decoy type thing
I just need the tag to not be there so people don't know it's a dummy
so an npc.....
sure, I just need it to sit there and pretend to be a real boy
[HarmonyPatch(typeof(ServerRoles), nameof(ServerRoles.Start))]
public class PatchLol
{
public static bool Prefix(ServerRoles __instance)
{
__instance._hub = ReferenceHub.GetHub(__instance.gameObject);
return false;
}
}
Patch
tyty, I'll see what I can do ๐
public static ReferenceHub SpawnDummy(string nickname = "Dummy", UserGroup? group = null)
{
ReferenceHub hub = DummyUtils.SpawnDummy(nickname);
hub.serverRoles.SetGroup(group);
return hub;
}
Here a code to actually spawn them with your own group or stuff you want note that if null the game will actually not display anything
Hope i helped
[HarmonyPatch(typeof(PlayerEvents), nameof(PlayerEvents.OnHurting))]
public class Scp079InvulnerabilityFix
{
public static bool Prefix(PlayerHurtingEventArgs ev)
{
return ev.DamageHandler is not RecontainmentDamageHandler;
}
}```
Nice
That was an easier fix than I was expecting
I'm a noob, where do I put the patch? ๐
Literally in any public class
Afaik
I'm on mobile I can read half the lines
Trying to add custom keybinds to my plugin, but they won't show up for players. What am I doing wrong?
Code here: https://github.com/malarada/CustomFramework-SCPSL/blob/master/CustomFramework/CustomFrameworkPlugin.cs#L129
if any of u wanna help test out ruei v3 https://github.com/pawslee/RueI/releases/tag/v3.0.0-alpha.1
would greatly appreciate it since theres a lot to test and im really busy :^3
Helo
Try SecretAPI @hearty shard
https://github.com/Misfiy/SecretAPI/blob/master/SecretAPI.Examples/Settings/ExampleKeybindSetting.cs
meow
hiii
yes
best you can do is .NET Standard
unfortunately
if only unity kept up with .NET releases (never happening)
No INumber :'(((
someone knows the difference between Dedicated and SourceTV?
like what even is?
Oh
its a spectator game
crazy
try it out :3
I mean i just switched now to v2
๐ญ
new rewrite ;(
git revert
NO
i already pushed like 3 other stuff
in case i can create a plugin and play around with it
but updating unless its like important
i will not
because as of rn i have another massive stuff to push
u knew the update was coming
!!!
i'll wait for the Translation system to be pushed
then i will actually code a new update
with ruei v3
me or
no its a pr im waiting for review
o
who's gonna review 
none
maro will push it
directly lol

"please review"
"lgtm"
im just the only dev 
btw Exiled has a cool stuff
that decompiled git repo
im copying their idea
Because i need to be gone for some hours and that pc sucks ass
so git online is really useful
@upper vapor https://ratcentral.is-a-good.site/๐/r6pdngy5.png
decompiler moment
is this done with the vs decompiler
quick couple of questions if anyone knows the answer off the tops of their heads:
-
Is it possible to prevent scientists from escaping? (Like removing the event trigger off of them) or is it easier to make a new class rather than reuse scientist
-
Can I change the text that appears on spawn in (Ex. "You are a Scientist")
-
Can I change the colour and name of a role that someone has, or am I needed to implement a new class.
Thanks to anyone who takes the time to look at or answer my questions!!
dnspyex
and then pushed
with the console command
copium and maldium
I COULDN'T FIND THE CONSOLE VERSION
Skill issue
Tbh its worst than dnspyex
or whatever it's dependent on
idk about that
- yes
- no
- irrc no
the decompiler itself is definitely better
for 2 and 3 you need to edit the translations yourlsef (clientside)
so that's nothing I can do from serverside then. Is implementing a new class also something needed server and client side modding?
Do you know how I would go about disabling escape scenarios for certain classes or players?
@celest thorn
dotnet tool install --global ilspycmd
public void OnEscaping(PlayerEscapingEventArgs ev)
{
if (ev.Player.Role == RoleTypeId.Scientist)
ev.IsAllowed = false;
}
Fuckin skill issue
fr???
btw i found out
Stick with
Wdym
yes no kinda
ok fixed it
lol
yea more readable
visual shittio
peak
now david i can pull up and say i have scp sl source code 
Yes
No
(How to get sued speedrun)
Obv no this is fucking server
its a miracle its readable
but its really useful to have on git
i know one day the nw's snipers will find me
meow is too strong 
they've found you already
crazy
im waiting for them
1v1 on fortnite no build
๐ญ
Ban
Why banning me im so cute :3

meanie
:catFlower:
Is there a way to remove the severed hands models shit?
The hands on the ground?
Ye
You might be able to patch SeveredHands.ChangeHandsState() idk if its synced with the client though
or if its the correct method ยฏ_(ใ)_/ยฏ
sizeof(nextUpdate) == 1 ? "nw moment" : "impossible"
nextUpdate is not a type
10kb
Is chat alive?
No
so sad
can i modify 049's ability time of respawn a zombie?
Its client side if i remember correctly
i think tho you can do reset it
did u remember where it is?
thx
this is kinda fire
yayayayaya
Whats so fire about it
the brackets have colors
i didnt realize this was a thing ๐ญ
๐
a lot easier to see where smth starts and ends by its color than counting brackets
Rainbow brackets, great plugin
gay brackets
@unique crane oi
why does this break shotgun
like shotgun ammo is 0, and you can get the reload animation.. it just doesnt add ammo
and its only seemingly when triggered through this method
do you have the processor code that spawns the shotgun
wdym
hmmm
where is this code
custom
yeah the item processor should handle it itself, no need for a static method(im not even sure if that would work in all cases)
base game might be doing stuff to the item before and after the upgrade
public virtual Scp914Result UpgradeInventoryItem(Scp914KnobSetting setting, ItemBase sourceItem)
{
ItemPickupBase sourcePickup = sourceItem.ServerDropItem(false);
Scp914Result scp914Result = this.UpgradePickup(setting, sourcePickup);
if (scp914Result.ResultingPickups == null || scp914Result.ResultingPickups.Length == 0)
return scp914Result;
InventoryInfo userInventory = sourceItem.OwnerInventory.UserInventory;
this.ClearCombiner();
foreach (ItemPickupBase resultingPickup in scp914Result.ResultingPickups)
{
if (!((UnityEngine.Object) resultingPickup == (UnityEngine.Object) null))
{
ISearchCompletor searchCompletor = resultingPickup.GetSearchCompletor(sourceItem.Owner.searchCoordinator, float.MaxValue);
if (searchCompletor.ValidateStart())
{
searchCompletor.Complete();
ItemBase resultingItem;
if (userInventory.Items.TryGetValue(resultingPickup.Info.Serial, out resultingItem))
this.AddResultToCombiner(resultingItem);
}
else
{
this.AddResultToCombiner(resultingPickup);
resultingPickup.Position = sourceItem.Owner.transform.position;
NetworkServer.Spawn(resultingPickup.gameObject);
}
}
}
return this.GenerateResultFromCombiner(sourceItem);
}
looks like this is what labapi does
this is labapi, which since im getting item handling for basegame without customs itd be BaseGameItemProcessor
so itd be what i showed above
Fixed in next update
This itself doesnt break it
its that when shotgun is created
It has MagazineModule which gets set to inserted when given by RA or spawn
but it didnt account for 914 creation
You guys know how sometimes loot clips through elevators?
Is it possible to fix that?
That's so funny
wdym
So when that?
The next update

@unique crane btw when is scale controller like actually reset in the role creation like time
cuz if you prevent scale change when is called and then disable scale prevention from there
With the role initialization
it still prevents it
wouldnt that be after PlayerChangingRoleEventArgs
No thats called last
yea
well then yea thats before that
makes sense
You cant initialize role and then event says "nuh uh"
OnRoleRemoved is called in Changing
but OnChangingScale seems to still prevent it
custom
Just call the event in the property
Literally
wdym
Well then whats the problem
it still seems to prevent it
Prevent what
Scale resetting
even tho on Changing i remove the event
so by the time role is being initialized it shouldnt be called
Wdym
hm
but when role is removed (OnChangingRole) it seems to still be in affect
eg changing to 173 twice works
but the first time doesnt
the health works fine and doesnt seem to break
its just scale specifically
I still dont understand what your trying to do
You want to set scale
when player changes role
prevent scale change while having the custom role
role is not removed on escape
Oh
why is Scale setter called every frame
i might be going insane
because i dont rly use FpcScaleController for anything except for yk
this patch rly
this is all uses of the setter
how about player.Scale?
there is no uses for player.Scale either
dont know then
ss didnt show but no results
wait
i might know
new SyncedScaleMessages.ScaleMessage(this._scale, this.Hub).SendToAuthenticated<SyncedScaleMessages.ScaleMessage>();
that sends to dedicated server
which sets .Scale
and i have a delay to fix issues
so
uh
new SyncedScaleMessages.ScaleMessage(__instance._scale, __instance.Hub).SendToHubsConditionally(hub => hub.Mode is not (ClientInstanceMode.Unverified or ClientInstanceMode.DedicatedServer));
problemo solved
Oh
not into 14.1.1 at least
Ye as 15.0? Or still be something fix for 14.x 
In 14.1.1.1 
can't wait for 14.1.1.1
cant wait to KILL YOU
we need for 14.2 or 14.1.2
or
22.0
i disagree
nope what the helly
Is this in the game? Does it have an update loop?
Its in the game
but i've never seen it
(Server Side)
i mean it is but its literally doing nothing (so it seems)
but gets never loaded or initiated
guys!
what happens when you change the speaker in voice message to someone else? Can you speak through someone?
that sounds terrifying out of context
truly
you fucking can
LOL
Okay wait before I test, does changing the voice channel of a message sync with the client and actually work or no?
Eg. Override and redirect SCP messages to use proximity channels
I'm a little busy so I figured I'd ask in case anyone knows
yes
msg.Channel = VoiceChatChannel.Proximity;
Fire
Iirc I'd need to resend the message cause the message we get in the event is a copy
Right?
what
when PlayerSendingVoiceMessageEventArgs is called
you need to deny event
and then send it
just foreach every player, validate with their IVoiceRole::VoiceModule.ValidateReceive
and then set the msg channel and send it listener.Connection.Send(msg);
Okay cool yeah that's what I thought
What I mean is that
The event doesn't give the actual original message, so making modifications to that message won't sync iirc
or maybe PlayerReceivingVoiceMessageEventArgs can be used instead without actually sending
I remember seeing a whole debate in here about it
msg.Channel = VoiceChatChannel.Proximity;
listener.Connection.Send(msg);c
thats my code
ev.Message.SendProximityMessage(MaxProximityDistance);
this is how its called (from the event)
Yeah I already do a prox chat thing I just wanted to know if changing message synced and that the ref thing was right
even if its not a ref
if you deny the event
and modify the new voice message
it will do the same
because ur still sending the correct data and client can handle it
I know
I just wanted to make sure I was right that it wasn't a ref
Haha that was the extent of my inquiry into that
I don't fully understand but very cool
So
What
I'm confused
Does this mean I didn't need to set up my system around essentially doing the event myself and I could've just modified the message?
yea
skull emoji
Bruh
shut up eve!!!!!
Someone knows how to modify a out in a prefix?
ref Type param
nice honkers
AHAHAAHHAHAHHAAHAHA
I was surprised people were just overlooking the beginning part of that video
bruh
Crazy that you're the one saying bruh when you're the one who posted it lmao
lets change topic lol
OneTopic mentioned? 
I have a stupid question is it too heavy to have a new Harmony for each module that i have
Why would you do that ๐ญ
Because i have harmony patch for each of them and i want to be able to disable them
whenever i want
You can use SecretAPI's PatchCategory
And unpatching?
Call unpatchcategory
can you give it to me :3
next year
ok ;(
Merry Christmas
so sad
Times up give me the code
๐ซ
like the only problem i got
is finding the MethodBase
for that type
harmony.Unpatch(harmony.GetPatchedMethods().First(x => x.DeclaringType == type), HarmonyPatchType.All, harmony.Id)
I mean this could work?
public void UnpatchAll(string harmonyID = null)
{
foreach (MethodBase methodBase in Harmony.GetAllPatchedMethods().ToList<MethodBase>())
{
MethodBase original = methodBase;
int num = original.HasMethodBody() ? 1 : 0;
Patches patchInfo1 = Harmony.GetPatchInfo(original);
if (num != 0)
{
patchInfo1.Postfixes.DoIf<HarmonyLib.Patch>(new Func<HarmonyLib.Patch, bool>(IDCheck), (Action<HarmonyLib.Patch>) (patchInfo => this.Unpatch(original, patchInfo.PatchMethod)));
patchInfo1.Prefixes.DoIf<HarmonyLib.Patch>(new Func<HarmonyLib.Patch, bool>(IDCheck), (Action<HarmonyLib.Patch>) (patchInfo => this.Unpatch(original, patchInfo.PatchMethod)));
}
patchInfo1.Transpilers.DoIf<HarmonyLib.Patch>(new Func<HarmonyLib.Patch, bool>(IDCheck), (Action<HarmonyLib.Patch>) (patchInfo => this.Unpatch(original, patchInfo.PatchMethod)));
if (num != 0)
patchInfo1.Finalizers.DoIf<HarmonyLib.Patch>(new Func<HarmonyLib.Patch, bool>(IDCheck), (Action<HarmonyLib.Patch>) (patchInfo => this.Unpatch(original, patchInfo.PatchMethod)));
}
bool IDCheck(HarmonyLib.Patch patchInfo) => harmonyID == null || patchInfo.owner == harmonyID;
}
this is what harmony does
i lied i dont
i had smth i was doing but ig i gave up
@celest thorn as long as the modules are in separate assemblies, you can easily call PaychAll/UnpatchAll
no they aren't
Hm, something in my code is causing the server to freeze and die to lack of heartbeat.
I cant find anything in ServerLogs or LocalAdminLogs about it.
Do i have to comment out parts of my code bit by bit until i find it or is there a better way? :c
Do you do anything player scale related
Current theory that it is ScaleMessage(stuff).SendToAuthenticated();
since that was my most recent addition
do NOT do SendToAuthenticated
okay .w.
this is the fixed nw version
the change is the bottom line, with SendToHubsConditionally
oh
lol
yeah that fixed it
Thanks x.x
Is there any other use case of SendToAuthenticated that does not result in a server crash? xd
-# wondering why it exists
I made fake scales that work, but how can i send a scale message to all (real) players to "fix"/resync the server scale?
My first smooth brain idea was player.Scale = player.Scale but that doesnt work xD
Conti
I am spawning an explosion by doing
ExplosiveGrenadeProjectile.SpawnActive(spawnPosition, ItemType.GrenadeHE, null, 0);
but it isnt dealing any damage to anyone :c
dont use null
even with a player it doesnt do anything ,_,
TimedGrenadeProjectile.SpawnActive(player.Position, ItemType.GrenadeHE, player, 0.1f);
works for me
Explosion blows off all doors but leaves any player uninjured ?w?
Do you have FF off or on
Do you move between spawning the grenade and it exploding?
It might be that kind of bug
I have a command that spawns an explosion at another player which works fine
Could it be that im destroying the script the grenade is made from at the same time?
shouldn't be
Are you sure you dont have any other code
that could code the not taking damage
And that one spawns active grenade too?
Or you use ExplosionUtils?
What is that :o
t
ExplosionUtils.ServerSpawnEffect or
ExplosionUtils.ServerExplode?
:o
one does the effect one does the killing
,_,
i assume they both use labapi one
Explode player:
ExplosiveGrenadeProjectile.SpawnActive(target.Position, ItemType.GrenadeHE, requester, 0);
Explode RPG:
ExplosiveGrenadeProjectile.SpawnActive(transform.position, ItemType.GrenadeHE, Owner, 0);
The script for it is on an rpg schematic that gets moved to "fly"
And is the Owner really not null?
yes
Can you check
Because I would trust the requested player to not be null
but here your doing some
things
and I have honestly no idea what else it might be
maybe the "Owner" variable on the script is the issue since the script gets deleted right after?
Well your first passing it and then deleting it so no issue there
I would check this
will put a logger and see
Code:
Result:
I also commented out the Destroy(gameObject) and yeah that wasnt it
Uhhhhh
I increased the timer to 3s to test it again and now it deals damage waaaa
Doesnt work again
0.2
Sometimes it worked with 0,
sometimes it worked with 4
Most often it doesnt work with 0,
Most often it doesnt work with 4
Seems like server restarts just choose something at random ๐ญ
So how would i use ExplosionUtils to manually create an instant explosion at a location? .w.
apparently null works now?? D: im confused
Okay that is weird
How do i make a gun shoot at someone even if they are in great distance?
NetworkWriterPooled writer = NetworkWriterPool.Get();
int headerPos = writer.Position;
writer.WriteByte(0);
int payloadStart = writer.Position;
writer.WriteRelativePosition(new RelativePosition(player.Position));
writer.WriteQuaternion(player.Rotation);
writer.WriteReferenceHub(Player.DummyList.First().ReferenceHub);
writer.WriteRelativePosition(new RelativePosition(Player.DummyList.First().Position));
int payloadEnd = writer.Position;
writer.Position = headerPos;
writer.WriteByte((byte) ((payloadEnd - payloadStart) & 0xFF));
writer.Position = payloadEnd;
NetworkReader reader = new(writer.ToArraySegment());
new ShotBacktrackData(reader).ProcessShot(item.Base, null);
I tried this
but nothing
oh wait
why am i writing this info lol
it works im stupid
Working with RueI 2 to figure out how the fuck it works, and an example uses this code: AutoElement.Create(Roles.Scps, MyElement).UpdateEvery(TimeSpan.FromSeconds(0.7));, yet I can't find AutoElement.Create. The hell am I doing wrong?
new AutoElement
but also
ruei v2 is being replaced with ruei v3 which is literally better in every way
so i wouldnt recommend trying to learn 2
I already looked at three, I thought they were gonna be somewhat similar at least, but no. Completely different.
Do I have to call something to make the DynamicElement initiate or does it automatically start working?



