Stay Out Areas for a certain team

Questions and answers about the how and why of making maps.
Post Reply
happyhad
Private First Class
Private First Class
Posts: 18
Joined: Wed Oct 21, 2015 7:58 pm

Stay Out Areas for a certain team

Post by happyhad »

I know that there is a way to a make a mine by using a zone and physics.
But is there a way to make it so that it only effects certain teams?
So a mine will blow up Red players but not Green?

I basically want to make stay out areas, where one team is allowed in an area and another is not.

A separate question. Is there a way to define an area where you have a flag power and when you leave you drop it.
Example in this area you can shoot lazer but when you leave you loose that power


Thanks
User avatar
Zehra
Private First Class
Private First Class
Posts: 914
Joined: Sun Oct 18, 2015 3:36 pm
Location: Within the BZFS API and Beyond it
Contact:

Re: Stay Out Areas for a certain team

Post by Zehra »

happyhad wrote: Wed Jan 24, 2018 6:08 pm I know that there is a way to a make a mine by using a zone and physics.
But is there a way to make it so that it only effects certain teams?
So a mine will blow up Red players but not Green?
This could probably be done with a modification to the 'wwzone' plug-in.
Some checks would be needed for teams and some options added too, but it probably wouldn't be too complicated.(I'm assuming.)
happyhad wrote: Wed Jan 24, 2018 6:08 pm Is there a way to define an area where you have a flag power and when you leave you drop it.
Example in this area you can shoot lazer but when you leave you loose that power
This can be done using the 'flagStay' plug-in.
From the README on GitHub:

Code: Select all

BZFlag Server Plugin: flagStay
================================================================================

The flagStay plugin adds a custom map object that allows you to prevent
specific flags from leaving a defined area (either rectangular or circular).


Loading the plugin
--------------------------------------------------------------------------------

This plugin takes no optional arguments, so load it with:

  -loadplugin flagStay


Map Objects
--------------------------------------------------------------------------------

The plugin adds a 'flagstayzone' object type.  You will specify this when
creating a custom zone.  Both zone shapes will use a 'pos' (position),
'message', and one or more 'flag' attributes.  The rectangular type will use a
'size' and 'rot' (rotation) attribute, and the circular type will use a 'radius'
and 'height' attribute.  This plugin would almost always be used in combination
with a normal 'zone' object that would spawn flags in a specific area using the
'zoneflag' attribute.

# Here's an example of a rectangular zone that prevents GM and L from leaving a
# tower area.

# Spawn 5 GM, 5 L, and 1 G flags on the tower.
zone
  pos 0 0 40
  size 10 10 1
  zoneflag GM 5
  zoneflag L 5
  zoneflag G 1
end

# Keep GM and L within the tower.
flagstayzone
  pos 0 0 40
  size 10 10 10
  rot 45
  message "You can't leave the tower with that flag!"
  flag GM
  flag L
end


# Here's an example of a circular flagstay zone that keeps a machine gun flag in
# a defined area.

# Spawn an MG flag at 80 0 0 within a 1 by 1 area.
zone
  pos 80 0 0
  size 1 1 1
  zoneflag MG 1
end

# Keep it within a 5 unit radius of the center.
flagstayzone
  pos 80 0 0
  radius 5
  height 10
  message "The MG can't leave the turret area"
  flag MG
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 2021-01-12 (YYYY-MM-DD)
Latest 101 thread
happyhad
Private First Class
Private First Class
Posts: 18
Joined: Wed Oct 21, 2015 7:58 pm

Re: Stay Out Areas for a certain team

Post by happyhad »

Very good!

Thanks!
User avatar
optic delusion
Special Forces
Special Forces
Posts: 1052
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Re: Stay Out Areas for a certain team

Post by optic delusion »

The King of the Hill (KOTH) plugin also springs to mind.
I am very skeptical that you will be able to get any world weapon to do team checks, but the only reason I say that is.... If it was possible someone would have already done it. But having said that... I can't remember anyone WANTING to do that, I don't think it's ever been tried.
Take a look at my Defender game mode concept.

Thinking is not an automatic process. A man can choose to think or to let his mind stagnate, or he can choose actively to turn against his intelligence, to evade his knowledge, to subvert his reason. If he refuses to think, he courts disaster: he cannot with impunity reject his means of perceiving reality.
Post Reply