import "std.zh"
int ewbrangsprite = 100; //Replace that number with sprite ID.global script EW_Brang{
void run(){
while(true){
for(int count = 1; count <= Screen->NumEWeapons(); count++){
eweapon test = Screen->LoadEWeapon(count);
if(test->ID == 131) test->UseSprite(ewbrangsprite);
}
Waitframe();
}
}
}
Have you gotten sick of those Goriyas using the same boomerang Link has by default? Well this script replaces that sprite with a custom one you choose.
To implement it. You first need to make the sprite, write down the ID of the sprite. And replace the number 100 in line 2 with the ID of whatever sprite you want to use for the EW_Brang.
Thanks to Joe123 for helping me figure out the method of going by doing this.
Please replace that 255 with 'Screen->NumEWeapons()'
Joe123 wrote:Please replace that 255 with 'Screen->NumEWeapons()'
Yeah, that would probably work better anyways.
It's not that it would work better (or at least, it wouldn't appear to).
It'd just stop you from checking through about 250 non-existent EWeapons every single frame, which isn't a great idea.
😕
Say what? It's 255 last time I checked, it's the max that it checks, but the idea of using Screen->NumEWeapon would make much sense.
Yes, 255 total. But, at most, 6-8 would be on screen at once (in normal circumstances), and maybe 3 will be goriyas? Yeah.
Anyway, anything to reduce the running time of the script by 2 orders of magnitude is a good thing.
Well yes, and not trying to check the ID attribute of an unassigned pointer.