• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Fps Camera, Dynamic Angle, Terrain Adjustment

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
This is a first person camera system I whipped up from scratch, with some help from various people here at The Hive (thanks to xXx-Tricky-xXx for letting me bounce ideas off him and PurplePoot for calming my fears about getLocZ()) and the ideas of the the people of the FPS Mod Project at wc3campaigns (especially TheEpigoni and Ant).

See the world through the eyes of a rifleman unit! What this camera system does is keep a player's camera targeted just enough ahead of a rifle unit with an appropriate Zoffset and Angle of Attack so that the player sees what the rifleman would see in game. Appropriate Zoffsets and Angles of Attack are calculated dynamically, so this Camera system works in any kind of terrain.

Additionally, map makers can replace the rifleman with any unit they wish just by messing with the variables in the constants trigger.

I'm leaving it as a First Person Camera System for one player but it can be easily changed to be usable for multiple players. Creative map makers may even figure out how to use different first person units for each player.

The system is barely optimized. All the memory leaks are taken care of (hopefully), but there are still a few things I can do to make it run better. Maybe I'll do that in the future. Watch for updates.


Some things that may seem like bugs:
This will not work well for flying units. Flying units follow a different Z height map than ground units and cameras do. This system compensates for the height map cameras follow but I haven't figured out how to compensate for the height map flying units follow.

Wrong Zoffsets and Angles of Attack at bridges and water: fixable via Unit enters Region Events and some math

Camera bounds at edge of map: simply prevent units from going there.


NOTE THAT THIS A FIRST PERSON CAMERA TEMPLATE, NOT A FIRST PERSON SHOOTER TEMPLATE. I'm leaving that up to you guys :razz:. Besides, the stuff the FPS Mod team has already done is probably better for that.

Keywords:
First person camera, first person shooter, template, camera triggers, triggers.
Contents

FPS CAMERA, DYNAMIC ANGLE, TERRAIN ADJUSTMENT (Map)

Reviews
11:21, 27th Jul 2008 Septimus: This should belong to spell section.

Moderator

M

Moderator

11:21, 27th Jul 2008
Septimus:

This should belong to spell section.
 
Top