[QUOTE=Map in a box;36023503]The norm is still X Z Y for OpenGL though IIRC[/QUOTE]
OpenGL's coordinate system is whatever you choose in your projection/view matrices, but I believe the standard is X/Y/-Z - so positive Z is coming out of the screen.
This looks epic, bro. Once I get into lua scripting, this will be a great client for me to practice on. I have a great idea for a addon, but im not so good at lua so ill try and practice untill then so I can implement it into LuaCraft. Anyway, great work.
hey still ain't got a reply on my super-great awesome suggestion
[QUOTE=cvbbot;35993657]Hey here's a suggestion: add a function to check what special effects are currently affecting the player (like poison, swiftness,...) maybe make it return a table of strings or a table of numbers[/QUOTE]
[QUOTE=cvbbot;36029987]hey still ain't got a reply on my super-great awesome suggestion[/QUOTE]
Sorry must have overread that, will look into it!
-snip-
[QUOTE=Lexic;36013172]Only when thinking in terms of moving game assets about in the world.
In terms of rendering x & y are x and y on your screen and z is depth into the screen.
That said, I personally use map orientated coordinates and just transform them in the renderer but hey, it's Notch.[/QUOTE]
That doesn't make any sense, using your same logic if I'm looking downwards or upwards the logical choice is XY :v:
fuck if I'm looking up at a 45 degree angle which co-ordinate system do we use
[QUOTE=Elspin;36063405]That doesn't make any sense, using your same logic if I'm looking downwards or upwards the logical choice is XY :v:
fuck if I'm looking up at a 45 degree angle which co-ordinate system do we use[/QUOTE]
What? What does looking have to do with anything?
I've added a simple Script-Enforcer like thing. It's not perfect by far but it gets the job done.
Started adding NPCs.
[img]http://puu.sh/wOur[/img]
Will add a metatable to control them and stuff soon!
[editline]26th May 2012[/editline]
Alight, so I made it so you can control a NPCs AI.
[lua]chatcommand.Add( "npc", function( ply, cmd, args )
local tr = ply:Trace()
local npc = ply:GetWorld():Create( "NPC" )
npc:SetPos( tr.HitPos )
npc:SetName( ply:Nick() )
npc:SetAvoidWater( true )
npc:AddAITask( 0, "Swim" )
npc:AddAITask( 1, "Wander", 0.25 )
npc:AddAITask( 2, "WatchClosest", "Player", 6, 0.02 )
npc:AddAITask( 2, "Idle" )
npc:Spawn()
end )[/lua]
This will spawn a dummy version of myself who will try to stay out of water, swim if it has to, wonder around with a speed of 0.25, watch and look at any players in a 6 block radius or idle.
There's a ton of AI tasks I binded, so here's a giant compilation.
[code]EntityLiving: "ArrowAttack", float, int, int
EntityLiving: "AttackOnCollideAll", float, boolean
EntityLiving: "AttackOnCollideClass", float, boolean
EntityCreature: "AvoidClass", float, float, float
EntityWolf: "Beg", float
EntityLiving: "BreakDoor"
EntityCreeper: "CreeperSwell"
EntityIronGolem: "DefendVillage"
EntityLiving: "EatGrass"
EntityCreature: "FleeSun"
EntityVillager: "FollowGolem",
EntityTameable: "FollowOwner", float, float, float
EntityAnimal: "FollowParent", float
EntityLiving: "HurtByTarget", boolean
EntityLiving: "LeapAtTarget" , float
EntityIronGolem: "LookAtVillager"
EntityLiving: "Idle",
EntityAnimal: "Mate", float
EntityCreature: "MoveIndoors"
EntityCreature: "MoveThroughVillage", float, boolean
EntityCreature: "MoveTowardsTarget", float, float
EntityCreature: "MoveTwardsRestriction", float
EntityLiving: "NearestAttackableTarget", [[String]]: Entity Class, float, int, boolean, boolean
EntityLiving: "OcelotAttack"
EntityCreature: "OcelotSit"
EntityLiving: "OpenDoor", boolean
EntityTameable: "OwnerHurtByTarget"
EntityTameable: "OwnerHurtTarget"
EntityCreature: "Panic", float
EntityVillager: "Play", float
EntityCreature: "RestrictOpenDoor"
EntityCreature: "RestrictSun"
EntityTameable: "Sit"
EntityLiving: "Swim"
EntityTameable: "TargetNonTamed", [[String]]: Entity Class, float, int, boolean
EntityCreature: "Tempt", float, int, boolean
EntityCreature: "Wander", float
EntityLiving: "WatchClosest", [[String]]: Entity Class, float, float[/code]
The EntitySOMETHING: indicates what base class it's meant for, the stuff after is what you would use with AddAITask and AddAITaskTarget like in my example.
[QUOTE=Lexic;36064436]What? What does looking have to do with anything?[/QUOTE]
The backwards logic you were using is that you can decide which co-ordinate system by how x and y would match up to your screen, but in a 3d game mapped to a 2d surface, the co-ordinates along the screen would be different based on your view. You can't say that x being left and right and y being up and down fits to the screen right, because when you look in a different direction the co-ordinate along the screen will be different.
More related: the AI looks awesome.
[QUOTE=Elspin;36113274]The backwards logic you were using is that you can decide which co-ordinate system by how x and y would match up to your screen, but in a 3d game mapped to a 2d surface, the co-ordinates along the screen would be different based on your view. You can't say that x being left and right and y being up and down fits to the screen right, because when you look in a different direction the co-ordinate along the screen will be different.
More related: the AI looks awesome.[/QUOTE]
It's not backwards logic, that's how it works. OpenGL and DirectX both use that coordinate system, so it's not just some retarded theory I pulled out of my ass.
Everything is rendered from a static camera in screenspace, with -1,-1,-1 being the top left corner of your screen and 1,1,1 being the bottom right of your screen and as far "in" as your screen goes.
World Geometry has to be translated and scaled into screenspace in order to be rendered, and for the lazy programmer it's easier if you don't have to change coordinate systems while doing this.
Which way you're "looking" has absolutely no bearing on the coordinate system, because looking is just another series of translations and rotations that need to be applied to the geometry.
[QUOTE=Lexic;36118498]It's not backwards logic, that's how it works. OpenGL and DirectX both use that coordinate system, so it's not just some retarded theory I pulled out of my ass.
Everything is rendered from a static camera in screenspace, with -1,-1,-1 being the top left corner of your screen and 1,1,1 being the bottom right of your screen and as far "in" as your screen goes.
World Geometry has to be translated and scaled into screenspace in order to be rendered, and for the lazy programmer it's easier if you don't have to change coordinate systems while doing this.
Which way you're "looking" has absolutely no bearing on the coordinate system, because looking is just another series of translations and rotations that need to be applied to the geometry.[/QUOTE]
You're still not getting it - I'm fully aware of the co-ordinates used in OpenGL and DirectX (I am in fact a programmer), and I see the mistake you're making when you're reading my posts, but I can't seem to convey to you what's wrong with your logic. I'll try it this way:
[QUOTE]In terms of rendering x & y are x and y on your screen and z is depth into the screen.[/QUOTE]
Look at what you're saying here - that the x and y on your screen match up to the co-ordinate system. But say your game is an RTS, or a simple top-down game - the co-ordinates will not match up. Now, believe me, I'm fully aware you can translate things based on your camera's view point, but what I'm saying is it doesn't make sense to claim that one co-ordinate system makes more sense than an other based on what is essentially different for each game.
The real decision when you're choosing a co-ordinate system is not which direction is up, but rather to use the left handed or right handed co-ordinate system, which will actually impact the math you use. DirectX and OpenGL actually use opposite co-ordinate systems in this respect. I was taught using the left-handed co-ordinate system, so that makes more sense to me - but your game engine determines what is up and down, not your rendering engine. IE, the source engine having up and down being Z despite being based on DirectX or OpenGL.
I never said one was better than the other, I briefly outlined why Y was up in minecraft:
That's how it is by default in OpenGL and Notch is lazy.
I was certainly not preaching the wonders of using screenspace coordinates for your assets, because as you say, that would be fucking stupid.
So much which ways up :v:
[QUOTE=Map in a box;36126273]So much which ways up :v:[/QUOTE]
I think we need a new standard!
[QUOTE=T3hGamerDK;36130266]I think we need a new standard![/QUOTE]
WELL SINCE IN SPACE THERE IS NO UP how about every direction possible?
let me end this discussion with an ultra-simple drawing explaining the coordinate system
[IMG]http://www.aanda.org/index.php?option=com_image&format=raw&url=/articles/aa/full_html/2009/36/aa10962-08/img22.png[/IMG]
EDIT: Well FUCK, i said end the discussion, not the whole goddamn thread
Why dying thread ? :tinfoil:
[QUOTE=Fleskhjerta;36415829]Why dying thread ? :tinfoil:[/QUOTE]
looks like ending that coordinate system discussion also killed the thread... or LuaStoned is lua-stoned
Project development should regain speed soon enough, finals are finally over for some of the development team.
While Garry's Mod is down I might start working on this again. I've just been out of the mood for playing Minecraft lately.
[QUOTE=Map in a box;36552757]While Garry's Mod is down I might start working on this again. I've just been out of the mood for playing Minecraft lately.[/QUOTE]
I've just set up my development environment.. :grin:
I posted this on our forums since it was requested there, but figured I would add some content here also.
[img]http://puu.sh/EIfC[/img]
I'd like to say get on the documentation before you go adding more stuff.
Without good addons LuaCraft isn't going to go anywhere, and without good documentation people unfamiliar with Gmod aren't going to make the switch. I'd love to get started, but I'm pretty sick of having to read code for documentation of late.
And once it's up to date, keeping it updated only requires someone with time to read changelogs
This is pretty awesome. Great job guys
The wiki has documentation though.
It's out of date.
It's also wrong on many topics, for example, there are serverside only hooks on the clientside only list.
There are also functions with wrong arguments and there are functions missing entirely.
Sorry, you need to Log In to post a reply to this thread.