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

SpawnRotationType.This does not work in Statuseffects #15683

Closed
1 of 2 tasks
Regalis11 opened this issue Feb 27, 2025 · 1 comment
Closed
1 of 2 tasks

SpawnRotationType.This does not work in Statuseffects #15683

Regalis11 opened this issue Feb 27, 2025 · 1 comment
Assignees
Labels
Bug Something isn't working Code Programming task Ticket The issue has been converted into an issue report.

Comments

@Regalis11
Copy link
Collaborator

Discussed in #15675

Originally posted by Ydrec February 25, 2025

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • My issue happened while using mods.

What happened?

изображение
This rotationtype is supposed to copy parent angle, it does not due to code mistake

Spawn item function in Stauseffect class has a coding mistake for SpawnRotationType.This.

It calls TransformRotation function from Physics body of the entity which fires statuseffect, however TransformRotation does not change rotation aside from flipping direction. In no way does it apply parent rotation to spawned item.

Reproduction steps

Take item below, place a few in sub editor and rotate them. When clicking button it would spawn item with SpawnRotationType.This and you can see all of them going straight right regardless.

button throwing item
<Item name="" identifier="WIP_testspawnrotation" category="Electrical" tags="smallitem,button" allowedlinks="door" linkable="true" cargocontaineridentifier="metalcrate" scale="0.5" impactsoundtag="impact_metal_light" isshootable="true" maxstacksize="8" SpriteColor="255,150,150" InventoryIconColor="255,150,150">
<Sprite texture="Content/Items/Button/button.png" sourcerect="28,70,34,51" depth="0.8" origin="0.5,0.5" />
<Body width="36" height="40" density="20" BodyType="Dynamic" />
<Controller direction="None" canbepicked="true" msg="ItemMsgPressSelect">
  <sound file="Content/Items/Button/Button.ogg" type="OnUse" range="500.0" />
</Controller>
<ConnectionPanel selectkey="Action" canbeselected="true" msg="ItemMsgRewireScrewdriver" hudpriority="10">
  <GuiFrame relativesize="0.2,0.32" minsize="400,350" maxsize="480,420" anchor="Center" style="ConnectionPanel" />
  <RequiredItem identifier="screwdriver" type="Equipped" />
  <output name="signal_out" displayname="connection.signalout" >
      <StatusEffect type="OnUse" target="This">
        <SpawnItem identifier="oxygentank" spawnposition="This" count="1" rotationtype="This"  impulse="3"/>
    </StatusEffect>
  </output>
</ConnectionPanel>
<Holdable pickkey="Use" slots="Any,RightHand,LeftHand" msg="ItemMsgDetachWrench" PickingTime="1.0" aimpos="35,-10" handle1="0,0" aimable="true" attachable="true" attachedbydefault="true"/>
</Item>

Bug prevalence

Happens every time I play

Single player or multiplayer?

Happens in both single player and multiplayer

-

No response

Version

v1.7.7.0 (Winter Update)

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

No response

@Regalis11 Regalis11 added Bug Something isn't working Code Programming task Ticket The issue has been converted into an issue report. labels Feb 27, 2025
@Regalis11 Regalis11 self-assigned this Feb 27, 2025
@Regalis11
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Code Programming task Ticket The issue has been converted into an issue report.
Projects
None yet
Development

No branches or pull requests

1 participant