Battlezone Universe

Battlezone Universe => Archive Vault => Public 1.3 Beta 4 Archive => Topic started by: bigbadbogie on October 18, 2008, 02:35:27 AM

Title: Auto-align problem
Post by: bigbadbogie on October 18, 2008, 02:35:27 AM
Not really a glitch, but for some reason when any gun-tower with no baseplate is placed somewhere on a map, it automatically aligns/centres itself with the terrain.

I am just wondering if there is a way to turn it off as it is causing an object to be realigned when replaced by dll.
Title: Re: Auto-align problem
Post by: GreenHeart on October 18, 2008, 05:16:55 AM
The alignment code was replaced in 1.3.  I think you might be able to get around it by using one of these. 

ownsTerrain = 0
IsTerrain = 0


The alignment code goes by the bounding box of the entire model so you could add a polygon face that is scaled extremely small so the human eye can't see it.    This could change the bounding box in such away that the center of the bounding box is where you want the object to be auto aligned.    For examples go download the xsi for the 1.3 & check out the tunnel sections to see what i mean.   I'm not sure why ken changed the alignment code.  The __h  or hp_ flags don't get included in the bounding box creation so adding the extremely small face is the only way if the odf flags don't work.


Title: Re: Auto-align problem
Post by: bigbadbogie on October 18, 2008, 08:14:35 AM
ownsTerrain = 0 removes the collision.
IsTerrain = 0 does nothing.

I don't want the object to auto-align at all.

Regular objects such as powered class, commbunker, i76building do not auto-align, but are impractical due to another glitch caused by moving buildings at high speed with dll; they tend to vanish out of thin air.

I need it to be a gun-tower and I need it to not auto-align with the terrain.
Title: Re: Auto-align problem
Post by: Nielk1 on October 18, 2008, 04:04:30 PM
Oh so you are trying to place it freely but it is locking to the grid anyway? I thought any class lacking a terrain__h could be freely placed in the editor but forced to align if made by a constructor. (IE jammers)
Title: Re: Auto-align problem
Post by: General BlackDragon on October 18, 2008, 05:14:38 PM
[GameObjectClass]
AlignTerrainReplaceType = 0

   Possible values are 0..4. They break down as following:
0: Should be same as pb4
1: Uses new centering code from 69q, but alternate offset
2: Closer calculations to 69n4, same offset as 0
3: Closer calculations to 69n4, same offset as 1
4: Closer calculations to 69n4, another offset type.

   I'm not sure if any of these values produces the desired results.
Please test. If none of the flags give the desired results, please be
*as specific as possible*. Also, do check that objects build at the
same place the preview images show. [NM]

??
Title: Re: Auto-align problem
Post by: Avatar on October 18, 2008, 08:04:02 PM
Guntowers are strange animals to begin with, as they're vehicles pretending to be buildings...  but then that's a BZ tradition...  :)   

I think the answer here is going to be 'no'...  because it sounds like you're placing and aligning an object somewhere specific in the editor and then replacing it via DLL and the DLL is somewhat more limited in this respect.  It has it's own set of rules and auto-alignment for terrain owning buildings is one of them.

I think the best bet is to create the initial object already offset by linking it to a dummy object that's centered on a terrain square, and then making sure you're grabbing the rotation of the original building as well as position for replacement.  I've had to make many such 'specialty' objects to get certain ideas to work.  (Bomber Bays, for instance.)
Title: Re: Auto-align problem
Post by: Nielk1 on October 18, 2008, 08:19:03 PM
If the DLL is replacing it, store its position matrix, replace it, then move it to that position matrix. As long as there is no terrain plate it won't cause any terrain tearing.
Title: Re: Auto-align problem
Post by: bigbadbogie on October 18, 2008, 08:30:22 PM
That makes it visually jolt back N1.

GBD - they only change the direction that it aligns to.

I can't see any way around this other than a pb4b bug fix. (Just a little bit unlikely.)
Title: Re: Auto-align problem
Post by: TheJamsh on October 18, 2008, 10:41:09 PM
remember that if you want to do that, you wont be able to put a terminal that works on the thing. itll be there, but you wont be able to 'access it' thats for owning buildings only...

make a transparent baseplate and 'tap' the gun tower to it?
Title: Re: Auto-align problem
Post by: Nielk1 on October 19, 2008, 03:32:39 AM
I know in C++ it won't jump back because I can move the object in the same execution step it is created.
Title: Re: Auto-align problem
Post by: bigbadbogie on October 19, 2008, 04:30:50 AM
*grumbles to himself*
Title: Re: Auto-align problem
Post by: OvermindDL1 on October 19, 2008, 05:07:19 AM
Quote from: bigbadbogie on October 18, 2008, 08:30:22 PM
That makes it visually jolt back N1.
Only in the scriptor, not in C++ (or python), use C++ (or python).

You could probably also turn up the amount of lines executed per tick in the scriptor...
(http://www.overminddl1.com/image_scripts/image_sig.php?type=ODL1signitures&image/sig.gif)
Generated by OvermindDL1's Signature Auto-Add Script (http://overminddl1.com) via GreaseMonkey (http://greasemonkey.mozdev.org/)

Title: Re: Auto-align problem
Post by: bigbadbogie on October 19, 2008, 05:45:10 AM
It doesn't matter anymore. I found another way to do it without a gun-tower class.
Title: Re: Auto-align problem
Post by: TheJamsh on October 19, 2008, 10:36:00 AM
job done... care to say exactly what you were doing?
Title: Re: Auto-align problem
Post by: General BlackDragon on October 19, 2008, 02:39:25 PM
spawn and replace both with DLL via a pathpoint?
Title: Re: Auto-align problem
Post by: GreenHeart on October 19, 2008, 06:24:08 PM
He could have just modified the model so no dll work OR special odf tricks would be needed.  Re-Read my first post to find out what i'm talking about.
Title: Re: Auto-align problem
Post by: bigbadbogie on October 19, 2008, 08:36:24 PM
Quote from: TheJamsh on October 19, 2008, 10:36:00 AM
job done... care to say exactly what you were doing?

Is a supwize.