• 🏆 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

Status
Not open for further replies.
Level 3
Joined
Mar 23, 2010
Messages
46
I'm currently making a FPS using a traceline system for aiming and shooting... 1. I was wondering how do i make it shoot multiple tracelines (for a shotgun)
2. Is there a better FPS system? If so, please do tell....
3. Is there a way to make my unit throw a grenade in the direction of aim.
4. Switching weapons? How?
5. Does anyone know how to create a fog of war?

Thank you for reading and answering these questions!:goblin_boom:
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
3. Is there a way to make my unit throw a grenade in the direction of aim.

Yes, you just get the current aim and then you calculate the tragectory for the gernade and finally spawn it with that trajectory. Exactly the same way you would trigger the shooting of a gun or shotgun.

4. Switching weapons? How?
Triggers (what they are meant for).
Just make a separate sub system which handles weapons. This sub system then interacts with the main weapon firing and FPS system.

5. Does anyone know how to create a fog of war?
SC2 already has fog of war. You can change it via triggers at will.
 
Level 3
Joined
Mar 23, 2010
Messages
46
hey everybody! I know you can change things with triggers!! You keep telling me that!! I need to know which triggers or what different types of triggers would help!!
(e.g. camera triggers mixed with boss bar triggers) Give me some direction and stop saying the obvious!! This goes for all of my posts about shooters!
(and yes i know SC2 is a strategy game thanks for sharing!)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
A hand full, in reality.
Nope. There is a near infinite number of ways to do something (limited by the complexity of a computer state machine). Just there are only a handful of efficient approaches. For example you could insert any number of do nothing statements during the execution of your code (just blank function calls) and it will still work, just doing so makes it work worse than not doing so.
 
Nope. There is a near infinite number of ways to do something (limited by the complexity of a computer state machine). Just there are only a handful of efficient approaches. For example you could insert any number of do nothing statements during the execution of your code (just blank function calls) and it will still work, just doing so makes it work worse than not doing so.

Way to take it deeper than it needed to be, lol.
I meant like.. setting yourself an object (moving unit A from point B to point C).

You can make behaviours which are given to the unit at point B, which the game then recognizes and moves unit A to point C. However it would be very inefficient, seeing as how you would be wasting data space, when in reality triggers need to be used anyways.

The most efficient way would be simply to make a region, and have a trigger event recognize when unit A moves into it, then move the unit instantly to point C (or more preferably, region C)

However you may look at it, to successfully perform a goal as such, there are only a handful of things you can do (those falling under categories such as using Data over Triggers, Triggers over Data) (or even sub-categories such as using GUI triggers over script triggers, or script triggers over GUI triggers).

But when it comes down to it, ignoring sub-categories (saying that the creator has his or her own build style automatically chooses the sub-category would be most advisable) then there are really only a handful of options at your disposal.
 
Level 3
Joined
Mar 23, 2010
Messages
46
Click the visibility tab in the trigger functions and have a look.
It's really not that complicated.
You can figure out tracelines but you can't figure out basic GUI?

Not my traceline system. Basic GUI?!?! Not for me... at least not yet.
It may be basic to you but, remember that some people are noobs. (like me!)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
You basically need to devise a method that from A to B detects all all units a line would pass through.
This means that units have to have a 3D size. It also means that the projectile might need a width (in the case of something big looking). You then need to use advanced mathimatics to work out if a cylinder intesects with a sphere. If they do, you will need to detect which is closer to the start and then optionally where the intersection occured.

There are 2 possible approaches to this...
1. Vector manipulation where you work out the movement vector of the projectile and then the perpendicular vector made through the possible target and then get the distance from the possible target to it intersecting with the movement vector. You compare this distance against a sum of the radius of the projectile and the collision of the unit. I do not see this method giving you accurate position of a collision.
2. Find the time of intersection between a sphere (with constant radius) and a cylinder (with length as a function of time). You are after the smallest time if multiple are present. This is probably the easiest and best method.

The problem will still remain of fast moving units being almost unhitable due to not taking into account sub frame unit positions. You could probably compensate for this by adding a function of speed to the unit's collisions so that faster units appear larger to the system.
 
Status
Not open for further replies.
Top