Jump to content

nocompile

Community Members
  • Posts

    88
  • Joined

  • Last visited

Everything posted by nocompile

  1. In UnitAI.js binaries/data/mods/public/simulation/components/UnitAI.js I was able to disable the AI code by adding a return to this function: UnitAI.prototype.OnCreate = function() { return; if (this.IsFormationController()) UnitFsm.Init(this, "FORMATIONCONTROLLER.IDLE"); else UnitFsm.Init(this, "INDIVIDUAL.IDLE"); }; So that's the first step (ofcourse it would be an if-then in production code, this was just to find out how to turn off the AI), So now I need to find a way to directly pass commands to the unit. How does the AI do that?
  2. Ok I tried, but I _cannot_ find where or how to change a units .angle I really need someone who actually knows about the engine to help. I've been chasing variables around but it's like a maze. http://pastie.org/1279466 http://pastie.org/1279475 http://pastie.org/1279506
  3. I guess Engine.GetActiveGui().g_Selection.toList()[0] gets you the 1st of the currently selected units. So how do we edit the angle variable of whatever that unit is? Engine.GetActiveGui().g_Selection.toList()[0].angle?
  4. What we need to do is add a command that does this: (M_PI is the constant Pi (3.14159265...)) func_ChangeUnitAngle(ScalarRotationRate) { NewAngle = M_PI + ScalarRotationRate; if (NewAngle > M_PI) { NewAngle = (NewAngle - M_PI); } Current.Selected.Entity[0].Angle(NewAngle); } Then we can do something like: Bind "R" = func_ChangeUnitAngle((M_PI/360)*20); */TurnTwenty Degrees Clockwise/* Bind "L" = func_ChangeUnitAngle(((M_PI/360)*20)*-1); */TurnTwenty DegreesCounterclockwise/* I don't know what the actual names of, say, the current seleted entity is etc though or how to access it's angle and change it. Then we need to add some command that tells the current selected entity to go forward abit.
  5. Which resides in: binaries/data/mods/public/gui/session_new/selection.js binaries/data/mods/public/gui/session_new/input.js
  6. Mythos: whatever insults I did make, don't take personally, I've found that when I ask nicely for help in opensource (say on #debian or anywhere else), I get none. When I make some noise, well that's more sucessful. This is in any opensource project I've ever used, contributed to, etc etc. This is from about 9 years of linux experiance. It's not too complex: if (m->FollowFirstPerson) { float x, z, angle; cmpPosition->GetInterpolatedPosition2D(frameOffset, x, z, angle); float height = 4.f; m->ViewCamera.m_Orientation.SetIdentity(); m->ViewCamera.m_Orientation.RotateX(M_PI/24.f); m->ViewCamera.m_Orientation.RotateY(angle); m->ViewCamera.m_Orientation.Translate(pos.X, pos.Y + height, pos.Z); m->ViewCamera.UpdateFrustum(); return; } GameView.cpp Ok so here we see the camera being updated (each tic) to be facing whatever angle (in PI: from 0 to 3.14...) the unit is facing. Which means we just have to add a command to change the angle of the unit and we automatically change the way the camera is facing. Now, what is harder is how to get the camera to look up/down. Ok so this means we first gotta go to input.js and selection.js (k775 gives the tip) and implement a function to change the units angle via a command, and we have to get that exported as a command for the console.
  7. I talked to two or three people. How can that be insulting EVERY member of the team, individually?!
  8. You can control the unit from the first person using the mouse, just can't pan the camera. There is no noticible "lag". You can suggest that there would be but the truth of the matter is there is none. Also about "performance issues": you can see WAY more from RTS view than you can see from firstperson, atleast 4x more from RTS view. All I am asking for is a command to pan the camera. Not bound to any key or "official", I can bind it myself. I'd also like a command to directly move the unit rather than relying on the slow pathfinding routienes. First person looks good to me, and it can stay a mod... but I need the TOOLS to make the mod. Just a few more commands revealed to the bind system. If you want to attach the camera to a unit in first person, Philip gratiously created this command, open console to do it ( ~ ): Engine.CameraFollowFPS(Engine.GetActiveGui().g_Selection.toList()[0]) I, myself, don't know of any way to pan the camera from the console. If there is a way please tell me. If there isn't I'm asking for a pan command, that's all. I've looked in the wiki and can't find anything. Why do I insult on the IRC? Well the first day Mythos Ruler told me I wasn't allowed to contribute, ever. Period. Secondly it seems your views are totally myopic where you won't even reveal whatever routienes are needed to pan the camera to the bind system . Cmon, that can't be hard at all, you allready clearly have commands to spin the camera around a seleted unit, why can't I have simple turn camera command? As for the greek: I used bable fish and then a greek to greeklish converter as I don't think you support unicode.
  9. Here are some screenshots taken from that camera view. All we need now is a few more camera control commands: pan(direction,speed,panlimit) [[panlimit in degrees]if panlimit not set, then it's assumed to be unlimited] and stoppan[for when you release the key you bound pan(left,2) pan(right,2) pan(up,2,90) pan(down,2,90) to. Also I took the unused buildings and made the following by editing and adding xml files: unit_woman can now create: school school creates: stonemason stonemason builds at 1.6x the rate of regular and builds (among other regular things): academy academy builds: architect, artist architect builds at 1.3x the rate of regular and builds: academy, stoa, royal stoa, meeting hall meeting hall builds: diplomat diplomat builds: mecenary tower merc_tower builds: various foreign soliders (expensive though) artist builds: doric column, small statue of aphrodite, large statue of aprodite, plants cyprus tree and plants lombard popolar trees for 10 more wood than they produce. I also did some additions to the celts. They can now build homesteads which go up in 1/3rd the time of a civic center, but cost more since the construction is not as careful (think building a causeway vs a suspention bridge: the suspention brige takes less tons of materials vs the causeway which is dumped fill, but takes longer to build as it is more exacting), and only build woman and spearman (not the other 3 men the civic center builds). This way the celts have a fighting change against the hellens, they can build towns quicker and spread out eveywhere. The celt woman can also now build taverns, longhouses, and fences (wooden) for quick blocking of enemy. The taverns can train a really good chariot to counter the hellens mecenary units. Ofcourse, Mythos Ruler told me before that he would never allow me to contribute to the game, and he and Philip have said that they would NEVER implement additional camera and simple direct movement commands that would allow a player to command from the FRONT (like real generals of old did), even though it would be quite simple to allow these functions to be accessed by the bind system (and that's all I'm asking for, then we could make our own binds to get first person usable and enjoyable to look around in). They say this is a RTS game only and they WILL NOT add even simple code to allow us, who mod, to do firstperson stuff. That is a darn shame. It wouldn't be hard for people in the know, like they are, to just ALLOW us to do this.
  10. In console ( ~ ) do, when having a unit selected: Engine.CameraFollowFPS(Engine.GetActiveGui().g_Selection.toList()[0]) If you want to bind it to the letter T In: session.xml <object hotkey="camera.firstperson"> <action on="Press">Engine.CameraFollowFPS(Engine.GetActiveGui().g_Selection.toList([0]</action> </object> and default config: hotkey.camera.firstperson = "T" ; First-Person view from the first unit in the selection The "lag" doesn't bother me. We need some controls, WASD.
  11. Hi. Yesterday Phillip added some code that allows us to, from the console, view the world from a selected unit. This is awsome, you have to try it. Thankyou Phillip. He also showed me how to bind commands and little scripts to keys, I bound the view-from-first-person's perspective to the key T and it worked great . Now I'm wondering if I can bind diffrent things to the W,A,S,D keys so I can control the unit directly from the first person perspective without using the mouse. I'd like to bind "move forward" to W, "move backwards" to S, and either strafe sideways or turn left/right to A and D (probably want turn as there is no mouselook (yet?)). and some key for attack (enter?) Is anyone else interested in this little modding project. It lets you lead from the front like the ancient generals of old did! An additional idea is being able to change binds in game: if you press T not only does it set your view to first person, it could also change the binds of WASD, and also make it so if you move your mouse to the edge of the screen it doesn't exit first person, but if you press say H or something, then it changes the binds back to normal camara movements for the God perspective mode. I forgot the command that changes the camera as Im not on the home computer right now, but it works great and everything looks good. Another idea that was floated is improving the collision detection to detect walls (as a mode) rather than just the model bounding box. This would allow units to walk around in a building. Simple interiors could even be added to the buildings for fun. If you need to know how to do the various diffrent collision detection algorithims, just ask divverent or Lord_Havok on quakenet irc as xonotic/nexuiz/darkplaces has 4 or 5 diffrent types of collision detection algorithims programmed in to choose from per-model and you could ask them what the algos are. Anyone want to work on this little feature/mod? It's awsome as is to look from the first person perspective, really gets you in the game, and you can command using the mouse, but adding keyboard controls would make it even better (say, via binds)
×
×
  • Create New...