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

[Trigger] How to make an 2D style?

Status
Not open for further replies.
Level 8
Joined
Aug 4, 2008
Messages
279
Well, im making a map and i need the 2D.
A unit enters an area, the cameras turns 90 degrees, to seens like platform, but how to make the unit moves by the arrows, just like the game called Soldiers, but with no firing.

+Rep for those who help me.
 

Cokemonkey11

Spell Reviewer
Level 30
Joined
May 9, 2006
Messages
3,544
u make gravity by doing a stack. If you want MPI just use an array like speed[player id], if you want MUI i'd reccomend vjass in a struct stack. Basically you just move a unit by it's current speed then add to it's speed, and loop for all units being affected.

To tell it when to stop you check the height of the target point before you move, or like in platform escape you check the terrain type.
 

Cokemonkey11

Spell Reviewer
Level 30
Joined
May 9, 2006
Messages
3,544
it's simple, think about it yourself.

loop from 1 to 12
set temp integer = speed[loop]
set temp location = position of unit[loop] offset by speed[loop] towards 270 degrees
if getlocationz(temp location) == getlocationz(position of unit[loop]) then
call move unit[loop] to temp location
set speed[loop]=speed[loop]+x //change x to increase or decrease the rate of gravity
 
Level 8
Joined
Aug 4, 2008
Messages
279
Then I should set the Units
set unit[1] = unit001
set unit[2] = unit002
...until 11
Then create the trigger

Every 0.02 secs

for each integer A from 1 to 11
set temp integer = 4(exemple for speed)[integerA]
set temp location = position of unit[integerA] offset by speed[integer A] 270 degrees
if templocation is in Terrain - Ice equal to true then
move unit[integerA] instantly to temp location
didnt understand the speed
 
Level 8
Joined
Aug 4, 2008
Messages
279
Hmm, i dont want to get faster while falling, just falling.
For that, what shoulld be the variable array value? it really need to be array?

And for moving?(left and right) the same trigger , but different events and degrees?
 

Cokemonkey11

Spell Reviewer
Level 30
Joined
May 9, 2006
Messages
3,544
you want it to get faster while falling or there will be no acceleration (like it's real, if you want a cap just put a condition is that says speed[loop] can't be greater than x)

the array should simply start at 0. And it needs to be an array for it to be MPI.

For moving you'll want to make completely seperate triggers that check it's not in the air and then move the unit slightly to the left or right (on click turn on periodic trigger, on release turn off said trigger)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
For 2D which uses the Z axis (height) as the Y, you need to create a rather complex sytem.
The first needed system is the actual 3 world route system. This converts points in your 2D world onto points on 3D WC3's map. This allows for stuff to be handled much more easilly as you can program the rest just like any 2D game. Part of this system is an acutal route plan, which allocates how the X axis converts into X and Y points on a WC3 map to allow for more impresive and smooth routes. Such a system will be properly coded when you are able to fully exploit the 3D capabilites of WC3 to allow for users to physically not move in a straight line yet seem to gameplay wise (eg walking around a corner on a wall, or winding through a forest around trees).

With the basic system dones, you can work on your 2D engine. For this it has to be capable of clipping 2D objects so as not to waste system recources, be able to handle whatever you want in the game and allow for collidable objects. For ease of programming, you can use the WC3's terrain height as the "flat" level as realistically, nothing can be placed below it and seen. Colidable areas are simple square based checks (as your previous system handles 2D - 3D conversion you can treat these as squares) whereby you check if another square is within it (that square is the collision of your unit or bad guy), and if so it displaces it to the nearest position so that it does not contact. Ofcourse you will be performing a huge number of these checks, probably in the region of 30-60 at once depending on complexity of terrain (how much Z ise used), thus clipping is a must to assure that unnescescary computation resources are not wasted. For clipping the easiest probably would be a sector based system, whereby your 2D environment is broken up into sectors of a certain length and only secotrs within a certain range of your character (slightly larger than screenwidth) are loaded and used to compair with assuring on a nescescary number of checks. Remember that collision areas are theretical, and not at all attached to the terrain of the map, so terrain may still be rendered if needed be even after the collision used for it is no longer used. Finally is your actual character object, which basically contains an X, Y, Xvelocity and Yvelocity, collision rectangle information and an attached graphic for it (probably via unit) so that it is capable of being seen. The objects should be updated between 50 (SP) and 20 (MP) times a second for resonable system recource useage. When pickin objects within a square, you do more collision based calculations (useful for something like an attack).

Finally you have your level system, which should have a highlevel interface system for easy and efficent useage as well as manage the loading of all badies, movement paths and collision areas your map may use. For most efficency this would probably be one or two functions per stage, each which modifies arrays which act as data sources for the systems.

Overall, a quite plausable task, even if not capable efficently. I can imagine such a system working fine in SP as long as your code it correctly and could allow for some graphics worthy of independant games, especially if good terrain is used with attention to detail. A possiable graphics loader extension could be made for even better framrate for more impressive graphics by creating high detail stuff close to the screen only when near that sector of the movement system and thus reducing graphic usage when viewing the path from afar.

Should be doable within a few weeks such a system with enough planning, however it is near impossiable without JNGP and without using JASS as GUI is nowhere near suited for such a high quality system.
 
Level 8
Joined
Nov 9, 2008
Messages
502
Why would you need a 3d to 2d system when z would be constant? The original X/Y would be enough to use no?

EDIT: Oh...."For 2D which uses the Z axis (height) as the Y". Wouldn't be the case if 2d was achieved by using a top down view.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Bla bla bla bla bla bla and more bla

Yeah... maybe if you're planning to program this in C++/Java/Whatever.

Why would you need a 3d to 2d system when z would be constant? The original X/Y would be enough to use no?

EDIT: Oh...."For 2D which uses the Z axis (height) as the Y". Wouldn't be the case if 2d was achieved by using a top down view.

He just likes to talk a lot.
One axis is constant no matter what so it really doesn't matter.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
GhostWolf, maybe read what I wrote to see its sense...

No platform 2D system would use topdown view as the X/Y. Also what I mentioned was theroetically possiable in WC3. It is not my fault if GhostWolf does not bother reading it.

The system I mentioned would allow for windy 2D paths in a 3D would, allowing you for example to go on top of a curvy wall.

Ofcouse in C++ it would be a lot better, but also a lot more work to program as all the 3D engine would need to be made from scratch.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
No platform 2D system would use topdown view as the X/Y.

What is that supposed to mean, every 2D game uses X and Y, that's the definition of 2D.
If you mean any 'system' in warcraft, then hey, what do you know, all the current "2D" maps I know are made like that.

The system I mentioned would allow for windy 2D paths in a 3D would, allowing you for example to go on top of a curvy wall.

What?

Ofcouse in C++ it would be a lot better, but also a lot more work to program as all the 3D engine would need to be made from scratch.

You didn't get my point. You don't actually need to even THINK about all those things in warcraft.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
The method I was talking about is simlar to what is used in Super Smash Brother Brawl for subspace, whereby the background is fully 3D and can be used to display environments like a city in the background or a forest etc. It however would be a step above and would be simlar to that used in some modern sonic games, whereby the gameplay is 2D yet you are actually moving in 3D (the 2D path is not straight).

Yes most 2D maps have used WC3's conventional X/Y for their X/Y, however this totally loses the point of 3D as it allows for limated depth and environmental interaction / detail. The method I described could allow for a 2D game whereby you could be walking through around a city, even crossing over paths at some points. Basicly this would allow 3D to be fully exploited for a 2D game.

Or you could go with the top down method which looks pretty flat.
 
Level 8
Joined
Nov 9, 2008
Messages
502
Should be doable within a few weeks such a system with enough planning, however it is near impossiable without JNGP and without using JASS as GUI is nowhere near suited for such a high quality system.

You didn't get my point. You don't actually need to even THINK about all those things in warcraft.

The method I was talking about is simlar to what is used in Super Smash Brother Brawl for subspace, whereby the background is fully 3D and can be used to display environments like a city in the background or a forest etc.


Would be EPIC to see that kind of 2/3D marriage in w3. Get to it Dr.Good ^^
 
Status
Not open for further replies.
Top