OnCap function for worldWeapons-ServerShots

Questions, comments, and news on the server side plug-ins and it's API
Post Reply
User avatar
Zehra
Private First Class
Private First Class
Posts: 433
Joined: Sun Oct 18, 2015 3:36 pm
Location: Arctic
Contact:

OnCap function for worldWeapons-ServerShots

Post by Zehra » Thu May 17, 2018 8:31 pm

I'd like if there was a function for triggering onCap world weapons.
So it would be possible to introduce a few new modes and to also be able to trigger them when using altered or enhanced CTF modes.
(Triggering onCap with flags/kill streaks/points..etc..)

Sample base with onCap world weapon:

Code: Select all

base
 position 100 0 0
 rotation 0
 size 10 10 0
 color 1
 oncap SW
end
-Zehra
There's this game I love and it's called Ducati. ~Zehra
Those who are critical of me, I'll likely be the same of them. ~Zehra
There's always something to remember and it's been a game I love. ~Zehra
The time spent is a time which can never be regained, so it's a time to enjoy. ~Zehra
The decisions we make are the ones we look forward too and the ones we regret. ~Zehra
The details and the skill of knowing and applying them is what excellence is made of. ~Zehra
The best player is the one who knows what to do and when and applies it successfully. ~Zehra
There's a difference between knowing my name and knowing me, one shows respect to my name and the other is to who I am. ~Zehra
My blog is available at zehrahblog.wordpress.com.
See when I've last been active at Strayers.

User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5172
Joined: Fri Dec 13, 2002 4:11 am
Location: [Redacted]
Contact:

Re: OnCap function for worldWeapons-ServerShots

Post by JeffM » Thu May 17, 2018 9:34 pm

bz_triggerFlagCapture should already do that.

User avatar
Zehra
Private First Class
Private First Class
Posts: 433
Joined: Sun Oct 18, 2015 3:36 pm
Location: Arctic
Contact:

Re: OnCap function for worldWeapons-ServerShots

Post by Zehra » Fri May 18, 2018 3:24 am

I'm not sure if I'm missing something, so please correct me if I'm wrong, but I checked for 'bz_triggerFlagCapture' with Notepad++ on bzfsAPI.h from BZFlag version 2.4.10 and didn't find it.
I'm probably doing something wrong, so could a little bit of help be given?

-Zehra
There's this game I love and it's called Ducati. ~Zehra
Those who are critical of me, I'll likely be the same of them. ~Zehra
There's always something to remember and it's been a game I love. ~Zehra
The time spent is a time which can never be regained, so it's a time to enjoy. ~Zehra
The decisions we make are the ones we look forward too and the ones we regret. ~Zehra
The details and the skill of knowing and applying them is what excellence is made of. ~Zehra
The best player is the one who knows what to do and when and applies it successfully. ~Zehra
There's a difference between knowing my name and knowing me, one shows respect to my name and the other is to who I am. ~Zehra
My blog is available at zehrahblog.wordpress.com.
See when I've last been active at Strayers.

User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5172
Joined: Fri Dec 13, 2002 4:11 am
Location: [Redacted]
Contact:

Re: OnCap function for worldWeapons-ServerShots

Post by JeffM » Fri May 18, 2018 4:58 am

It may only be in 2.6

User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5172
Joined: Fri Dec 13, 2002 4:11 am
Location: [Redacted]
Contact:

Re: OnCap function for worldWeapons-ServerShots

Post by JeffM » Fri May 18, 2018 5:00 am

No it’s in the current 2.4.x, always check the current code.

User avatar
Zehra
Private First Class
Private First Class
Posts: 433
Joined: Sun Oct 18, 2015 3:36 pm
Location: Arctic
Contact:

Re: OnCap function for worldWeapons-ServerShots

Post by Zehra » Fri May 18, 2018 10:32 pm

Thanks JeffM.

I'll be using the latest API from now on.

bzfsAPI.h

Code: Select all

// game type info
BZF_API bz_eGameType bz_getGameType ( void );
BZF_API bool bz_triggerFlagCapture(int playerID, bz_eTeamType teamCapping, bz_eTeamType teamCapped);
Note: 2.4.12 or above is required to run any plug-in with the bz_triggerFlagCapture function.
I still have to see if it triggers world weapons though.

-Zehra
Last edited by allejo on Sun May 20, 2018 5:58 am, edited 1 time in total.
Reason: Stop with the small font sizes
There's this game I love and it's called Ducati. ~Zehra
Those who are critical of me, I'll likely be the same of them. ~Zehra
There's always something to remember and it's been a game I love. ~Zehra
The time spent is a time which can never be regained, so it's a time to enjoy. ~Zehra
The decisions we make are the ones we look forward too and the ones we regret. ~Zehra
The details and the skill of knowing and applying them is what excellence is made of. ~Zehra
The best player is the one who knows what to do and when and applies it successfully. ~Zehra
There's a difference between knowing my name and knowing me, one shows respect to my name and the other is to who I am. ~Zehra
My blog is available at zehrahblog.wordpress.com.
See when I've last been active at Strayers.

User avatar
allejo
Breaker of Builds
Breaker of Builds
Posts: 721
Joined: Sun Feb 17, 2008 10:01 pm
Location: /dev/null
Contact:

Re: OnCap function for worldWeapons-ServerShots

Post by allejo » Mon May 21, 2018 3:44 am

bz_triggerFlagCapture calls the internal bzfs function which is used whenever a flag capture happens regularly, meaning a flag capture event is fired. The onCap world weapons listen to the flag capture event, so unless the current code is broken, it'll trigger the world weapons.

Keep in mind, this function will destroy all of the tanks and modify team scores as dictated. It won't *just* fire off onCap world weapons.
Here's my personal website and my open source projects are available on GitHub; I work on a lot of cool things.

Image

User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5172
Joined: Fri Dec 13, 2002 4:11 am
Location: [Redacted]
Contact:

Re: OnCap function for worldWeapons-ServerShots

Post by JeffM » Mon May 21, 2018 3:54 am

Yeah it's intended to do ALL the capture things, in order to properly support custom capture conditions.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests