• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Medium Priority Preventing walktrough buildings

@Levis: Remember how this update triggered random floating in various locations?
That may still be happening.... :rolleyes:
 
Just found this function:

Code:
CheckLocationPosition

It should check if the character is in a place it can be and return true or false.
So if I use this function I should be able to prevent you clipping trough things because of the collission detection.

edit: nevermind. misread stuff
 
That I've was probably added as an attempt to fix the sidestep.
It never worked. :(
 
Code:
  for(int i = 1; i<=MAXBUILDINGS; i++)
   {
    nr = i;
    attr = "building."+i+".building";
    if(CheckAttribute(lcn,attr) )
    {
  // load building locationattributes
    building = lcn.building.(nr).building;
    interior = lcn.building.(nr).interior;
    x = stf(lcn.building.(nr).x);
    y = stf(lcn.building.(nr).y);
    z = stf(lcn.building.(nr).z);
    ay = stf(lcn.building.(nr).ay);
    aigroup = lcn.building.(nr).aigroup;

  // buildinglike chr is set to stored pos
     string name = nr+"";
     lcn.building.(name).index = Build(nr, building, interior, x, y, z, ay, aigroup);
  }
@Levis: Don't you think "nr" and "name" there should be the same?
They're used in exactly the same way. o_O

How's this?
Code:
  for(int i = 1; i<=MAXBUILDINGS; i++)
   {
    nr = i+"";
    attr = "building."+i+".building";
    if(CheckAttribute(lcn,attr) )
    {
  // load building locationattributes
    building = lcn.building.(nr).building;
    interior = lcn.building.(nr).interior;
    x = stf(lcn.building.(nr).x);
    y = stf(lcn.building.(nr).y);
    z = stf(lcn.building.(nr).z);
    ay = stf(lcn.building.(nr).ay);
    aigroup = lcn.building.(nr).aigroup;

  // buildinglike chr is set to stored pos
     lcn.building.(nr).index = Build(nr, building, interior, x, y, z, ay, aigroup);
  }
 
@Pieter Boelen I don't remember from the top of my head but doesn't Build() require an int as first Argument?
If not then I'm okay with this :).
 
@Pieter Boelen I don't remember from the top of my head but doesn't Build() require an int as first Argument?
If not then I'm okay with this :).
But it's not an 'int': ;)
Code:
string nr;
[...]
// This performs the actual building process
int Build(string nr
 
Then I'm okay with it :), altough it shouldn't make any different it Looks better :p.
 
Could someone test this for me?
Place this file in PROGRAM\BUILDINGS
Then go to globals.c (in program) and set BUILDING_COLLISION to 1

Please let me know if anything weird happens. I think this should solve the weird floating at random moments.
 

Attachments

  • Colliders.c
    6.4 KB · Views: 157
Could someone test this for me?
Place this file in PROGRAM\BUILDINGS
Then go to globals.c (in program) and set BUILDING_COLLISION to 1

Please let me know if anything weird happens. I think this should solve the weird floating at random moments.

I'll check it out. This only affects player constructed buildings, correct?
 
Also the Windmill in the Guadeloupe jungle and the WIC Office in Willemstad port.
Those are good test cases to see if it works.

We've had weirdness from this before though, which at the time was seemingly quite random and could happen anywhere (such as in a Tavern).
 
Back
Top