Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed/Fixed enemy jeep behaviour #1395

Merged
merged 31 commits into from
Oct 26, 2024
Merged

Changed/Fixed enemy jeep behaviour #1395

merged 31 commits into from
Oct 26, 2024

Conversation

TokyoSU
Copy link
Collaborator

@TokyoSU TokyoSU commented Aug 13, 2024

todo

Links to issue(s) this pull request concerns (if applicable)

"n/a"

Description of pull request

Check changelogs.md -> Enemy jeep.
Also corrected the changelogs a bit.

File required/for testing:
KV5_jeeptest.zip

Enemy Jeep (1.5)

The enemy jeep from TR4 has been re-implemented into TombEngine but the setup has changed. It requires the use of AI_X1 for path (need to start at 0 and end at whatever your path need to end) and AI_X2 objects to change it's behaviour through this path, AI_X2 ocb:

OCB 1: Drop grenade.
OCB 2: Vault.
OCB 3: Jump over pit.
OCB 4: Wait until player is near.
OCB 5: Disappear.
OCB 6: Activate heavy trigger.
OCB 7: Another vault (Need animation + state setup).
OCB 8: Another jump pit (Need animation + state setup).

Furthermore: you set the OCB on the ENEMY_JEEP object itself for the desired effect:

OCB 0: Will wait until the player is on a vehicle.
OCB 1: Will start regardless of whether the player is on a vehicle or not.

Warning:

Enemy jeep have changed drasticaly, the original object is not valid anymore !

@TokyoSU TokyoSU added Enhancement New feature or request Fix Fixed one or many bug labels Aug 13, 2024
@TokyoSU TokyoSU self-assigned this Aug 13, 2024
Copy link
Collaborator

@Stranger1992 Stranger1992 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested in-game:

ENEMY_JEEP:

  • OCB 0: Working
  • OCB 1: Working

AI_X1

  • OCB working. Path is being followed nicely. However: if there are plans for multiple enemy jeeps: then this may need to be revised? I Have not tested what happens if you change the OCB in run-time (for example if the player does something in game that will change the jeep's path).

AI_X2

  • OCB 1: Working. Fires grenades as expected
  • OCB 2: Working. Clarity necessary as to what values to be changed for different fall distances though.
  • OCB 3: Working. Clarity necessary as to what values to be changed for different jump distances though.
  • OCB 4: Working
  • OCB 5: Working
  • OCB 6: Working
  • OCB 7: Unsure what this does so not tested
  • OCB 8: Same as OCB 7.

General comments.

  • Could Lara be killed if enemy jeep runs her over? Currently only pushes her out the way.
  • Allow for multiple enemy jeeps?

TombEngine/Game/Setup.h Show resolved Hide resolved
TombEngine/Game/Setup.h Outdated Show resolved Hide resolved
TombEngine/Objects/TR4/tr4_objects.cpp Outdated Show resolved Hide resolved
TombEngine/Objects/TR4/Entity/EnemyJeep.cpp Outdated Show resolved Hide resolved
TombEngine/Objects/TR4/Entity/EnemyJeep.cpp Outdated Show resolved Hide resolved
Spider, // Only 2 block vault allowed.
Ape, // Only 2 block vault allowed.
SnowmobileGun, // Only 1 block vault allowed and 4 block drop max.
EnemyJeep
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why new LOT type is needed for enemy jeep? Was it a thing in original TR4?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No because i need more click that the other offer me.

TombEngine/Game/Setup.cpp Outdated Show resolved Hide resolved
@@ -1432,69 +1437,119 @@ void FindAITarget(CreatureInfo* creature, short objectNumber)
}
}

void FindAITargetObject(CreatureInfo* creature, int objectNumber)
void FindAITargetObject(ItemInfo& item, GAME_OBJECT_ID objectID)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why function argument was changed from CreatureInfo to ItemInfo?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sezz did it :x

TombEngine/Game/control/box.h Outdated Show resolved Hide resolved
@@ -1255,7 +1255,7 @@ void TriggerDynamicLight(const Vector3& pos, const Color& color, float falloff)
color.x * UCHAR_MAX, color.y * UCHAR_MAX, color.z * UCHAR_MAX);
}

// Deprecated. Use above version instead.
// DEPRECATED! DO NOT USE!!
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is deprecated and do not use, why not just delete it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sezz did that, don't know why this function is used everywhere :x

@Lwmte Lwmte merged commit 267fecb into develop Oct 26, 2024
@Sezzary Sezzary deleted the enemy_jeep branch November 3, 2024 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Fix Fixed one or many bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants