Maps, modifications, add-ons, projects, and other releases for Zandronum. Also includes announcers.
-
The Blue Panther
-
- Posts: 31
- Joined: Sun Jun 17, 2012 12:54 am
- Location: Argentina
#1
Post
by The Blue Panther » Wed Aug 08, 2012 3:47 am
(No icons, sorry)
I haven't found anywhere (or maybe I didn't look hard enough) showing how to do this in Skulltag, I suppose making a counter is easy enough... but somehow I ended up with a headache, I feel silly... anyways
For those still using Skulltag here's a powerup counter, feel free to use it, and/or tinker with it to make it more efficient
(I tested a wad that used one made in SBARINFO with Zandronum, and it gave me an error... so this for me is the only way, I could be wrong)
EDIT:
Here is Llewellyn's version of the code (Which I felt it was better):
Code: Select all
script 1 (void)
{
/* It does initializes powerup, does powerup--
which is the same as "powerup = powerup -1"
and that the countdown has not ended. */
for (int powerup = 60;powerup > -1; powerup--)
{
//This makes sure the player is still alive
if (GetActorProperty (0, APROP_Health) < 0)
terminate;
if (CheckInventory("PowerupActive") > 1)
{
TakeInventory ("PowerupActive", 1);
powerup = 60; //Restarts the timer!
}
SetFont("BIGFONT");
SetHudSize(320, 240, 1);
HudMessage(i:powerup; HUDMSG_PLAIN, 1, CR_WHITE, 308.0, 127.0, 2.0);
//This prevents the delay by putting it at the end
Delay(35);
}
}
And attached example
https://www.dropbox.com/s/ninx4iet3up1u ... Example.7z
Just summon a "GenericPowerup" or a DoomSphere
Last edited by
The Blue Panther on Wed Aug 08, 2012 6:05 am, edited 1 time in total.
-
Llewellyn
- Forum Regular
- Posts: 578
- Joined: Mon Jul 02, 2012 7:12 am
#2
Post
by Llewellyn » Wed Aug 08, 2012 4:41 am
Spoiler: walloftext (Open)Well I helped, original with new comments:
Code: Select all
script 1 (void)
{
int powerup = 60;
while ((powerup > -1) && (GetActorProperty (0, APROP_Health) > 0))
{
if (CheckInventory("PowerupActive") > 1)
{
TakeInventory ("PowerupActive", 1);
restart; //This is unessecary also,
} //because the script is in a While(),
//so its going to be looping already.
SetFont("BIGFONT");
SetHudSize(320, 240, 1);
HudMessage(i:powerup; HUDMSG_PLAIN, 1, CR_WHITE, 308.0, 127.0, 2.0);
powerup = powerup - 1;
{ //These brackets are random and useless
Delay(35);
} //These brackets are random and useless
}
terminate; //This is unesscary, once it hits the last bracket it automatically terminates.
}
How I would have done it:
Code: Select all
script 1 (void)
{
/* It does initializes powerup, does powerup--
which is the same as "powerup = powerup -1"
and that the countdown has not ended. */
for (int powerup = 60;powerup > -1; powerup--)
{
//This makes sure the player is still alive
if (GetActorProperty (0, APROP_Health) < 0)
terminate;
if (CheckInventory("PowerupActive") > 1)
{
TakeInventory ("PowerupActive", 1);
powerup = 60; //Restarts the timer!
}
SetFont("BIGFONT");
SetHudSize(320, 240, 1);
HudMessage(i:powerup; HUDMSG_PLAIN, 1, CR_WHITE, 308.0, 127.0, 2.0);
//This prevents the delay by putting it at the end
Delay(35);
}
}
Excuse the editing, I wasn't sure what you were trying to do with this until I played the wad lol.
EDIT: Script 2 is so much more complicated than it needs to be, and is actually broken as the text and sound from the sphere wearing off is displayed whenever you die:
Code: Select all
script 2 (void)
{
for (int powerup = 25; powerup > -1; powerup--)
{
//This makes sure the player is still alive
if (GetActorProperty (0, APROP_Health) < 0)
{
FadeRange(190,0,0,0.7,0,0,0,0.0,0.5);
terminate;
}
if (CheckInventory("doomActive") > 1)
{
TakeInventory ("doomActive", 1);
powerup = 25; //Restarts the timer!
}
if (powerup < 4)
{
if (powerup == 3)
{
Print(s:"Doomsphere is wearing off...");
LocalAmbientSound("QUADWearoff", 127);
}
FadeRange(190,0,0,0.7,0,0,0,0.0,0.5);
}
SetFont("BIGFONT");
SetHudSize(320, 240, 1);
HudMessage(i:doom; HUDMSG_PLAIN, 5, CR_RED, 308.0, 147.0, 2.0);
//This prevents the delay by putting it at the end
Delay(35);
}
}
Last edited by
Llewellyn on Wed Aug 08, 2012 8:25 am, edited 1 time in total.
-
The Blue Panther
-
- Posts: 31
- Joined: Sun Jun 17, 2012 12:54 am
- Location: Argentina
#3
Post
by The Blue Panther » Wed Aug 08, 2012 5:59 am
Llewellyn wrote:
Script 2 is actually broken as the text and sound from the sphere wearing off is displayed whenever you die:
["more clean code"]
Oh, I screwed it up there... First version of the script had a bunch of whiles before and after the delay... and the player would terminate the script via his death state, It worked fine
Llewellyn wrote:
I have no idea what you did but your doomsphere makes you like 70% vulnerable.
It doesn't matter, the point of the second script was the Hudmessage, sound and faderange fancyness
While it still doesn't prevent the delay, the code is now 100% better than before, I'll update the first post and the wad with it, thanks a lot!