PDA

View Full Version : EW_Brang sprites.



Archangel
05-08-2009, 11:43 AM
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.

Joe123
05-08-2009, 12:20 PM
Please replace that 255 with 'Screen->NumEWeapons()'

Archangel
05-08-2009, 05:17 PM
Please replace that 255 with 'Screen->NumEWeapons()'

Yeah, that would probably work better anyways.

Joe123
05-08-2009, 05:37 PM
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.

Archangel
05-08-2009, 11:39 PM
:confused:

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.

pkmnfrk
05-09-2009, 02:02 AM
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.

Joe123
05-09-2009, 04:14 AM
Well yes, and not trying to check the ID attribute of an unassigned pointer.