RE-SS3D / SS3D

Space Station 3D, another remake of SS13, but with an extra D.
https://ss3d.space/
249 stars 138 forks source link

[WIP]: Tickrate #1409

Closed WongChoice closed 7 months ago

WongChoice commented 7 months ago

Summary

What This PR do?

Attempts to Fix #1406

Use case is unknown.

Tested the Code on an object confirming Ticks operation

Implements a system to be used anywhere necessary to trigger ticks with custom time frame using functions InvokeRepeating and CancelInvoke

PR checklist

Testing

https://github.com/RE-SS3D/SS3D/assets/40324640/14b334f9-d0fb-4743-9a2e-1781e2e8b1de

https://github.com/RE-SS3D/SS3D/assets/40324640/842fc16d-32b8-4daf-8181-4dc3863432e4

Attach the script to any object.

Related issues/PRs

Closes #1406

iamteapot422 commented 7 months ago

You can check the boxes by clicking at them. Video of testing doesn't work

Alainx277 commented 7 months ago

I'm not sure how the code could work as it is. The manager does not know what function to call with what interval.

In the demo video the "C" should be logged twice (1/2 second), then the "A" component (1 second). But in the video the order is always A->B->C.

iamteapot422 commented 7 months ago

I deeply apologize, but we discussed the issue and decided that Invoke methods can't be used and the issue doesn't deserve a bounty

WongChoice commented 7 months ago

I'm not sure how the code could work as it is. The manager does not know what function to call with what interval.

In the demo video the "C" should be logged twice (1/2 second), then the "A" component (1 second). But in the video the order is always A->B->C.

Hey

here's the line

` InvokeRepeating(nameof(InvokeCustomTick), 0f, interval);

` the tick gets invoked soon after the previous one ends waits for the specific interval then ahead. it will always be in sequency unless u ask it to UnregisterTick one.

/// At present the registerticks and they are called in same place considering i dint know the use case. you can do it through a function

I see no hope trying more since you have decided to not use the methods i feel cheated (kidding)

Thanks :)

stilnat commented 7 months ago

@WongChoice I feel bad dude sorry about the mess up. We don't get many new coders and that's not a proper way to welcome them. That does not happen often but that went on you. If you still feel like helping in the future, I recommend asking on the discord about opened issues. Hopwe we'll hear from you again, thanks for giving a look at it :) .

cosmiccoincidence commented 7 months ago

We appreciate the effort Wong, we also have more bounties available if interested.

Also, do you have a Discord account? We use Discord as our primary method of communication so you are welcome to join our server if you are interested.