View previous topic :: View next topic |
Author |
Message |
EarthQuake Wicked Sick!
Joined: 02 Apr 2004 Location: Athens, Ohio. Dieblieber gonna getcha!
|
Posted: Sat Sep 19, 2009 12:24 am Post subject: CTF Flags as Inventory Items |
|
|
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 |
|
|
Cybershark Spamming!
Joined: 05 Jan 2005 Location: off the grid, but still fighting for the users!
|
Posted: Sat Sep 19, 2009 1:31 am Post subject: |
|
|
Hell yes please! |
|
Back to top |
|
|
BestOfTheWorst Unstoppable!
Joined: 02 Jun 2006
|
Posted: Sat Sep 19, 2009 1:21 pm Post subject: |
|
|
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 |
|
|
EarthQuake Wicked Sick!
Joined: 02 Apr 2004 Location: Athens, Ohio. Dieblieber gonna getcha!
|
Posted: Wed Sep 23, 2009 6:12 am Post subject: |
|
|
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 |
|
|
EarthQuake Wicked Sick!
Joined: 02 Apr 2004 Location: Athens, Ohio. Dieblieber gonna getcha!
|
Posted: Fri Jul 13, 2012 11:02 pm Post subject: |
|
|
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 |
|
|
|