• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Battlefront

Status
Not open for further replies.
Level 11
Joined
Aug 25, 2009
Messages
1,224
I am currently working on a first person shooter I am calling "battlefront" for the time being, but it will be a medieval shooter (arrows, swords, horses, ect)

It will work like this - In the begining of the game, each player will choose a class (Swordsman, Horseman, and Archer) and after everyone has chosen a number of units will spawn for each time and attack the enemy base. The computer will automaticly attack, but the players will have to manually strike/shoot. After a number of reinforcements have deplinished for a team, respawns will be disabled for that team.

There will be only one vehicle ( at the moment, I might decide more ) which is an air ship. The air ship will have an internal area which players can enter and manually drive/use as a hitch hiker to get behind enemy lines. Only one of these vehicles per team will be alive at one time.

This map will be triggered on GUI, and I will make most of the triggers and terrain myself, but the reason I made this thread is to request help on specific triggers I need help on, and I will post updates and screenshots on the map.

New Map Update. Current projectile progress inside ((press esc to shoot) For whatever reason I don't know the shooting trigger no longer works)




Look at [URL="http://filesmelt.com/dl/Realistic_War2.w3x[/URL]<this to see the triggers. Currently, how do I make it so you can change your class and respawn as a new unit with this camera system? I haven't found away yet....
 
Last edited:
The escape key event is when a player "skips a cinematic" (doesn't require cinematic mode to be on or anything, it's basically when the player hits the escape key).

For the bullets make a dummy at unit at it's location facing it's direction and add them to a bullet group. Every .03 seconds pick every unit in that group and move them some distance (using polar points or coordinates, whatever you like). Within that trigger set another group to enemy units around the location of the bullet, if there's more then 0 units in the group kill the bullet, remove it from the bullet group and damage all the enemies in the damage group.
 
How do I add units to groups? I know how the unit group trigger works, but could you explain the vari work with that?

-Well first create a unit group that will be all Bullets
-When the player creates a bullet by firing, use the Add Unit function to add the bullet created the the Bullet group
-Every .03 seconds, pick every unit in the Bullet group and move them, then check for collision.
-Upon colliding with something, remove the bullet from the group and kill it.
 
Also, for the arrow key system, i was just told by GhostThruster that it is best to use Move Unit with shorter intervals instead of Issue Unit Order, and i would also personally suggest that you use a jass line for that (can be easily implemented into GUI) that takes an x and y coordinate instead of a location, since this could also prove faster when the trigger is fired every 0.03 seconds (not to mention that you don't have to worry about leaks).
 
just check the distance between two object and then determine if it is lower than the distance you have set to be minimum collision distance.

Say, if you want the collision "radius" of the projectile to be 30, you just check if DistanceBetweenUnits(your bullet, selected unit)<30, and if it is, you run the "hit" function.
 
  • Time:
  • Periodic: Every .03 Seconds
  • Conditions
  • Actions:
  • Group - Pick Every Unit in Unit Group GROUP and
  • set location P = position of picked unit
  • set location P2 = polar point - P offset by 10 towards Facing angle of Picked unit
  • Move unit to P
  • Custom Script: call removelocation(udg_P)
  • Custom Script: call removelocation(udg_P2)
Of course that's not the exact code but you get the point
 
Level 11
Joined
Aug 25, 2009
Messages
1,224
there has nothing to do with angle, they face the same angle as the archer does, but they do the mvoe instantly thing in the same direction

Also, I'm trying to get the kill arrow and deal damage thing, when I do the 'unit comes within distance of unit' I can't do unit type, and when I try to do the variable I can't make it use the variable
 
there has nothing to do with angle, they face the same angle as the archer does, but they do the mvoe instantly thing in the same direction

If they face the correct direction but move in the wrong one, then obviously something isn't setting the correct angle in moving the unit.

Also, I'm trying to get the kill arrow and deal damage thing, when I do the 'unit comes within distance of unit' I can't do unit type, and when I try to do the variable I can't make it use the variable

On the move periodic, set a unit group equal to the units owned by an enemy player around the bullet. If there's more then 0 units in the group kill the bullet and deal damage
 
If you don't know how to use variables, then i think you are a little bit over your head with this project. Perhaps you should work with some other less demanding projects before you dive into something this script-heavy.

But anyways, if nice people like Wherewolf and Warlord helps you out, i guess you'll be fine. ;)
At least you seem to have the eager to learn.
 
Well if you know the basics of a variable, it allows you to store a piece of information to use for later (or in the case of movement, simply to remove leaks).

-Go under the variable editor and then create a new variable
-From there, within a function you can reference it in an appropriate situation through the second click menu (the one above the one that has instances like picked unit, etc.).
-Using the Set Variable function, you can set a variable to something for later use, like setting a unit variable to a unit casting a spell so you can reference that unit later without the "casting unit" thing, or to have the same unit referenced within multiple triggers that it doesn't trigger
-Many variables need not be removed, but some, like locations, need to be removed to prevent leaks. Removing these specifics types takes a line of custom code specific to that variable type. Here's the ones you'll be using the most

call RemoveLocation(udg_VARIABLENAMEHERE)
call DestroyGroup(udg_GROUPVARIABLENAME)

The one for special effects has a GUI equivalent you've probably already noticed.
 
Here, I made a projectile system a while ago for a map concept, I'm not saying take the whole system because it probably has unnecessary features in it you don't need (like shooting at an angle, though I am pretty proud I was able to get the arrows to mostly (still some change) ignore the Z of the terrain under them) but it could help to take a look at how I did it to understand variables and such more.
 

Attachments

  • ZZ - Projectiles.w3x
    56.8 KB · Views: 47
Level 20
Joined
Feb 24, 2009
Messages
2,999
Interesting... Might keep tags on this.
Good luck!

P.S

Learning about variables, arrays and loops will be absolutely essential.
vJASS isn't, but it would prove most useful, saying that, there are plenty of pre-made movement/camera systems in vJASS in the spell section; just search under 'systems' for 'camera' or 'key movement'.
 
Is there any way to calculate the global height of an object then?
I made a nice function that retrieves the exponent in a parabola that looks like this:

Y = x^(-height)^(1/length)

I had thought to use it to calculate the trajectory of a cannonball, but if i use SetUnitHeight = blablabla, and use my function to set the z, i will only get the z relative to the terrain, and i want to be able to check if the cannonball hits the terrain by checking if it's Z is lower than that of the terrain. Perhaps you know what i mean, i'm a bit confused with this though.
 
Level 11
Joined
Aug 25, 2009
Messages
1,224
That is a good idea, but I might not do it, I ment the 3 classes to have different ups and down (the horseman is fast, but low on damage and hp, the swordsman has decent speed and high damage and good hp, and the archer is ranged and has decent damage but is helplessly slow.) and the horse as a mountable thing would offset the tradeoffs a bit.
 
Level 11
Joined
May 26, 2009
Messages
760
True. Although I'd like to incline that mounting a horse (in reality) gives you advantages in both speed, strength and defense. At least they gain a nice burst damage when charging.

Have you thought any of armor types? or will you go for plain damage? I'm not sure what level of complexity you'd like the map to end up with. Will the units be heroes, can they have items, will they gain abilities or is it more of a skillshot game?
 
Also, i'd say archers, who are so lightly packed (not having to carry heavy swords or armour), would be much faster rather than slower!
Instead, give them low HP, fast attack speed, and decent damage.
The horseman would have good protection against swords, due to his height advantage, but low protection against arrows.
 
Level 11
Joined
Aug 25, 2009
Messages
1,224
NPC or Computer units will have the evasion ability to serve as what a player would have in order to block or dodge attacks from other NPCs, but this does not work coming from players.

I decided to make archers slow because it forces a strategy for the melee to take the damage while the archers deal the damage, but they themselves can take little damage.

I'm not too sure on armor types, I will most likely just go on damage and health, but health is based on the armor of the unit.
 
Status
Not open for further replies.
Top