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: 721
Joined: Sun Oct 18, 2015 3:36 pm
Location: Arctic
Contact:

OnCap function for worldWeapons-ServerShots

Post by Zehra »

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
Those who are critical of me, I'll likely be the same of them. ~Zehra
The decisions we make are the ones we look forward too and the ones we regret. ~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

See where I've last been active at Strayers.
Visit BZList.net for a modern HTML5 server stats site.

Click here to view the 101 Leaderboard & Score Summaries Last updated 2020-09-15 (YYYY-MM-DD)
Latest 101 thread
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5193
Joined: Fri Dec 13, 2002 4:11 am
Location: https://github.com/OmniTanks
Contact:

Re: OnCap function for worldWeapons-ServerShots

Post by JeffM »

bz_triggerFlagCapture should already do that.
ImageJeffM
User avatar
Zehra
Private First Class
Private First Class
Posts: 721
Joined: Sun Oct 18, 2015 3:36 pm
Location: Arctic
Contact:

Re: OnCap function for worldWeapons-ServerShots

Post by Zehra »

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
Those who are critical of me, I'll likely be the same of them. ~Zehra
The decisions we make are the ones we look forward too and the ones we regret. ~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

See where I've last been active at Strayers.
Visit BZList.net for a modern HTML5 server stats site.

Click here to view the 101 Leaderboard & Score Summaries Last updated 2020-09-15 (YYYY-MM-DD)
Latest 101 thread
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5193
Joined: Fri Dec 13, 2002 4:11 am
Location: https://github.com/OmniTanks
Contact:

Re: OnCap function for worldWeapons-ServerShots

Post by JeffM »

It may only be in 2.6
ImageJeffM
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5193
Joined: Fri Dec 13, 2002 4:11 am
Location: https://github.com/OmniTanks
Contact:

Re: OnCap function for worldWeapons-ServerShots

Post by JeffM »

No it’s in the current 2.4.x, always check the current code.
ImageJeffM
User avatar
Zehra
Private First Class
Private First Class
Posts: 721
Joined: Sun Oct 18, 2015 3:36 pm
Location: Arctic
Contact:

Re: OnCap function for worldWeapons-ServerShots

Post by Zehra »

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
Those who are critical of me, I'll likely be the same of them. ~Zehra
The decisions we make are the ones we look forward too and the ones we regret. ~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

See where I've last been active at Strayers.
Visit BZList.net for a modern HTML5 server stats site.

Click here to view the 101 Leaderboard & Score Summaries Last updated 2020-09-15 (YYYY-MM-DD)
Latest 101 thread
User avatar
allejo
Breaker of Builds
Breaker of Builds
Posts: 784
Joined: Sun Feb 17, 2008 10:01 pm
Location: /dev/null
Contact:

Re: OnCap function for worldWeapons-ServerShots

Post by allejo »

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.
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5193
Joined: Fri Dec 13, 2002 4:11 am
Location: https://github.com/OmniTanks
Contact:

Re: OnCap function for worldWeapons-ServerShots

Post by JeffM »

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