Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

[Request] hand grenade

11 replies · 4,839 views · Started 19 December 2008

[SIZE="1"]I have another request for people to ignore…[/SIZE]

A bomb that Link "throws" instead of setting. So I need a script that makes Link throw the bomb two tiles in front of him (like the candle flame?) then it explodes instantly.

EDIT: I tried that quest in the newest build, then 819 and I see the items aren't working properly in the new one.

But that grenade is close to what I want. I actually want it to explode as soon as it hits the ground.

I know it won't work in the new build.
_L_ change the way item speeds work.

Explode on impact is fine yeah, I can do that.

A suggestion:

            for(int i=1;i<=Screen->NumLWeapons();i++){
Grenade = Screen->LoadLWeapon(i);
if(Grenade->ID != LW_SCRIPT1) continue;
Found = true;
}

I would write this like:

            for(int i=1;i<=Screen->NumLWeapons();i++){
Grenade = Screen->LoadLWeapon(i);
if(Grenade->ID == LW_SCRIPT1) {
Found = true;
break;
}
}

So that it stops once it finds the grenade, rather than continuing to check every single lweapon on the screen (not that big of a problem, but it makes more sense this way)

Other than that, this script looks pretty good (especially since it uses the proper global-script form!)

Mm, I had a reason at the time for not writing it like that. I can't remember what it was now though.

Your method of writing global scripts is definately much better :thumbsup:

Joe, your PM box is full.

Anyway, both scripts appear to be working perfectly now. Thanks a lot for all the help.