Home » MODDING HQ 1.13 » v1.13 Idea Incubation Lab » A Small Compilation of New Features
Re: A Small Compilation of New Features[message #316949]
|
Wed, 03 April 2013 00:24 ![Go to previous message Go to previous message](/theme/Bear_Classic_Brown/images/up.png)
|
|
merc05 |
![](/images/ranks/corporal_1stclass.png) |
Messages:90
Registered:January 2013 |
|
|
At the end of Handle UI.cpp file is a block called BOOLEAN IsValidJumpLocation( SOLDIERTYPE *pSoldier, INT32 sGridNo, BOOLEAN fCheckForPath )
There is a line at 6924 and another at 7057 that checks whether Shift+Ctrl are pressed.
This is the code from my disk where I have changed this to Alt (original code after "//")
// This function contains the logic for allowing the player
// to jump over people.
BOOLEAN IsValidJumpLocation( SOLDIERTYPE *pSoldier, INT32 sGridNo, BOOLEAN fCheckForPath )
{
// SANDRO: been here, did mess
INT32 sFourGrids[4], sDistance=0, sSpot, sInBetween, sInBetween2, iDoorGridNo;
static const UINT8 sDirs[4] = { NORTH, EAST, SOUTH, WEST };
//INT32 cnt;
UINT8 ubGuyThere, ubMovementCost, ubDirection;
INT8 bTileHeight = 0;
// SANDRO: commented out to allow jumping even in cases we could get to the destination normally
// First check that action point cost is zero so far
// ie: NO PATH!
/*if ( gsCurrentActionPoints != 0 && fCheckForPath )
{
return( FALSE );
}*/
// Loop through positions...
for (INT8 cnt = 0; cnt < 4; cnt++)
{
// MOVE OUT TWO DIRECTIONS
sInBetween = NewGridNo( sGridNo, DirectionInc( sDirs[ cnt ] ) );
// SANDRO: moved this someplace else and made it more fluid
// ATE: Check our movement costs for going through walls!
/*ubMovementCost = gubWorldMovementCosts[ sIntSpot ][ sDirs[ cnt ] ][ pSoldier->pathing.bLevel ];
if ( IS_TRAVELCOST_DOOR( ubMovementCost ) )
{
ubMovementCost = DoorTravelCost( pSoldier, sIntSpot, ubMovementCost, (BOOLEAN) (pSoldier->bTeam == gbPlayerNum), &iDoorGridNo );
}*/
// If we have hit an obstacle, STOP HERE
//if ( ubMovementCost >= TRAVELCOST_BLOCKED )
//{
// // no good, continue
// continue;
//}
// TWICE AS FAR!
sFourGrids[cnt] = sSpot = NewGridNo( sInBetween, DirectionInc( sDirs[ cnt ] ) );
// Is the soldier we're looking at here?
ubGuyThere = WhoIsThere2( sSpot, pSoldier->pathing.bLevel );
// Alright folks, here we are!
if ( ubGuyThere == pSoldier->ubID )
{
// Double check OK destination......
if ( NewOKDestination( pSoldier, sGridNo, TRUE, (INT8)gsInterfaceLevel ) && IsLocationSittable( sGridNo, pSoldier->pathing.bLevel ) )
{
// If the soldier in the middle of doing stuff?
if ( !pSoldier->flags.fTurningUntilDone )
{
// OK, NOW check if there is a guy in between us
//
// SANDRO: made this a bit different - if we hold down the shift key, and pointing at a spot 2 tiles away, we check if jumping
// there is possible for all cases, and if it is, then we juuuuumpppp!
// So we don't care if there is a guy on the ground there, and the cursor wont appear atutomatically anymore
//
//ubGuyThere = WhoIsThere2( sIntSpot, pSoldier->pathing.bLevel );
// Is there a guy and is he prone?
//if ( ubGuyThere != NOBODY && ubGuyThere != pSoldier->ubID && gAnimControl[ MercPtrs[ ubGuyThere ]->usAnimState ].ubHeight == ANIM_PRONE )
//{
// // It's a GO!
// return( TRUE );
//}
//else
// Can't jump from a water tile (but we can jumpt TO a water tile)
if ( pSoldier->MercInWater() )
{
return( FALSE );
}
// check for cliffs and similar oddities
if ( gpWorldLevelData[ sGridNo ].sHeight != gpWorldLevelData[ sSpot ].sHeight )
{
return( FALSE );
}
// If there's a guy here, and he's not prone, we can't jump over him (maybe the way we hop over fence when he's crouched? lol)
ubGuyThere = WhoIsThere2( sInBetween, pSoldier->pathing.bLevel );
if ( ubGuyThere != NOBODY && ubGuyThere != pSoldier->ubID )
{
if ( gAnimControl[ MercPtrs[ ubGuyThere ]->usAnimState ].ubHeight != ANIM_PRONE )
{
return( FALSE );
}
else if ( gsCurrentActionPoints == 0 || !fCheckForPath )
{
return( TRUE );
}
}
// Get the height of stuff on the tile, we can only jump over low obstacles like this
bTileHeight = GetTallestStructureHeight( sInBetween, pSoldier->pathing.bLevel );
if ( bTileHeight > 0 && !IsLocationSittableExcludingPeople( sInBetween, pSoldier->pathing.bLevel ) && !( pSoldier->pathing.bLevel && FlatRoofAboveGridNo( sInBetween ) ))
{
return( FALSE );
}
// Check again for these structures as they may have odd height preset
if (( FindStructure( sInBetween, STRUCTURE_TREE ) != NULL || FindStructure( sInBetween, STRUCTURE_FENCE ) != NULL ||
FindStructure( sInBetween, STRUCTURE_WIREFENCE ) != NULL || FindStructure( sInBetween, STRUCTURE_VEHICLE ) != NULL ||
FindStructure( sInBetween, STRUCTURE_CAVEWALL ) != NULL ) && !IsLocationSittableExcludingPeople( sInBetween, pSoldier->pathing.bLevel ))
{
return( FALSE );
}
// Now check for walls between the tiles
// Between our tile and the middle tile...
ubDirection = GetDirectionToGridNoFromGridNo( sInBetween, pSoldier->sGridNo );
ubMovementCost = gubWorldMovementCosts[ pSoldier->sGridNo ][ ubDirection ][ pSoldier->pathing.bLevel ];
if ( IS_TRAVELCOST_DOOR( ubMovementCost ) )
{
ubMovementCost = DoorTravelCost( pSoldier, pSoldier->sGridNo, ubMovementCost, (BOOLEAN) (pSoldier->bTeam == gbPlayerNum), &iDoorGridNo );
}
if ( ubMovementCost >= TRAVELCOST_BLOCKED )
{
return( FALSE );
}
// Between destination tile and the middle tile...
ubDirection = GetDirectionToGridNoFromGridNo( sInBetween, sGridNo );
ubMovementCost = gubWorldMovementCosts[ sGridNo ][ ubDirection ][ pSoldier->pathing.bLevel ];
if ( IS_TRAVELCOST_DOOR( ubMovementCost ) )
{
ubMovementCost = DoorTravelCost( pSoldier, sGridNo, ubMovementCost, (BOOLEAN) (pSoldier->bTeam == gbPlayerNum), &iDoorGridNo );
}
if ( ubMovementCost >= TRAVELCOST_BLOCKED )
{
return( FALSE );
}
if( !(_KeyDown( SHIFT ) && _KeyDown( ALT )) ) //if( !(_KeyDown( SHIFT ) && _KeyDown( CTRL )) )
{
return( FALSE );
}
// If we got here, we are good to go
return ( TRUE );
}
}
}
// Attempt to long jump
else
{
// 3 TILES FAR!
sInBetween2 = sSpot;
sSpot = NewGridNo( sInBetween2, DirectionInc( sDirs[ cnt ] ) );
// Is the soldier we're looking at here?
ubGuyThere = WhoIsThere2( sSpot, pSoldier->pathing.bLevel );
// Alright folks, here we are!
if ( ubGuyThere == pSoldier->ubID )
{
// Double check OK destination......
if ( NewOKDestination( pSoldier, sGridNo, TRUE, (INT8)gsInterfaceLevel ) && IsLocationSittable( sGridNo, pSoldier->pathing.bLevel ) )
{
// If the soldier in the middle of doing stuff?
if ( !pSoldier->flags.fTurningUntilDone )
{
// Can't jump from a water tile (but we can jumpt TO a water tile)
if ( pSoldier->MercInWater() )
{
return( FALSE );
}
// This ain't gonna happen with backpack
if((UsingNewInventorySystem() == true) && FindBackpackOnSoldier( pSoldier ) != ITEM_NOT_FOUND )
{
return( FALSE );
}
// check for cliffs and similar oddities
if ( gpWorldLevelData[ sGridNo ].sHeight != gpWorldLevelData[ sSpot ].sHeight )
{
return( FALSE );
}
// If there's a guy on any of the two middle tiles, and he's not prone, we can't jump over him
ubGuyThere = WhoIsThere2( sInBetween, pSoldier->pathing.bLevel );
if ( ubGuyThere != NOBODY && ubGuyThere != pSoldier->ubID && gAnimControl[ MercPtrs[ ubGuyThere ]->usAnimState ].ubHeight != ANIM_PRONE )
{
return( FALSE );
}
ubGuyThere = WhoIsThere2( sInBetween2, pSoldier->pathing.bLevel );
if ( ubGuyThere != NOBODY && ubGuyThere != pSoldier->ubID && gAnimControl[ MercPtrs[ ubGuyThere ]->usAnimState ].ubHeight != ANIM_PRONE )
{
return( FALSE );
}
// Get the height of stuff on both middle tiles, we can only jump over low obstacles
bTileHeight = GetTallestStructureHeight( sInBetween, pSoldier->pathing.bLevel );
if ( bTileHeight > 0 && !IsLocationSittableExcludingPeople( sInBetween, pSoldier->pathing.bLevel ) && !( pSoldier->pathing.bLevel && FlatRoofAboveGridNo( sInBetween ) ))
{
return( FALSE );
}
bTileHeight = GetTallestStructureHeight( sInBetween2, pSoldier->pathing.bLevel );
if ( bTileHeight > 0 && !IsLocationSittableExcludingPeople( sInBetween2, pSoldier->pathing.bLevel ) && !( pSoldier->pathing.bLevel && FlatRoofAboveGridNo( sInBetween2 ) ))
{
return( FALSE );
}
// Check again for these structures as they may have odd height preset
if (( FindStructure( sInBetween, STRUCTURE_TREE ) != NULL || FindStructure( sInBetween, STRUCTURE_FENCE ) != NULL ||
FindStructure( sInBetween, STRUCTURE_WIREFENCE ) != NULL || FindStructure( sInBetween, STRUCTURE_VEHICLE ) != NULL ||
FindStructure( sInBetween, STRUCTURE_CAVEWALL ) != NULL ) && !IsLocationSittableExcludingPeople( sInBetween, pSoldier->pathing.bLevel ))
{
return( FALSE );
}
if (( FindStructure( sInBetween2, STRUCTURE_TREE ) != NULL || FindStructure( sInBetween2, STRUCTURE_FENCE ) != NULL ||
FindStructure( sInBetween2, STRUCTURE_WIREFENCE ) != NULL || FindStructure( sInBetween2, STRUCTURE_VEHICLE ) != NULL ||
FindStructure( sInBetween2, STRUCTURE_CAVEWALL ) != NULL ) && !IsLocationSittableExcludingPeople( sInBetween2, pSoldier->pathing.bLevel ))
{
return( FALSE );
}
// Now check for walls between the tiles
// Between our tile and the middle tile next to us...
ubDirection = GetDirectionToGridNoFromGridNo( sInBetween2, pSoldier->sGridNo );
ubMovementCost = gubWorldMovementCosts[ pSoldier->sGridNo ][ ubDirection ][ pSoldier->pathing.bLevel ];
if ( IS_TRAVELCOST_DOOR( ubMovementCost ) )
{
ubMovementCost = DoorTravelCost( pSoldier, pSoldier->sGridNo, ubMovementCost, (BOOLEAN) (pSoldier->bTeam == gbPlayerNum), &iDoorGridNo );
}
if ( ubMovementCost >= TRAVELCOST_BLOCKED )
{
return( FALSE );
}
// Between destination tile and the middle tile next to it...
ubDirection = GetDirectionToGridNoFromGridNo( sInBetween, sGridNo );
ubMovementCost = gubWorldMovementCosts[ sGridNo ][ ubDirection ][ pSoldier->pathing.bLevel ];
if ( IS_TRAVELCOST_DOOR( ubMovementCost ) )
{
ubMovementCost = DoorTravelCost( pSoldier, sGridNo, ubMovementCost, (BOOLEAN) (pSoldier->bTeam == gbPlayerNum), &iDoorGridNo );
}
if ( ubMovementCost >= TRAVELCOST_BLOCKED )
{
return( FALSE );
}
// Now we need to check if there is not a wall between the two middle tiles
ubDirection = GetDirectionToGridNoFromGridNo( sInBetween2, sInBetween );
switch (ubDirection)
{
case NORTH:
if ( WallOrClosedDoorExistsOfTopLeftOrientation( sInBetween ) )
return( FALSE );
break;
case EAST:
if ( WallOrClosedDoorExistsOfTopRightOrientation( sInBetween2 ) )
return( FALSE );
break;
case SOUTH:
if ( WallOrClosedDoorExistsOfTopLeftOrientation( sInBetween2 ) )
return( FALSE );
break;
case WEST:
if ( WallOrClosedDoorExistsOfTopRightOrientation( sInBetween ) )
return( FALSE );
break;
default:
return( FALSE );
break;
}
if( !(_KeyDown( SHIFT ) && _KeyDown( ALT )) ) //if( !(_KeyDown( SHIFT ) && _KeyDown( CTRL )) )
{
return( FALSE );
}
// If we got here, we are good to go
return ( TRUE );
}
}
}
}
}
return( FALSE );
}
Report message to a moderator
|
Corporal 1st Class
|
|
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
A Small Compilation of New Features
By: Sandro on Fri, 10 August 2012 01:01
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Sandro on Fri, 10 August 2012 01:02
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Slax on Fri, 10 August 2012 02:01
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Sandro on Fri, 10 August 2012 02:11
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: JMich on Fri, 10 August 2012 09:58
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: lockie on Fri, 10 August 2012 18:55
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Wil473 on Fri, 10 August 2012 19:58
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Flugente on Sat, 11 August 2012 15:47
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Sandro on Sat, 11 August 2012 21:53
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Sandro on Tue, 14 August 2012 01:11
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: madwolf on Wed, 15 August 2012 23:51
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: madwolf on Fri, 17 August 2012 11:12
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Sandro on Sun, 19 August 2012 19:28
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Wil473 on Mon, 20 August 2012 18:24
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Sandro on Tue, 13 November 2012 00:59
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: K0ukku on Mon, 26 November 2012 15:45
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: krux on Mon, 26 November 2012 16:56
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Uriens on Mon, 26 November 2012 17:22
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Sandro on Mon, 26 November 2012 19:09
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Hazapuza on Thu, 29 November 2012 16:00
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: RuiZiuR on Thu, 13 December 2012 23:26
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Sandro on Fri, 14 December 2012 01:25
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Clarkew on Fri, 14 December 2012 03:25
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Uriens on Fri, 14 December 2012 11:08
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Sandro on Fri, 14 December 2012 11:42
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Sandro on Mon, 17 December 2012 15:23
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Clarkew on Tue, 18 December 2012 02:42
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Flugente on Mon, 31 December 2012 19:12
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Sandro on Thu, 03 January 2013 18:09
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Flugente on Thu, 03 January 2013 18:43
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Sandro on Sun, 06 January 2013 17:16
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: krux on Mon, 07 January 2013 14:31
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Sandro on Sun, 20 January 2013 20:49
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: merc05 on Tue, 02 April 2013 16:11
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Flugente on Wed, 03 April 2013 00:00
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: merc05 on Wed, 03 April 2013 00:24
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Flugente on Wed, 03 April 2013 00:38
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: merc05 on Wed, 03 April 2013 14:28
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
By: Flugente on Wed, 03 April 2013 21:36
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
|
![Read Message Read Message](/theme/Bear_Classic_Brown/images/read.png) |
|
Re: A Small Compilation of New Features
|
Goto Forum:
Current Time: Sun Feb 16 01:20:04 GMT+2 2025
Total time taken to generate the page: 0.03760 seconds
|