Basically a version of laser.zh that has a boolean of being stopped by solid combos or not. I'd like to try to practice scripting by making an EWeapon script spawn lasers (i.e. laser octorok/wizzobe/gleeok/gohma)but the current laser.zh not having any solidity checks makes it not really all that versatile. Not as important, but a feature where the laser-spawner can move and the laser moves along with it would also be cool. This would also be a cool improvement to Newbie Boss.
[2.55] LaserEX
#1
Posted 13 October 2019 - 11:04 PM
#2
Posted 23 October 2019 - 11:24 AM
#include "std.zh" eweapon script laz { void run(int speed, int colour, int layer, int fizzlesfx, int fizzlesprite, int shotsfx) { int startX = this->X; int startY = this->Y; this->Angular = true; Audio->PlaySound(shotsfx); //because enemy editor shot sound isn't variable yet this->Angle = ArcTan(Link->X-this->X, Link->Y-this->Y); this->Step = speed; //this->Damage = Game->LoadNPCData(this->Parent)->WeaponDamage; //should get bthis from the enemy editor this->DrawYOffset = -32768; //make wpn sprite invisible while(1) { if (Screen->isSolid(CenterX(this), CenterY(this))) { this->DeadState = WDS_DEAD; Audio->PlaySound(fizzlesfx); if(fizzlesprite) { lweapon fiz = Screen->CreateLWeapon(LW_SPARKLE); fiz->UseSprite(fizzlesprite); fiz->CollDetection = false; fiz->X = this->X; fiz->Y = this->Y; } } else { Screen->Line(layer, startX, startY, CenterX(this), CenterY(this), colour, 1, 0, 0, 0, 128); } Waitframe(); } } }
#3
Posted 23 October 2019 - 05:08 PM
-snip-
I'd personally not make a separate weapon for the fizzle animation, I'd make the weapon become the fizzle (setting CollDetection=false, or hitoffset = 9999, etc). Why create an extra weapon for a death effect when you don't need to?
#4
Posted 24 October 2019 - 03:43 AM
I'd personally not make a separate weapon for the fizzle animation, I'd make the weapon become the fizzle (setting CollDetection=false, or hitoffset = 9999, etc). Why create an extra weapon for a death effect when you don't need to?
It resets/ensures that the anim frame is set to 0, for wSparkle. I also fixed the compilation (missing RPAREN).
I see that weapon scripts need ParentUID, to return the current npc screen index is controlling them, so that the weapon script can get current frame data on its parent npc sprite.
#5
Posted 24 October 2019 - 03:45 AM
It resets/ensures that the anim frame is set to 0, for wSparkle.
'lw->Frame = 0;'?
#6
Posted 27 October 2019 - 06:26 AM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users