Blockland Forums > Modification Help
Projectile scale?
Iban:
Right, but that's not the point of the script. If it doesn't adjust the projectile size randomly with direct input like that, the problem is beyond my reach.
If it does work, as I suspect it will, you can back track and add more detail to it.
takato14:
--- Quote from: Iban on March 21, 2011, 09:00:36 PM ---Right, but that's not the point of the script. If it doesn't adjust the projectile size randomly with direct input like that, the problem is beyond my reach.
If it does work, as I suspect it will, you can back track and add more detail to it.
--- End quote ---
I changed the scale factor of the last check (referring to if(%charge_time <=7000)) to three and the projectile scale echoed as 3 and was larger as well.
Technically the question I had initially asked has been solved, but I dont see a point in making another topic.
Iban:
Make the model bigger, then. It'd be better to make a huge model and scale it to a range of 0.25-0.75 than to make a model too small.
takato14:
--- Quote from: Iban on March 21, 2011, 09:07:57 PM ---Make the model bigger, then. It'd be better to make a huge model and scale it to a range of 0.25-0.75 than to make a model too small.
--- End quote ---
uh, what... The projectile model is empty.dts...
Alright. Here's what I am trying to do with this.
I want a chargeable laser. I have the weapon image set up similarly to the spear.
I store the time the weapon is started charging in the client using getSimTime() as shown in the function below.
--- Code: ---function SLCZImage::onCharge(%this, %obj, %slot)
{
%obj.client.saved_time = getSimTime();
}
--- End code ---
Then, I use the below function to determine how long the client has been charging the weapon. The bolded part is meant to test how long the client has been charging.
--- Quote -----EPIC SNIP--
--- End quote ---
The 4 if statements set %scaleFactor to different values depending on how long the client has been charging. half-size for less than a second, 3/4 size for anything above 1.999 seconds, normal scale for 3 seconds, and twice the size at 7 seconds(the projectile is highly destructive).
The scaling works right now, but Im not checking for how long the mouse button has been held correctly. How else can I test for this?
Apparently I actually AM doing it right; The script is simply skipping the lower scales and jumping straight to 1. Then If I hold it for over 7 seconds it shoots a projectile with scale of 2.
takato14:
Managed to finally fix it. Locking.