Re: 8-way Multidirectional Shooter Weapon
Quote:
Originally Posted by
Joe123
Does it derefrence the old one when that happens, and then beam3 just becomes the new weapon?
I'd hope so.
I'm not sure how it would work in normal C language, but as far as Zscript goes this is a HUGE benefit. It's the only way I can go through every Link and enemy weapon sprite, all the screen enemies' and many ffc cordinates, and check their locations in proximity to eachother based on CSets. Much faster than arrays.
Ugh...anyways I posted some boss scripts at pure that use alot of for loops, so check those out.
Now, I expect people to be using these scripts in quests. I mean c'mon people, it's an 8-way Link fireball! ;)
Re: 8-way Multidirectional Shooter Weapon
Yeah, I've seen those scripts, I just don't understand how they work >_<
Like that flamethrower script you made.
It's about the only script that simple that I just can't understand.
Re: 8-way Multidirectional Shooter Weapon
Hey bigjoe, I just realized that if you change it to eweapon instead of lweapon and changed it to flame, then you just turned any enemy into a fire wizzrobe!
Quote:
Originally Posted by
Joe123
Like that flamethrower script you made.
It's about the only script that simple that I just can't understand.
It's really quite simple. You have a loop like this:
Code:
for(int i=Screen->NumNPCs();i>1;i--){
Now lets assume there are 100 enemies on the screen, So i=100 right? As the loop runs down to 1 (but not 1!) you've just run through every number that is a screen enemy, exept 1. So Screen enemies 2-100 could be pointed to by adding something like this inside the loop:
Code:
npc enemy = Screen->LoadNPC(i);
From here we can do whatever we want to each of those 99 NPCs on the screen every frame. ...Like this:
Code:
for(int i=Screen->NumNPCs();i>1;i--){
npc enemy = Screen->LoadNPC(i);
enemy->HP=100;
}
Now Link is gonna find it pretty hard to kill those enemies if they keep regenerating themselves.
Make sense.
Re: 8-way Multidirectional Shooter Weapon
Oh!
Well that makes more sense.
I couldn't work out how you were referencing so many enemies with just one pointer.