Open WheteThunger opened 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
.
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);
}
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.
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:
maspray <skin id>
(default spray is skin id is not specified)maspawn spray.decal
+maskin <skin id>
Requirements:
maskin <skin id>
(might be tricky if the spray is attached to an entity, especially one that is spawned by the plugin)Additional considerations: