Jump to content

eezstreet

Members
  • Posts

    5,207
  • Joined

  • Last visited

Everything posted by eezstreet

  1. I really don't know when I should release like an alpha or something. I kinda wanna give out code copies to people who want to develop for it, but I don't know at what point I should do that. Maybe when I get the issues with Angelscript sorted out? Not sure. Post some ideas here, I'm up to anything really.
  2. yep, can't do it in OpenJK because this limit in particular will have effects on savegames as I believe
  3. @@Almightygir_gir is making one.
  4. Some issues with doing this: This doesn't actually increase performance, since the entire player model needs to be evaluated for animations, and either way, performance is not a key factor here.You then need to write out a text file for surfaces that need to be turned off, and modelers like to vary what surface names they use.Numerous issues with clipping, especially with stuff like rodians and grans which have oddly shaped handsThe hands will be lower quality in general, as third person models aren't meant to be nearly as detailed as stuff in first person
  5. Someone (?) is working on an OpenJK fork that runs SoF2.
  6. this really belongs in advertisements anyway, not here
  7. I suppose, yeah.
  8. hmk. Whenever I get it ingame I'll provide you with a screenshot so you can see where it's at.We could also make the bryar's _hand.md3 a GLM as well, and make it have actual...um..hands as well as the original gun model (bolted via a tag)
  9. Make sure it isn't a progressive JPEG.
  10. I'll take a look at it later tonight. Did you position it according to the Bryar's _hand.md3? otherwise it'll have...interesting positioning like the blaster rifle example above. @@mrwonko: I need a tag_flash, and that's about it. Maybe a basic firing anim too. I'm mostly just rounding up what I can and testing stuff out. The model will also need to be positioned and scaled similar to how the Bryar pistol is scaled and rotated in its .md3.
  11. The arms aren't actually bolted to the model at all. They use a specific animation which matches the gun's animations to a T. I suspect that we could get something similar to work with a modified _hand.md3 which has an extra tag for the actual hands. However, the important thing is that I get it animated. Oddly enough, the mine monster doesn't use an external .gla but it works perfectly fine. I'd suggest looking into that model for a general idea how we could handle the GLM. As for the hands, I don't think it actually matters for JK2:HD in particular (and I don't anticipate more than one model being used anyway). We can always just swap those out and use a different GLM.
  12. I don't know how to fix the UV issues, so that's currently dead in the water. I'm going to put a mine monster (LOL) as a viewmodel weapon, see if I can animate it
  13. i'd also like to point out that tuts already exist for 2/3 of these things, so I mean..
  14. @@DT85 / @@minilogoguy18: Here you are, one semi-functional, badly rotated GLM viewmodel: I didn't use any SOF2 code for this, rather I hijacked the viewmodel code to a large extent. I used the blaster viewmodel on the briar hand model (still a necessity because it's responsible for the raising/lowering of the weapon among other things), hence the bad rotating (because as you'll note, the blaster.md3 is way differently rotated/positioned from the worldview). There's still a few bugs that I need to work out though (stun baton looks fucked, for instance). Now go forth and make me some GLAs and GLMs so I can properly finish this, damn it. <3
  15. That's what I plan on doing. However I want to get Angelscript support finished first. (Best to get something finished before tackling something else and winding up with broken features, eh?)
  16. That's what some people claim. But there's literally no difference.
  17. Yeah, but even I haven't gotten there yet. Still getting some errors along the way. I plan on starting with the DEMP2 as there's some specific properties that I would like to alter with it for certain custom games that I'm working on (giving it a short-range chain effect, making it collide with water and bounce slightly on metal, etc) As for the HUD stuff, yeah, all that stuff is stored in gentity_t->gclient_t->playerState_t.stats[sTAT_HEALTH], STAT_ARMOR, and also gentity_t->gclient_t->fd.forcePower in C. I plan on exposing the entirety of this stuff in Angelscript (so to access the stuff there, i'm thinking something like player.ps.STAT_HEALTH or player.ps.STAT_ARMOR)
  18. Perhaps you could look over my Angelscript guide and make sure there's nothing there that's too confusing. I want to make it accessible to people with basically no scripting experience, but also make it a vigorous crash course. Also, good idea about force powers. I was thinking about putting HUD up there too, but I'd like to get weapons using base behavior first as that's going to be quite a task to recode.
  19. Well, the idea behind this is a little bit different from that of JKG. JKG wanted to implement Lua as a form of level scripting and perhaps NPC AI, whereas I want to use it as a tool to extend weapon behavior. If there's a decent enough response to this, then I might implement more things being binded to Angelscript. My ultimate goal is to eliminate the need for people to create code mods for stuff, and instead provide a platform of sorts for people to create new campaigns and the like with amazing stuff going on, just by combining cvars and editing the scripts. I think people like @@therfiles are creative enough that they can create all kinds of softcoded workarounds for stuff that would usually be hardcoded. My point is that I'd like to see some more of these hardcodes worked around, and maybe people will choose JK2:HD as a platform for their campaigns. Though in all actuality, I do have to make a mod after all, and for that I'm going to be trying to crowdsource as much as I can. Some people such as @@Circa, @@Silverfang, @@Resuru, @@MoonDog and @@DT85 have come forward and put in some content for me to work on, and I'm gracious for their assistance. Maybe more people might be interested in helping me work on this based on what I can bring to the table for them to work with.
  20. That could work. Do note that there are indeed a few subtle differences in the way that ghoul2 is called in SoF2 (there's no attachment feature in JK2/A, for instance) @@mrwonko the format hasn't changed I believe
  21. So I realize that most people probably don't know a whole lot about C or Angelscript, so I'm taking the time to write a guide, slowly but surely. (If @@Circa or someone would like to pin this, this would be great.) As with all information, you can find the complete guide to Angelscript here. I'd like to break this down into information that's specific to JK2:HD as well as make it a bit easier to understand (as I can personally attribute to this stuff being completely fscking badly written at times). Basic Syntax First, I want to get some basic syntax out of the way. Angelscript is very similar to C and C++, and the syntax as such is pretty much the same. // Anything after a // is considered a comment, and is not processed by the system. // Use these to help others understand your code better, or to temporarily disable parts of code ("commenting out") /* Anything between this notation is also considered a comment. */ /* This syntax for comments can span multiple lines */ int something = 5; // All basic lines must end in a semicolon. if(something == 5) // Parentheses must be closed off something = 6; if(something == 6) { something = 7; } // Likewise, { must be followed by a } at some point. // You can't simply put a } or a ) somewhere either. These will cause the compiler to become confused as it expects a ( or { before them Variables Angelscript, unlike ICARUS, relies heavily on the concept of variables. There's a few basic types that you should familiarize yourself with. int: The basic number storage unit. Has a maximum size of ~-2 billion to ~2 billion.float: Stores a "floating point" number, in other words, a decimal number such as 4.05 or 2.15. This can also be negative.bool: Stores either a 0 or a 1, representing "true" or "false"string: Stores a number of characters forming words or sentences. For example, "I have a lightsaber!" or "This is a string" or even "cat".There's also a few advanced types and modifiers to the original types: int modifiers: int can be modified to change its maximum storage capacity. As you'll recall, an int can have between -2 billion and 2 billion as values. But there's some reasons why you might want to change this to be smaller or larger. By specifying a power of 2 between 8 and 64, you can change the int's bit size. For example, int8 and int16, which are both smaller than the default amount (-128 to 127 and -32768 to 32767 respectively). There's also int32, which is the same as regular int, as well as int64 which is much, much larger than a regular int. I would avoid using int64, int16 and int8 unless you really need them (such as saving/loading files and networking stuff), so for the most part this isn't really needed. By placing a letter 'u' before 'int', you can specify that the variable is unsigned, or is never negative. This also effectively doubles the maximum size. For instance, uint8 now goes from 0 to 255, and uint32 now goes from 0 to 4 billion. You must specify a size with uints.const: By placing the keyword 'const' before a variable, you specify that the variable cannot be changed. This can be good for a number of reasons, mostly for others understanding your code. You should probably use const whenever you can.double: This is a different type, similar to float. However it uses 64 bits instead of 32 and is therefore more precise.void: This is a unique type which we will discuss later.How about a few examples? int x = 4; // Define a variable named 'x' of type int with a starting value of 4 float y = 4.5; // Define a variable named 'y' of type float with a starting value of 4.5 bool z = true; // Define a bool named 'z' with a starting value of 'true' Objects There is another specific type of variable in Angelscript, called objects. These have a variety of properties, but it's important for the moment to consider these as sorts of containers for other variables. For right now, I won't get too detailed into these, but there's a few objects which you will see throughout the code (such as gentity_t) and it's important to recognize them. Variable Naming There's a few things that should be noted about variables. First, you cannot start a variable with a number (so 1x would be illegal, but x1 is legal). Variables are also case sensitive. X1 is an entirely different variable from x1. There's also a bunch of names that you can't use as variable names, these are covered here: Math We can also do some math: int x = 6; int y = 7; x = y; // x is now 7 x *= y; // x = 7, so 7*7 = 49 x -= y; // x = 49, so 49-7 = 42 y += 10; // y is now 17 x /= 7; // x = 42, so 42/7 = 6 x++; // Increment x by one, so x is now 7 x--; // x is 6 again since we're decreasing by one Functions Functions are chunks of code which get executed by other code. Consider this function: void PrintSomething(string whatToPrint) { Com_Print(whatToPrint); // Print the value of whatToPrint in the console } All this function does is print something in the console, based on what we give to it. While it's really not a good idea to do this per se (why not just use Com_Print?), it does demonstrate the basic idea of a function. You'd then call this function thusly: PrintSomething("Something\n"); or string somethingWeShouldPrint = "Something\n"; PrintSomething(somethingWeShouldPrint); Did you see the void at the beginning of the function? This refers to the return type. You can place a return at any point in the function to "get out of the function" so to speak. void dummy(int someargument) { int something = 6; return; something = 7; // Everything after the return; doesn't occur, so this line doesn't get executed at all. } So what is a return type exactly? Well, a function can return a value based on what its return type is: int dummy2(int someargument) { int something = 6; return something; } int value = dummy2(0); // 'value' now equals 6, since we returned a 6 What about the bit in the ()? Well, these are called parameters. We can pass along some parameters (or none at all!) and the code will use these as variables in the function: int dummy3(int someargument) { return someargument; } int value = dummy3(3); // Value now equals 3, since we passed along a 3, and that got returned to us. Flow of control: if/else If you're familiar with ICARUS, you might already know of if/else constructs. if/else is a big construct in nearly every programming language, save for some odd ones like Haskell. When we do an if/else, we're essentially computing a binary instruction which is either true or false. So for instance, if we were to compare: int x = 3; int y = 4; if(x == y) x = 5; // TIP: you do not need to specify {} with if/else if there is only one line in the block else { y = 6; // However if there is more than one line, you must always use {} x = 6; } What happens in this chunk of code? Well, x gets compared to y (note the double == as opposed to =), and if this evaluates to true, the block within gets executed. If not, then the else{} block gets executed. else{} is entirely optional. Here's a slightly more trivial example: bool b = true; if(b) Com_Print("b is true!\n"); else Com_Print("b is false!\n"); What's going on here? We're evaluating what's going on in the (), which in this case happens to be "true" since b equals true. So in this particular example, "b is true!" always gets printed in the console. Okay, here's an even more basic example than that: if(1) Com_Print("Here's some silly line that always gets printed\n"); else Com_Print("Here's some silly line that never gets printed\n"); I want to compound this with another concept, that of else if: int x = 6; int y = 10; if(x == 7) Com_Print("This line doesn't get executed...\n"); else if(y == 10) Com_Print("This one does however!\n"); else Com_Print("Since the else if block got executed, we didn't get to this point.\n"); Reference Structures vec3_t - Vectors Used to represent position, direction, etc in 3D space. float x - x position float y - y position float z - z position entityState_t - Entity State Stores savegame information specific to entities int weapon - currently equipped weapon playerState_t - Player State Stores savegame information specific to the player int accuracy_shots - total number of shots fired vec3_t viewangles gclient_t - Client Stores savegame information specific to NPCs and player playerState_t ps gentity_t - Entity Basic unit of an entity. Can be any type (NPC, player, projectile, ...) gclient_t client entityState_t s vec3_t mins - Bounding box vec3_t maxs - Bounding box int damage - Damage dealt (if any) int dflags - Damage flags (if any) int methodOfDeath - Sets method of death (not really used all that much in SP) int clipMask - What the entity collides with int bounceCount - Bouncing (specific to projectiles) Functions void CalcMuzzlePoint(gentity_t@ ent, vec3_t fwd, vec3_t right, vec3_t up, vec3_t muzzle, float lead_in) Calculates an entity's muzzle point, and stores the values in fwd, right, up, and muzzle. lead_in is not used (it's for xbox-related code for autoaiming I think) void Com_Print(string message) Prints a message to the console. int Com_Clampi(int min, int max, int value) float Com_Clamp(float min, float max, float value) Constrains value between min and max and returns the result int Com_AbsClampi(int min, int max, int value) float Com_AbsClamp(float min, float max, float value) Contrains value between min/max, returning the result. Min/Max/Value all use their absolute values (always positive) int Q_irand(int min, int max) float Q_flrand(float min, float max) Returns a random value between min and max (inclusive) float sin(float value) float cos(float value) Standard trigonometry functions int GetWeaponDamage(int weapon) Returns the damage that the weapon does (from the .json file) gentity_t@ CreateMissile(vec3_t start, vec3_t forward, int velocity, int life, gentity_t@ owner) Creates a missile, returning the gentity_t handle of the missile itself. void WP_TraceSetStart(gentity_t@ ent, vec3_t start, vec3_t mins, vec3_t maxs) Given the entity and its start, mins and maxs vectors, sets the start point of the entity (this is to make sure that it doesn't go through walls in some situations) Global Variables - Coordinates for weapon firing - vec3_t wpFwd vec3_t wpRight vec3_t wpUp vec3_t wpMuzzle vec3_t vec3_origin - variable that holds (0, 0, 0)
  22. Well basically you'd need to swap out the viewmodel rendering code with something more akin to how playermodels work. I can try it out, but I'm going to need an actual model and a plan before I proceed. I'd recommend taking one of @@Resuru's or @@Silverfang's weapons, putting a texture on them, and then exporting to both MD3 and GLM (MD3 as more of a fallback in case GLM fails, which at this point I don't yet expect to happen) I know @@Silverfang wants to have idle animations, and there's a possibility for reloading, but not too sure on how that would fit into gameplay yet. You might find Silverfang on #JACoders, and Resuru usually hangs out in #JKGalaxies.
  23. Thanks a bunch again.
  24. @@Serenity937: would you happen to know if Basic has the SFX sabers? I was interested in poking the SFX saber code and putting those into JK2:HD. EDIT: nvm, JA++ has them
  25. Not sure. I tried using the global transformation and it only made things worse. Using the global transformation on the vertices however resulted in the positions being correct.
×
×
  • Create New...