July 2012 FNF: Backpack Drop?

All finished FNF events go here.

Moderator: Friday Night Fragfest Team

Locked

Quake-style backpack drop on Zan 1.0?

Poll ended at Thu Jul 26, 2012 7:01 pm

 
Total votes: 0

Qent
Retired Staff / Community Team Member
Posts: 1424
Joined: Tue May 29, 2012 7:56 pm
Contact:

July 2012 FNF: Backpack Drop?

#1

Post by Qent » Tue Jul 17, 2012 7:00 pm

For the July FNF Special, should we add the Quake-style backpack drop, if applicable? Note that it will require Zandronum 1.0-alpha!

Synert
Forum Regular
Posts: 228
Joined: Mon Jun 04, 2012 12:54 pm
Contact:

RE: July 2012 FNF: Backpack Drop?

#2

Post by Synert » Tue Jul 17, 2012 7:04 pm

Couldn't you add ALL of the mutators..?

jeez you guys make things awkward

Qent
Retired Staff / Community Team Member
Posts: 1424
Joined: Tue May 29, 2012 7:56 pm
Contact:

RE: July 2012 FNF: Backpack Drop?

#3

Post by Qent » Tue Jul 17, 2012 7:06 pm

I wish, but most of the others requested them with a specific WAD. :/

User avatar
Ivan
Addicted to Zandronum
Posts: 2229
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

RE: July 2012 FNF: Backpack Drop?

#4

Post by Ivan » Tue Jul 17, 2012 7:16 pm

Can't you make it Skulltag compatible ? I think the only part that needs to get erased is the pickup message part for it.
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

Synert
Forum Regular
Posts: 228
Joined: Mon Jun 04, 2012 12:54 pm
Contact:

RE: July 2012 FNF: Backpack Drop?

#5

Post by Synert » Tue Jul 17, 2012 7:44 pm

Qent wrote: I wish, but most of the others requested them with a specific WAD. :/
well hell if you're gonna do it that way
Ivan wrote: Can't you make it Skulltag compatible ? I think the only part that needs to get erased is the pickup message part for it.
Nope, it uses StrParam. Not just for the string, either- it's how it gets what weapon the player had, how much ammo, etc.
Last edited by Synert on Tue Jul 17, 2012 7:45 pm, edited 1 time in total.

Llewellyn
Forum Regular
Posts: 578
Joined: Mon Jul 02, 2012 7:12 am

RE: July 2012 FNF: Backpack Drop?

#6

Post by Llewellyn » Wed Jul 18, 2012 12:17 am

Synert wrote:
Ivan wrote: Can't you make it Skulltag compatible ? I think the only part that needs to get erased is the pickup message part for it.
Nope, it uses StrParam. Not just for the string, either- it's how it gets what weapon the player had, how much ammo, etc.
Backpack mod in 98d

It was the only function in the acs using StrParam, so my outdated ACC didn't spew an error when I compiled it.
Seems to work fine for me when I changed the backpack message to just

Code: Select all

Log("You got a backpack!");
I tried to make a shitty hack for Skulltag but it freezes even in Zando when I pick up a backpack...
Spoiler: CrappyCode (Open)

Code: Select all

str ammo2[4] = {"","","","",};
str space2[4] = {"","","","",};
str AMMONAMEx[4] = {"","","","",};
str s[4] = {"","","","",};
str comma2[4] = {"","","","",};

script 395 (int check, int packWepNum) clientside
{   
  int pln = PlayerNumber();
  int i, j, k, a =-1, b =-1, c =-1, d =-1;
	str comma = ", ";
	str space = " ";
	str weaponname = "", commaw = "", weapona = "";

    if (PlayerIsBot(pln)) { terminate; }
    if (CheckInventory("PickingUpDropPack") != check) { terminate; }


    for (i = 0; i < AMMOCOUNT; i++)
    {
        j = prevAmmos[i];
        if (j != 0)
        {
        k++;
					ammo2[i]=j;
					space2[i]=space;
					AMMONAMEx[i]=AMMONAME[i];
					s[i] = cond(j == 1, "", "s");
        comma2[i] = ", ";
        if (a ==-1)
            a=i;
        else if (b == -1)
            b=i;
        else if (c == -1)
            c=i;
        else 
            d=i;
        }
    }


	if (packWepNum != -1)
	{
	weaponname = WEPNAME[packWepNum];
	commaw = comma;
  weapona = " a ";
	}
    switch (k)
    {
    case 0:
    Log(s:"You got",s:weapona,s:weaponname,s:".");
    break;    
    case 1:
    Log(s:"You got",s:weapona,s:weaponname,s:commaw,d:ammo2[a],s:space2[a],s:AMMONAMEx[a],s:s[a],s:".");
    break;    
    case 2:
    Log(s:"You got",s:weapona,s:weaponname,s:commaw,d:ammo2[a],s:space2[a],s:AMMONAMEx[a],s:s[a],s:comma2[a],d:ammo2[b],s:space2[b],s:AMMONAMEx[b],s:s[b],s:".");
    break;
    case 3:
    Log(s:"You got",s:weapona,s:weaponname,s:commaw,d:ammo2[a],s:space2[a],s:AMMONAMEx[a],s:s[a],s:comma2[a],d:ammo2[b],s:space2[b],s:AMMONAMEx[b],s:s[b],s:comma2[b],d:ammo2[c],s:space2[c],s:AMMONAMEx[c],s:s[c],s:".");
    break;
    case 4:
    Log(s:"You got",s:weapona,s:weaponname,s:commaw,d:ammo2[a],s:space2[a],s:AMMONAMEx[a],s:s[a],s:comma2[a],d:ammo2[b],s:space2[b],s:AMMONAMEx[b],s:s[b],s:comma2[b],d:ammo2[c],s:space2[c],s:AMMONAMEx[c],s:s[c],s:comma2[c],d:ammo2[d],s:space2[d],s:AMMONAMEx[d],s:s[d],s:".");
    break;
    }
}
EDIT: It appears that if I try to declare more than 19(?) variables in a script Skulltag/Zando crash.

EDIT2: Replaced broken code with working code. Yay. [/sarcasm]
Last edited by Llewellyn on Thu Jul 19, 2012 3:00 am, edited 1 time in total.

Synert
Forum Regular
Posts: 228
Joined: Mon Jun 04, 2012 12:54 pm
Contact:

RE: July 2012 FNF: Backpack Drop?

#7

Post by Synert » Wed Jul 18, 2012 8:29 pm

Llewellyn wrote: It was the only function in the acs using StrParam, so my outdated ACC didn't spew an error when I compiled it.
Oh, really? My bad :x
Llewellyn wrote: EDIT: It appears that if I try to declare more than 19(?) variables in a script Skulltag/Zando crash.
AFAIK that's some kind of limitation- ijon's been running into this problem as well.

Llewellyn
Forum Regular
Posts: 578
Joined: Mon Jul 02, 2012 7:12 am

RE: July 2012 FNF: Backpack Drop?

#8

Post by Llewellyn » Thu Jul 19, 2012 2:54 am

Synert wrote: AFAIK that's some kind of limitation- ijon's been running into this problem as well.
Sounds like a bug that needs to be reported?

Anyway, after a while of being a derp, I realized "duh, just use arrays."
Image

And have updated the earlier post with WORKING code, so you guys can replace Ijon's (sorry bro) neat looking code with my messy hack if you want to run it in Skulltag.

Also, the forum broke because it still inherits the width of the spoiler even before it is opened. Sounds like another bug. Lol.
Last edited by Llewellyn on Thu Jul 19, 2012 3:01 am, edited 1 time in total.

Qent
Retired Staff / Community Team Member
Posts: 1424
Joined: Tue May 29, 2012 7:56 pm
Contact:

RE: July 2012 FNF: Backpack Drop?

#9

Post by Qent » Thu Jul 19, 2012 5:43 am

So... don't need 1.0 for this?

Llewellyn
Forum Regular
Posts: 578
Joined: Mon Jul 02, 2012 7:12 am

RE: July 2012 FNF: Backpack Drop?

#10

Post by Llewellyn » Thu Jul 19, 2012 5:56 pm

Not if you use this version:
https://dl.dropbox.com/u/26269208/quakebpak1-2-1.pk3
Doesn't have the ACS lumps in it like the other one did but all credit goes to Ijon lol.
Last edited by Llewellyn on Thu Jul 19, 2012 5:57 pm, edited 1 time in total.

Ijon Tichy
Frequent Poster Miles card holder
Posts: 901
Joined: Mon Jun 04, 2012 5:07 am

RE: July 2012 FNF: Backpack Drop?

#11

Post by Ijon Tichy » Fri Jul 20, 2012 3:02 am

Synert wrote: Nope, it uses StrParam. Not just for the string, either- it's how it gets what weapon the player had, how much ammo, etc.

Code: Select all

ubuntu@ubuntu pk3/acs $ grep -Ein "StrParam|^script" quakebpak.c
93:script 393 (int mode)
191:script 394 (int check, int a1, int a2) clientside
197:script 395 (int check, int packWepNum) clientside
208:        logStr = StrParam(s:logStr, s:" a ", s:WEPNAME[packWepNum]);
215:        if ((packWepNum != -1) || (i > 0)) { logStr = StrParam(s:logStr, s:", "); }
217:        logStr = StrParam(s:logStr, d:j, s:" ", s:AMMONAME[i], s:cond(j == 1, "", "s"));
nop
Llewellyn wrote: And have updated the earlier post with WORKING code, so you guys can replace Ijon's (sorry bro) neat looking code with my messy hack if you want to run it in Skulltag.
yeah that's basically why StrParam is awesome - you don't need (as much) hackiness anymore

edit: also mirrored

edit2:
Llewellyn wrote: EDIT: It appears that if I try to declare more than 19(?) variables in a script Skulltag/Zando crash.
oh yes, that bug - it turns out acc blindly allocates 36 bytes (enough for exactly 19 ints) that can be used for variables - it probably actually allocates 40, but the first 4 are used for the script number
either way it's a stupid limitation and a better compiler wouldn't have the issue
Last edited by Ijon Tichy on Fri Jul 20, 2012 3:12 am, edited 1 time in total.

Minigunner
 
Posts: 86
Joined: Mon Jun 04, 2012 5:24 am
Location: California

RE: July 2012 FNF: Backpack Drop?

#12

Post by Minigunner » Fri Jul 20, 2012 3:17 am

Why not use the unused fat backpack sprite from skulltag_data (and put it into the mod)? The sprite was intended for use as a cooperative backpack.
Theshooter7 wrote:Also, to all those people who stack players for exploits: I hate you. Do I really need to seal off every inch of every map to prevent you from getting to places you shouldn't?

Locked