[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_content.php on line 1014: Undefined array key 3
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_content.php on line 1014: Undefined array key 3
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_content.php on line 1014: Undefined array key 3
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_content.php on line 1014: Undefined array key 3
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_content.php on line 1014: Undefined array key 3
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_content.php on line 1014: Undefined array key 3
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_content.php on line 1014: Undefined array key 3
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4130: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3009)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4130: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3009)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4130: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3009)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4130: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3009)
Battlezone Forums • obj/effect mask questions
Page 1 of 2

obj/effect mask questions

Posted: Sun Jun 10, 2012 12:18 am
by S.cavA.rmyG.en
I am trying to make a new building limet system that will only let you build in range of a radent power sorce.
my idea is to have a suply feild that you can see and a damge feild that you can't see masked to the buildings keeping the player from building base buildings out side of the feild.

it should work as long as the system stays blanced but I am not sure how how the odf flages for the service mask work. becouse I have never seen it used before so I now ask for some help from those of you with a basic understanding of obj/effect masking.

I know how to build the damage feild and make it only target buildings and for that matter only the buildings I want it to but I have next to no idea of how to get the service bay to work.

Re: obj/effect mask questions

Posted: Sun Jun 10, 2012 12:30 am
by General BlackDragon
Well thats a horrible way to do it. A damage field won't stop the player from building outside of it.

They'll just waste scrap building out of it and get mad and rage quit....


But alas....


You want ServiceMasks....

And it'd be better to have the buildings simply do addHealth = -#. so they slowly die. Then make sure the service thingy services parallel and does == the damage self done, or more if u want them to slowly heal.

Then, just make sure the servicemask in gameobjectclass matches the one in the sbay under servicemask.

Relevant changelog entries:

Code: Select all


[SupplyDepotClass]
SupplyDepotClassServiceMask = 0
SupplyDepotClassServiceMatch = 0
SupplyDepotClassServiceProvides = 0

[GameObjectClass]
GameObjectClassServiceMask = 0
GameObjectClassServiceMatch = 0
GameObjectClassServiceProvides = 0;

   Does the same as the scav/scrap/deposit mask/match/provides as
above.  The first check is done when a person is trying to get into an
empty craft. The second is done when a powerup's hitting an
object. This is about it for what I want to do with these things. It's
a LOT of copy/paste stuff that's pretty boring to do. [NM]
Scavenger mask descriptions (I believe this is the longest changelog entry):

Code: Select all

- Fix for mantis #1521 and #509. Added

[DepositClass]
DepositClassMask = 0
DepositClassMatch = 0
DepositClassProvides = 0

[ScrapClass]
ScrapClassMask = 0
ScrapClassMatch = 0
ScrapClassProvides = 0

[ScavengerHClass] or [ScavengerClass]
ScavClassMask = 0
ScavClassMatch = 0
ScavClassProvides = 0

   These are bitmasks. A pool (deposit) can be selected if, for a
given scav+deposit pair, (ScavClassProvides & [i.e. bitwise and]
DepositClassMask) == DepositClassMatch, and (DepositClassProvides &
ScavClassMask) == ScavClassMatch. Scrap is the same type of match. The
defaults are 0 for mask & match, making existing items all work. But,
if you start setting bits to 1, you can restrict what they match. As
scav masks are used for both deposits & scrap, then you may want to
use bits 0..15 (1..32768) for deposits, and 16..31 (65536 and up) for
scrap matches.

-- Extra expanation #1:

   For example, if a pool wants to restrict access, it could do something
like DepositClassMask = 1, DepositClassMatch = 1. That will remove
access from all scavs, by default, until the scav adds
ScavClassProvides = 1 (or any provides with bit 1 set).

   Alternatively, you could do the matching on the scav. You could do
ScavClassMask = 1, ScavClassMatch = 1. That'd restrict all pools until
the pool puts in DepositClassProvides = 1 (or any provides with bit 1
set).

   Basically, the (SourceProvides & DestMask) must == DestMatch. Note,
if both sides do matching, then it must work symmetrically.

-- Extra explanation #2

   Note: this has *nothing* to do with any race mask/typemasks used
elsewhere. This is a completely new system. If you're not familiar
with binary math, you should probably use Windows's calculator, and
put it into View -> Scientific mode to enable the option to show
binary mode, ANDing, etc. For example, if you have binary value 10110,
you should convert that to decimal mode and get 22, the value to enter
in the ODF. You can also test out ANDing by entering 10110, then press
the 'And' button, and and with 11111, and you'll end up with 10110.
(Anding simply means that for each bit, if both bits are 1 in the
inputs, it'll be 1 in the output. If either (or both) bits are 0 in
the inputs, the result is 0.

   If you're working on restricting access, then you should start off
with the Match param, and work backwards. The default match is 0, and
so you want a combination of Provides AND Mask that equal zero. Note
that the default mask is also 0, so by the rules of binary math,
anything in provides ANDed with Mask 0 equals 0. So, access is
granted. 

   If, for example, you decided to set Match to 1, but left Mask at 0,
then it will *always fail*. Why? Because, as above, anything anded
with Mask 0 results in 0, but you're matching 0 against 1. Won't work.
Unless you're aiming for permanent "never match" state, then any bit
set in match must also be set in the mask.

   Bit #1 is decimal value 1. So, if you want to restrict pools, as
above, you could set DepositClassMask = 1, DepositClassMatch = 1. That
will remove access from all scavs, by default, until the scav adds
ScavClassProvides = 1. Or, ScavClassProvides = 3 (binary 11),
ScavClassProvides = 5 (binary 101). 

   Another pool could set bit 2 (decimal value 2) DepositClassMask =
2, DepositClassMatch = 2.  That'd prevent default scavs
(ScavClassProvides = 0) from deploying. And, it'll prevent
ScavClassProvides = 1 from working. But, ScavClassProvides = 2 and = 3
will work, because both have bit 2 set.

   Another pool could set bit 3 (decimal value 4) DepositClassMask =
4, DepositClassMatch = 4.  That'd prevent default scavs
(ScavClassProvides = 0) from deploying. And, it'll prevent
ScavClassProvides = 1 from working. But, ScavClassProvides = 4 and = 5
will work, because both have bit 3 set.

   The three examples above restrict based on a single bit being set.
You could also combine bits the same way.


--

   Compiles, but only minimal testing done. [NM]

Simple Explination: Bitmasks

Calculator > program/scientific mode > bin > #####.

If the numbers for match and provides match, it'll service.

Lets only pay attention to 3 bits to explain how it works...

0 = 000
1 = 001
2 = 010
3 = 011
4 = 100
5 = 101
6 = 110
7 = 111

Aligned vertically, each column acts as a separate servicing channel. Something servicing only 1 column will only service that column if the number in the ServiceBay match matches the GameObjectClass's provides. It also can check based on gameObject Match matching the ServiceBay's Provide.

Sooo, you can pretty much filter your head off all you want. I hope this helped...

Re: obj/effect mask questions

Posted: Sun Jun 10, 2012 2:52 am
by MrTwosheds
This all seems rather complicated to me, why not just use the normal "you can build next to this building or not" code. Causing constant damage/healing will, if I am not mistaken, cause a constant exchange of that info between mp users adding an undesirable overhead to communications in MP, the more stuff you build the worse it will get.

Re: obj/effect mask questions

Posted: Sun Jun 10, 2012 5:28 am
by S.cavA.rmyG.en
MrTwosheds wrote:This all seems rather complicated to me, why not just use the normal "you can build next to this building or not" code. Causing constant damage/healing will, if I am not mistaken, cause a constant exchange of that info between mp users adding an undesirable overhead to communications in MP, the more stuff you build the worse it will get.
1. yes the masking system is complicated I wish there was a better way of faking this but there is not that I know of so this is what I am trying. the race I am trying for is some thing like the protos from start craft using the can build next to settings dos do what I want at all. I want them to be able to build any were in range of one of the power plaints even on less then flat ground.
2. I don't think the healing will lag MP any more then the units moving and it constantly sending that data to all the players.
3. thank you once agen General for helping.
4.
And it'd be better to have the buildings simply do addHealth = -#. so they slowly die. Then make sure the service thingy services parallel and does == the damage self done, or more if u want them to slowly heal.
I did not know that would work that way well it saves me building 2 or 3 other odfs so grate hmmm I mite not need to mask all of the base buildings then but some of them will still need it.

Re: obj/effect mask questions

Posted: Sun Jun 10, 2012 5:45 am
by Zax
Until they cheat with service trucks.

Re: obj/effect mask questions

Posted: Sun Jun 10, 2012 7:32 am
by General BlackDragon
The service types can be used, so setting a servicebay to service only buildings would be 80% effective.

the other 20% is Gun Towers. These are craft, so they wont get healed. You'd need to use the mask to make the thing heal gun towers without healing ships.

Re: obj/effect mask questions

Posted: Mon Jun 11, 2012 10:09 pm
by S.cavA.rmyG.en
Zax wrote:Until they cheat with service trucks.
not a problem the trucks will be masked so they are only be able to sercice other units and power plants.
so they will still be useful for helping units but will not be a way to cheat also the REC will be one of the power plants.

Re: obj/effect mask questions

Posted: Mon Jun 11, 2012 10:28 pm
by S.cavA.rmyG.en
General BlackDragon wrote:The service types can be used, so setting a servicebay to service only buildings would be 80% effective.

the other 20% is Gun Towers. These are craft, so they wont get healed. You'd need to use the mask to make the thing heal gun towers without healing ships.
so that was what I was doing wrong I all ways think of GTs as buildings.

Re: obj/effect mask questions

Posted: Mon Jun 11, 2012 10:50 pm
by Ded10c
GTs are coded as vehicles; look at the radar, for example. Buildings show up as squares, craft as circles... gun towers are circles.

Re: obj/effect mask questions

Posted: Tue Jun 12, 2012 6:13 am
by Zero Angel
A simple thing to try would be to 'tap' the guntower into the collision object of an i76building or something. Because the i76building is a proper building, it will be susceptible to the same servicing effects that other buildings get. If AI tries to attack the GT (which doesnt naturally degenerate), they hit the i76building, if the i76building dies then it will take the GT down with it (since it the GT is tapped to it)

Re: obj/effect mask questions

Posted: Tue Jun 12, 2012 3:58 pm
by S.cavA.rmyG.en
Zero Angel wrote:A simple thing to try would be to 'tap' the guntower into the collision object of an i76building or something. Because the i76building is a proper building, it will be susceptible to the same servicing effects that other buildings get. If AI tries to attack the GT (which doesnt naturally degenerate), they hit the i76building, if the i76building dies then it will take the GT down with it (since it the GT is tapped to it)
that or I could make them mine based and use the service other tag.
one problem the ai don't understand that they should kill the base of those GTs.
they just fire at the taps but I don't see why not here becouse this is more of a player based system any way.

Re: obj/effect mask questions

Posted: Tue Jun 12, 2012 4:16 pm
by S.cavA.rmyG.en
new thing I found when I was testing the service bays will self service so I will have to make them in to service trucks.
which just makes some small things diffent they will be Hservice tucks I can keep all of the setings form before I can make them fly but I will need to make it so you can't tug them and I will need to add "serviceTruckAutoHeal = 1"to the 4 main building ODFs.

Re: obj/effect mask questions

Posted: Tue Jun 12, 2012 5:59 pm
by General BlackDragon
OR u could mask the service bay so it doesn't match it's own mask...

Re: obj/effect mask questions

Posted: Tue Jun 12, 2012 7:44 pm
by Zero Angel
Just use a negative addHealth value to offset some of their self-heal. That's what I would do with all the buildings in fact.

Re: obj/effect mask questions

Posted: Wed Jun 13, 2012 6:35 am
by S.cavA.rmyG.en
Zero Angel wrote:Just use a negative addHealth value to offset some of their self-heal. That's what I would do with all the buildings in fact.
not that simple as in I can not get the bays toservice more then one building at a time I am sure there is a setting for this some were but can't for the life of me rember where.
but I have a idea to try and thats the taegeting settings for Motion Sensor Class.