TheCVB's Mod Releases [Spaar's Modloader]

#21
I replicated the bug, seems it like it doesn't work in a certain range. The raycast should be fine, though :/ Im checking the bug out a bit more tomorrow when i got some sleep. c:
 

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#25
I thought that too but there is only one showing! I did swap it out for the latest this morning. tho. I wonder, is it possible for one updated mod to have a duplicate of the older version contained within it by accident?
Maybe you saved it with the wrong name once, have you tried removing all mods, then reinstalling the ones you want?

@ITR a bit OT here but I am also getting an intersection warning when I try to place pins...could the two probs be related?
(ik clutching at straws here)
I think that was a bug in either spaar's modloader or building tools, just turn off block intersection in BT
 
#26
Getting there dude! one last problem ...two actually :>
1. The laser light is not heating up cannons and making them fire or produce steam.
2. The beam is passing right thru them and out the other side! (the original T-Cat laser did this too btw but @Pixali fixed that)
no heat lasers.JPG
 
#27
@FrizB The steam/cannon thing is an issue with how I originally coded the ignite mode... it's supposed to be incrementing a variable that says 'hey! I should be glowing hot' but it doesn't for whatever reason. TCat's laser did the same thing too.
I'm 99% sure it's passing through stuff because CVB set the raycast layer mask incorrectly (should be layerMask = ~((1 << 20) + (1 << 2)); or whatever it was in the original code). The correct fix is to replace:
Code:
if (Physics.Raycast(base.transform.position + new Vector3(0f, 0f, 0.5f), base.transform.forward, out raycastHit, Single.PositiveInfinity, this.rayCastLayerMask))
with
Code:
if (Physics.Raycast(base.transform.position + base.transform.forward * 0.5f, base.transform.forward, out raycastHit, Single.PositiveInfinity, this.rayCastLayerMask))
in OnSimulateUpdate().
 
#29
Thanks for your help, i already changed the raycast a few hours ago, but then i tried changing the layer mask and screwed up :c Code is replaced with the old value and the laser is colliding with itself again, but not with the machine O_O

EDIT: I put the code to ignore layer 31 in the wrong place, but the laser is definitely working now. (May still contain a large amount of weird bugs)
Code:
rayCastLayerMask = 1 << 20; // Fire
rayCastLayerMask += 1 << 2; // Ignore raycast
rayCastLayerMask = ~rayCastLayerMask;
rayCastLayerMask += 1 << 31; // Ignore itself
EDIT 2: Uploaded.
 
Last edited:
#30
@TheCVB nonono, you need to put the += 1 << 31 before = ~rayCastLayerMask. How the mask works is that you assign a set of flags using boolean operators.
if you have say ... 0000 0100 as the mask in binary, that means the ray will only collide with objects on layer 2 (0-based, like arrays). We don't want to raycast against layer 2, because that contains things like objective triggers. You can test this by leaving the mask out and trying to send the laser through the gravity fields in the old sandbox; the laser will simply stop before entering the field. So what you then want to do is use the ~ (tilde) operator to invert the mask; eg. 0000 0100 becomes 1111 1011. So then you're casting against everything except layer 2.
btw an interesting side effect of doing the gravity field test is that you'll find that raycasts won't hit something if the cast starts inside that thing. So if you just have the cast start inside the laser, you shouldn't run into any problems unless the laser is going too fast.. tbh I don't really know what would happen since it looks like you moved the raycast code to FixedUpdate..? just make sure that you're not using Vector3.forward in global space, and I'm sure it'll be fine.

Finally, if you're serious about maintaining all of this you should send @spaar a PM about getting into the modding slack. I'll be able to help you more with my old code then bc I check there somewhat frequently, and the forums aren't exactly appropriate for quick back & forth stuff like this anyway :p
 
#32
It seems to be completely fixed with the new version i uploaded, however the fix was pretty random, so i don't really know much about bugs that could occur now. @Pixali Just so you know, the layer mask is still the same as the one i posted before. It just works now xD
 
#34
i'm having a bit of trouble with this, whenever i load it into my mods folder and start the game i see the block's name but just a wood block appears.
thanks
*note i'm currently using the latest version of the game (.35)
 
#39
@Shade I don't plan to update advanced lasers/optics ever. Both versions that I worked on are full of code that doesn't really allow for expanding on or any improvement, so I've abandoned it (since July 2016). If you really, really want lasers back though, I can recompile what little code over at github actually works for whatever the latest version is now. Other than that, maintenance of advanced lasers v0.27 is all on @TheCVB, and/or @wang_w571 if he decides to pick it up.
Normally I'd tell you what I have planned for the future at this point, but I can't because any & all feedback will probably destroy my motivation to do anything for a month.
 

Shade

Active Member
#40
@Shade I don't plan to update advanced lasers/optics ever. Both versions that I worked on are full of code that doesn't really allow for expanding on or any improvement, so I've abandoned it (since July 2016). If you really, really want lasers back though, I can recompile what little code over at github actually works for whatever the latest version is now. Other than that, maintenance of advanced lasers v0.27 is all on @TheCVB, and/or @wang_w571 if he decides to pick it up.
Normally I'd tell you what I have planned for the future at this point, but I can't because any & all feedback will probably destroy my motivation to do anything for a month.
...yyyeeep. That's why I ask it on CVB's thread, not yours.
My mention and request was directed to @wang_w571 since he asked about the code.
And you don't even need to recompile anything since the laser is fully working on latest version (0.42b)
 
Top