You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Custom logics - collision properties and trooper alert sounds (#585)
* More custom logic options
- allow usage of the officer and trooper alert sounds
* Refactor - give correct names to CollisionInfo variables
stepUpHeight (formerly botOffset)
stepDownHeight (formerly yPos)
Rename ACTORCOL_BIT2 to ACTORCOL_SLIDE_RESPONSE
* Allow setting of step heights for custom logics
* Allow changing of the collision slide response flag
message_sendToSector(triggerSector, obj, 0, MSG_TRIGGER);// smart object will try to open a door or activate an elevator that it collides with
1498
1499
}
1499
1500
}
1500
1501
// Handles a single collision response + resolution step.
1501
-
if (moveMod->collisionFlags & ACTORCOL_BIT2)
1502
+
if (moveMod->collisionFlags & ACTORCOL_SLIDE_RESPONSE)
1502
1503
{
1503
1504
moveMod->collisionWall = wall;
1504
1505
dirX = physics->responseDir.x;
@@ -1509,17 +1510,18 @@ namespace TFE_DarkForces
1509
1510
}
1510
1511
}
1511
1512
1513
+
// Now handle passive movement - movement caused by being pushed, eg. by explosions or projectile impacts
1512
1514
// Apply the per-frame delta computed from the actor's velocity.
1513
1515
if (moveMod->delta.x | moveMod->delta.z)
1514
1516
{
1515
-
physics->flags |= 1;
1517
+
physics->flags |= COLINFO_INFINITE_DROP; // actor can be pushed off a cliff
1516
1518
physics->offsetX = moveMod->delta.x;
1517
1519
physics->offsetY = 0;
1518
1520
physics->offsetZ = moveMod->delta.z;
1519
1521
handleCollision(physics);
1520
1522
1521
1523
// Handles a single collision response + resolution step from velocity delta.
1522
-
if ((moveMod->collisionFlags & ACTORCOL_BIT2) && physics->responseStep)
1524
+
if ((moveMod->collisionFlags & ACTORCOL_SLIDE_RESPONSE) && physics->responseStep)
1523
1525
{
1524
1526
moveMod->collisionWall = physics->wall;
1525
1527
dirX = physics->responseDir.x;
@@ -1649,8 +1651,8 @@ namespace TFE_DarkForces
1649
1651
{
1650
1652
SecObject* obj = moveMod->header.obj;
1651
1653
1652
-
moveMod->physics.botOffset = 0x38000; // 3.5
1653
-
moveMod->physics.yPos = FIXED(4);
1654
+
moveMod->physics.stepUpHeight = 0x38000; // 3.5 units
1655
+
moveMod->physics.stepDownHeight = FIXED(4);// 4 units
1654
1656
moveMod->physics.height = obj->worldHeight;
1655
1657
moveMod->physics.width = obj->worldWidth;
1656
1658
moveMod->physics.responseStep = JFALSE;
@@ -1662,7 +1664,7 @@ namespace TFE_DarkForces
1662
1664
moveMod->collisionWall = nullptr;
1663
1665
moveMod->unused = 0;
1664
1666
1665
-
moveMod->collisionFlags = (moveMod->collisionFlags | (ACTORCOL_NO_Y_MOVE | ACTORCOL_GRAVITY)) & ~ACTORCOL_BIT2; // Set bits 0, 1 and clear bit 2. This creates a non-flying AI by default.
1667
+
moveMod->collisionFlags = (moveMod->collisionFlags | (ACTORCOL_NO_Y_MOVE | ACTORCOL_GRAVITY)) & ~ACTORCOL_SLIDE_RESPONSE; // Set bits 0, 1 and clear bit 2. This creates a non-flying AI by default.
0 commit comments