User Tag List

Results 1 to 1 of 1
  1. #1
    Whicked Sick Higor's Avatar
    Join Date
    Apr 2012
    Full sail ahead!

    Code review: Individual construction distance.

    Point is, allow certain constructions to appear at greater or shorter distances, this will allow better ForceField and SContainer placements, more or less Teleporter possibilities, and reduce exploits like Explosives through walls, without even using trace checks.
    It will also take the player's standing or crouching state into consideration for the construction.

    PD: We will also fix the teleporters not being able to accept players if placed on small nooks/map edges.

    Data to consider:
    Player eye height (standing) = 27.
    Player eye height (ducking) = 0.
    Player eye height (air) = 18,9.
    Player collision cylinder: Diameter=34, Height=78.
    Player BSP collision block (6 faced solid, aligned to x,y,z axis): 37 (estimate) x 37 x 81.
    Building placing formula: PlayerCenter - vect(0,0,8) + aim(normalized to 1) * 45.


    CollisionHeight property - change from 32 > 39

    Add a new property: BuildDistance > default is 45
    Subclasses of sgBuilding will have other defaults, ForceField for example should default to 70, Platform to 50, RocketCannon to 35.

    Modify a line in the function PlaceIt()
    	test = Spawn(type, Owner,, Owner.Location - vect(0,0,8) +
          vector(Pawn(Owner).ViewRotation) * 45, Pawn(Owner).ViewRotation);
    New one:
    test = Spawn( type, Owner, Owner.Location + vect(0,0,1) * fMax(0,Pawn(Owner).BaseEyeHeight) - vect(0,0,10) + vector(Pawn(Owner).ViewRotation) * Type.Default.BuildDistance, Pawn(Owner).ViewRotation );
    The new function allows to build 2 units further down if player is crouching, higher if player is jumping (16 units further if aiming up), or to build next or beyond a ceiling if a player is standing on a platform (25 units further if aiming up) .
    That is only the origin point, the sgBuilding new property will determine the distance away in the facing direction.

    Gameplay changes:
    Crouching and standing will now make a difference in where you're building, jumping will make buildings appear a little higher.
    Distance values can be used to tweak what things we want to build further away from the player, allowing them whether to go through thick walls or not.
    ViewRotation value added to spawn function, for future uses (directed cannons, directional boosting, etc)

    If you consider the extra upwards and downwards distance shouldn't be greater, simply modify here ... + vect(0,0,1) * ... to ... + vect(0,0,0.7) * ...
    Last edited by Higor; 07-24-2012 at 07:23 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Code review: sgHUD
    By Higor in forum #siegepug Discussion
    Replies: 6
    Last Post: 06-01-2012, 02:45 PM
  2. Code review: sgTeleporter
    By Higor in forum #siegepug Discussion
    Replies: 12
    Last Post: 05-26-2012, 08:24 PM
  3. Code review: Mines 2
    By Higor in forum #siegepug Discussion
    Replies: 5
    Last Post: 05-26-2012, 02:49 PM
  4. Code review: sgProtector
    By Higor in forum #siegepug Discussion
    Replies: 9
    Last Post: 05-24-2012, 03:21 PM
  5. Code review: Mines
    By Higor in forum #siegepug Discussion
    Replies: 20
    Last Post: 05-21-2012, 09:36 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts