Laser scope issue not shutting off
In my scene ‘cave flyer proto’ I am using a laser scope to detect when the ship is close to a surface and then display a smoke effect. Took me some trial and error getting it to work but now if i’m Not pressing X or i’m Outside of the range of the laser scope, the original smoke effect is being constantly emitted in its original location. I assume some weird data is being fed to my emitter but how to debug?
-
I gotcha with this one. Remember debugging visually - if stuff lights up right from the beginning (which your thrust module does), you're checking for conditions you don't even care about. You only want the smoke to appear when you thrust, which you could easily do by just hooking the incoming signal (coming in the thrust microchip) into the emitter's off switch. Otherwise, you'd always get some result and (apparently) the emitter defaults to this location, probably because that's where it was first (I'm really just guessing here). Fact is, you're always trying to emit the smoke, but only in the correct position when you get a hit result.
Still not quite there yet because of that. Now we can see that your rocket smoke is exclusive as long as you get a result. Otherwise, we can see that one tree try to lift off again with a huge cloud below it.
So instead of what we did, I'd just use the scope's "hit something" node. Your emitter used to fire every single time you got thrust in, even if there is no surface for the smoke to bounce off. Just get an AND-gate and get "hit something" and the main signal you already wired into the emitter. Hook the gate into your emitter once more and it'll work out just as you wanted. -
I could upload it, but it's a pretty simple tweak, just holler if you need anything else.
-
the emitter has an off switch??
-
Ah do you mean the power switch, so it’s only powered when I press the x button? Ok.
And it seems to appear at the world origin point - not where I first placed it. So I guess it’s getting 0/0/0 from something
Will have another look with your info - thanks a lot! -
Not quite - wiring the and gate makes the proper animation (big to small) happen - but at the other location. Will play some more as it so definitely progress
-
Managed it by wiring the ‘hit something’ output of the scope to the power of the emitter. Seems good now.
Thanks for helping me think things through nice and clearly :D -
You need to take a wire from the node going into Thrust and put it into the gate - incoming signal. The other input for the and gate is "hit something" from the laser scope.
Your current situation is this: your emitter can't resolve the location of your scope, which either means that the scope is off (I think you wired this up too) or it doesn't get a location. If it doesn't get a location, we don't want the emitter to fire at all (because your ship is in the air), so make sure that no other wires are coming from the laser scope other than "hit something".
Since you activate the laser scope only when you use Thrust, wiring "hit something" to the emitter might be enough, no idea why I needed an AND-gate for that. That's basically a gate already. -
>Managed it by wiring the ‘hit something’ output of the scope to the power of the emitter. Seems good now.
Oh, perfect. Exactly what I meant since you already power the scope selectively, which is precisely how I thought about it. Your chips were arranged quite neatly already, so troubleshooting that wasn't a big deal at all, do that all the time and you're golden. :D
And only powering sensors when you need them probably isn't bad practice either, just to make sure you don't run expensive or superfluous stuff all the time, so... looking good for sure! -
Hi,
Great level btw. Just some extra info.
When the laser scope hits nothing it defaults to sending the world position
0,0,0
So that's why the smoke was popping back there.
Looks like you solved it though by only emitting when the laser is hitting something.
I love that the smoke is smaller the further away! Nice touch I'm impressed
John -
Right, the whole thing is looking real nice, forgot to say. Simple idea with a great result, reactive "particle" effects add so much cohesion to games and really to the gameplay as well. I played around for a bit and uploaded a remix of it (called "two emitters"), it's a simple way of making it look even more believable. If you put like 5 emitters all offset by 2 or 3 degrees, make the smoke smaller and fix the wires (copying the logic will put the world space location into the power node of the cloned emitter), you'll have a nice geometry-enveloping dust/smoke cloud, which looks especially cool in corners and on crests where you'd expect the clouds to come together or split apart.
Can't wait to see what you're doing for the trees, because they have to shake at some point! -
'@john yeah lots of fun and a little hair tearing with the signal manipulator :)
@skillphiliac - will take a look, thanks. A;though I should probably get the ship respawning on death first..
Please sign in to leave a comment.