WheteThunger / MonumentAddons

Add entities, spawn points and more to monuments
https://umod.org/plugins/monument-addons
MIT License
7 stars 9 forks source link

Allow placing sprays at monuments #41

Open WheteThunger opened 2 years ago

WheteThunger commented 2 years ago

Rust recently introduced spray decals which players can spray onto objects using the spray can. We should add the ability to add these to monuments.

Possible usage:

Requirements:

Additional considerations:

WheteThunger commented 2 years ago

I got something basic working. In the maspawn method (when aiming at a wall):

if (shortPrefabName == "spray.decal")
{
    localRotationAngles.x += 270;
    localRotationAngles.y -= 90;
}

Running maskin is not hitting the spray though, so if aiming at a spray that's on an entity spawned by this plugin, it will find that entity instead of finding the spray. That seems to be because it's on layer 1, and the raycast currently hits only Solid and Water. I was able to reskin to the 2818953599.

WheteThunger commented 2 years ago

Once https://github.com/OxideMod/Oxide.Rust/pull/418 gets merged, we can place the following code in PostEntitySpawn().

var spray = Entity as SprayCanSpray;
if ((object)spray != null)
{
    spray.splashThreshold = int.MaxValue;
    spray.CancelInvoke(spray.RainCheck);
}
WheteThunger commented 2 years ago

The following commits have provided multiple improvements.

For next steps, we can document how to add spray decals under "Instructions for specific entities", include the default spray skin ids, and include mention of how to create custom spray decals.

Freehand sprays, as well as moving sprays with Telekinesis (i.e., auto snap to surface while moving) will require additional research and are probably out of scope for this specific issue.