Blockland Forums > Modification Help
Using multiple raycasts with the same weapon image?
<< < (2/2)
FrogFreak:
Sorry, but I'm still in the dark. I've had a look through version 2 of the raycast support script and I'm without enlightenment. Would you be able to offer any suggestions as to how to interchange between two raycasts somehow? I haven't noticed any way to specify a certain raycast at a given time.
CityRPG:
I don't know what you're asking.

If you want some sort of laser pointer script you're in for a hackfest.

Package WeaponImageName::onMount(%this, %obj, %slot) and start a loop, like %player.doLaserPointer(). in doLaserPoint(), schedule a new laser point every 100ms or so.

In WeaponImageName::onUnMount(...), cancel that schedule.

That's how I'd do it.
FrogFreak:
Ok, basically, I've been using a raycast projectile to simulate a laser pointer. However, I'm wanting another raycast projectile to function as the actual weapon's projectile, in my case a rocket. I plan to have the rocket act as the "tracer" of the second raycast. But, I don't know of anyway to have two raycast projectiles and their accompanying data stored in the same weapon image and how to actually call for either raycast projectile.
FrogFreak:
Resolution Found!

I finally found a way for this to work! All I really needed was just one raycast projectile. In the "onFire" function of Tier + Tactical 2's pistol script are these code snippets:

--- Code: ---%this.raycastSpreadAmt = 0.0018;
%this.raycastWeaponRange = 85;
--- End code ---
Since the raycast projectile IS 100% script as you have mentioned, it is dynamic in that it can be modified on the fly. I took advantage of this and added these two script snips to two different functions:

--- Code: ---%this.raycastTracerProjectile = NULLProjectile;
--- End code ---

--- Code: ---%this.raycastTracerProjectile = LightRocketProjectile;
--- End code ---

This enabled the weapon image to have two different projectiles spawned with the same raycast at different times.
Navigation
Message Index
Previous page

Go to full version