The suicide barrels gamemode code was posted on the official sandbox discord:
https://github.com/Facepunch/sbox-suicidebarrels
This simple gamemode addon is just a demonstration of how easily someone can create in C# a addon but also this shows how a gamemode/addon will work on Sandbox.
Some images/videos about the gamemode in question, published by @Layla on the discord #development text channel:
https://streamable.com/6pq56
https://streamable.com/sxw9w
https://files.facepunch.com/adam/2018/March/10/barrels.mp4
stop focusing on this and start focusing on more important gamemodes, like pedobear
I have a hardon for RPCs now.
I'm curious what sort of overhead or limitations come with them
Still not DarkRP
when i can play erotic roleplay in s&box
S&Box is nothing but a big tease to the people who can't play it.
Can't wait to use this... whenever S&box is out... and whenever I decide to learn C#
What we learned about the API from this example (we already know most stuff from the devlogs)
Attributes
- Class Attributes
[ClassLibrary] I have no idea what this does
- Field Attributes
[Replicate] is used to sync data (e.g. health) [Devlog 2]
- Method Attributes
[Multicast] runs method on all clients including the server too [Devlog 2]
[Client] runs method only on clients [Devlog 2]
[Server] runs method only on the server [Devlog 2]
[ConsoleCommand("cmd_name")] registers a console command. You can use method parameters for console arguments. Method must be static.
The methods annotated with [Client], [Server] and [Multicast] will be automatically intercepted for networking, e.g. server runs DoTaunt() when actually clientside calls DoTaunt() (DoTaunt() is annotated with [Server]). This means we do not need to call RPC calls manually. [Devlog 2]
- Property Attributes
[ConsoleVariable(Name = "prop_name", Help = "Help Text")] allows you to register your own console variables
Field/Properties
Authority (bool) allows to check if the current running code runs on server
Client (bool) allows to check if the current running code runs on client
Player (?) gets the current player. Can be null and is null on servers
Methods
void Tick() runs on every tick
void Initialize() runs when the class loads
void OnPossessed() idk, probably when a model got assigned
void DoInput() handle input [Devblog 6]
void Die() calledwhen object dies
void OnUpdateView(ref ViewInfo viewInfo) called when view gets updated
Note: Since we don't have access to the API files, we can not know from which classes those fields, properties and methods are inherited from.
This class: https://github.com/Facepunch/sbox-suicidebarrels/blob/master/Code/BarrelControllable.cs includes good examples for almost everything mentioned here.
yay, thanks lay lay!
Possessing Pawns
OnPossessed is when you gain control over that pawn.
awesome
Looks really good. You are making us even more inpatient tho
The UI for Suicide barrels has been added to the repository!
I like this new UI system.
make it balanced mate
Sorry, you need to Log In to post a reply to this thread.