Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow placing sprays at monuments #41

Open
WheteThunger opened this issue Jun 10, 2022 · 3 comments
Open

Allow placing sprays at monuments #41

WheteThunger opened this issue Jun 10, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@WheteThunger
Copy link
Owner

WheteThunger commented Jun 10, 2022

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:

  • Sprays do not decay (server side or client side)
  • Sprays cannot be washed away by splashing water
  • Sprays can be resized with entity scale manager
  • Spray icon can be changed with maskin <skin id> (might be tricky if the spray is attached to an entity, especially one that is spawned by the plugin)

Additional considerations:

  • Free hand sprays
  • Moving sprays with telekinesis
@WheteThunger WheteThunger added the enhancement New feature or request label Jun 10, 2022
@WheteThunger
Copy link
Owner Author

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
Copy link
Owner Author

Once OxideMod/Oxide.Rust#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
Copy link
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant