ZDaemon Forum Index ZDaemon
Client/Server DOOM
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CTF Flags as Inventory Items

 
Post new topic   Reply to topic    ZDaemon Forum Index -> Implemented Requests
View previous topic :: View next topic  
Author Message
EarthQuake
Wicked Sick!


Joined: 02 Apr 2004
Location: Athens, Ohio. Dieblieber gonna getcha!

PostPosted: Sat Sep 19, 2009 12:24 am    Post subject: CTF Flags as Inventory Items Reply with quote

Currently, there is no way to determine whether or not a player is carrying a flag through ACS. Lots of neat tricks could be done if this were possible, both in CTF maps and maps made specifically for "custom" game modes.

I propose that when a flag has been picked up, the player who is carrying it could have a dummy inventory item added to his or her inventory, and removed once he or she no longer carries the flag. The inventory item should probably be named the same as the pickup actors (like in the case of keys, for example).

Actor names for the flags are "RedFlag", "BlueFlag", "GreenFlag", "WhiteFlag", and "GoldFlag" (which afaik is unused at the moment).

So if those were added to the inventory, like keys for example, one could use ACS to check for their presence:

Code:
Script 1 (void)
{
  If (CheckInventory("RedFlag"))
    Print(s:"You have the red flag!");
  Else
    Print(s:"You don't have the red flag!");
}


Using this in combination with Team Keys, you can identify not only what team a player is on, but whether or not that player carries the enemy flag!
Back to top
View user's profile Send private message Send e-mail
Cybershark
Spamming!


Joined: 05 Jan 2005
Location: off the grid, but still fighting for the users!

PostPosted: Sat Sep 19, 2009 1:31 am    Post subject: Reply with quote

Hell yes please!
Back to top
View user's profile Send private message Visit poster's website
BestOfTheWorst
Unstoppable!


Joined: 02 Jun 2006

PostPosted: Sat Sep 19, 2009 1:21 pm    Post subject: Reply with quote

I wouldn't make any more inventory items.. this sounds like you're thinking it from a modders point of view.. but really when its about coding , we can just make a special case just like with;
Code:

Script 1 (void)
{
int health;
health = CheckInventory("Health"); //Returns amount of health the player has
}

there is no dummy "Health" inventory item either, it just checks for this special case, and returns the activators health;
Code:

else if (stricmp (type, "Health") == 0)
{
   return activator->health;
}

(note current zdaemon version doesn't have this yet though, use PlayerHealth() meanwhile)
Back to top
View user's profile Send private message
EarthQuake
Wicked Sick!


Joined: 02 Apr 2004
Location: Athens, Ohio. Dieblieber gonna getcha!

PostPosted: Wed Sep 23, 2009 6:12 am    Post subject: Reply with quote

That's right, you told me about that...

It will still function in the same way, so your suggestion is way better for this purpose.
Back to top
View user's profile Send private message Send e-mail
EarthQuake
Wicked Sick!


Joined: 02 Apr 2004
Location: Athens, Ohio. Dieblieber gonna getcha!

PostPosted: Fri Jul 13, 2012 11:02 pm    Post subject: Reply with quote

Code:
30. Added support for checking if a player is carrying a flag with the
     ACS CheckInventory functions. (ie. CheckInventory("RedFlag")).


Added for b28. Thread can be moved now.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    ZDaemon Forum Index -> Implemented Requests All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group