Jump to content

R2-X2

Modders
  • Posts

    62
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by R2-X2

  1. Yeah, kind of. It's a really strange issue I haven't encountered in other programming situations, since the NSS scripting in KotOR is extraordinarily limited even in its most basic parts compared to writing ordinary code. I have not tested non-party NPCs, though I assume they would be impacted by saves or module transitions of the player the same way.
  2. So the extra attacks effect is listed as "Invalid Effect" by the game, returning a 0. Great. I think globals wouldn't work, since the effect should apply to both party members and generic NPCs, so an arbitrary number of variables would need to be saved. @Salk Basically, I cannot control how frequently this gets called. I need it to be called at some point, but there isn't really a "game started, initialising" script to hijack. So k_ai_master is the best place, since that one runs for everyone. However, here we run into problems: I need to define a duration for the extra attacks effect. But I cannot know when the function will be called again, and the buff effect can stack with itself if applied before the previous ran out. So what I previously did, was to have the script do some things: - Set a local boolean (on the character) that will be set when the buff is applied, in order to not re-apply the effect when it has already been placed. It will only evaluate the other conditions if this one is set to not already on. - Call itself precisely after the buff expires, and knowing that the buff has expired, ignore the boolean when running this way. - Set the boolean back off when the script is being evaluated and no more repeaters detected. This works fine when you are within a module and don't change the party. However, when changing a module or party member, you can run into an issue: The boolean will be on the "buff present, don't run again" status, which usually isn't an issue since the cycle of re-checking itself has been started. But this scheduled execution of the function can get lost during module/character change, causing the boolean to stay stuck on the blocking status because the script that would repeat the evaluation and either restart the buff cycle or reset the buff to "off" when detecting different weapons never executes. It might just be a logical puzzle I haven't solved. But what I'm seeing are the following constraints: - 1. I have a script that gets called a random amount of times over a random span of time. - 2. I can set a local boolean for a character which may randomly be 0 or 1 by the time the script first runs (e.g. after a scene transition, savegame load, etc.) - 3. I only ever want one stack of the effect active, but the effect will stack with itself if called again before expiry. - 4. I cannot detect if the effect is active, nor can I remove it via script. -> My thought was to initiate a recursive script call cycle that is separate from the unreliable heartbeat / AI script runs. But I don't see a way to safely establish this in a way that persists across modules/savegames/party changes due to constraints 1 and 2.
  3. Checking a local boolean is exactly what the current version of the mod script does - which appears to work fine on the PC, but on other party members it will reliably break under certain unequip/save/load circumstances, which is why I want to get away from it. That looks really helpful, yes! Can I use it without the community patch? I'm playing on a non-english language and the handful of bugs in K1 have never bothered me enough. Edit: Ah and regarding not checking NPCs, yeah I'd put the baseitem check before the effect check. Now that said, the effect check hasn't worked for me yet, but I'm not done trying yet.
  4. Ah, this is unfortunate. So I can't even find a value via trial-and-error, since it might be different on someone else's device. Sadly my go-to program (RivaTuner Statistics Server) won't detect KotOR and so I can't limit the fps that way. Because sadly this code here does not appear to work: RemoveEffect(oCheck, eRepAtk); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eRepAtk, oCheck, 4.5); The effect will never correctly be removed it seems, so the ApplyEffect just stacks the effect instead. And I haven't seen a "GetHasEffect" condition in the scripting functions either, sadly. I'm not sure if iterating through "GetNextEffect" every 3-6 seconds for every character on a given map would be very reasonable (I'll now proceed to test if it works in the first place). It should not be a very demanding operation, but with this engine... Any ideas/recommendations?
  5. So I am finally getting around to fix a long-standing bug in my little repeating blaster attacks restoration mod. Due to the previous implementation having an issue with variables malfunctioning upon area transfer and savegame loading (and the script admittedly not being very well written), I have decided to go back to a more simple implementation: Call it on every OnHeartbeat, and add the bonus for the duration of the heartbeat cycle if the weapon baseitem is correct. Now common knowledge is that the OnHeartbeat runs every 6 seconds. This is definitely incorrect, since when applying a buff that lasts for 6 seconds, it will quickly be applied twice and stabilise on that level. So I tried 3 seconds, and could observe that the bonus was never stacked, but had a short window of not being applied. This window varies from cycle to cycle but is below one second. So I would assume the OnHeartbeat runs every 3 to 4 seconds, but not regularly - or the application of effects that happen in the OnHeartbeat script only happens at certain intervals that don't perfectly line up with a say 3 or 4 second cycle. Does anyone by chance know more about this? Edit: When setting the bonus duration to 3.75, the bonus is mostly applied one time, as it should, but there are both times where it is not applied, and times where it is super briefly applied twice. Most confusing.
  6. Hi, R2-X2 here, I will get to this soon hopefully. Was pretty busy the last years and had the mind elsewhere (though it was always in the back of my head). But I think it can be fixed by coding it more crudely, merely using the OnHeartbeat and probably less than half the code, which would have the negative effect of allowing for weapon switches to malfunction for a few seconds (granting an extra attack still or not granting one for a moment), but I guess unless you actively try to game the system, that shouldn't be an issue.
  7. I can't seem to find a way to reliably have the script run the way I intended it. Will probably make it a 6-second buff triggered by the OnHeartbeat function, which runs every 6 seconds, as far as I am aware. This would cause more latency when it comes to changing weapons, but that's probably something that can be endured. How often do people switch their weapons anyway... As for not working together with force speed buffs, I have no idea what could cause this. I'm creating an entirely different effect that has one effect of the same type. Maybe there's something hardcoded in the game that prevents two sources to this effect from being active at the same time.
  8. Ah damn it. Neros had sent me his save files, but I hadn't gotten to checking the issue. Sounds like I screwed up something - will need to rethink the logic. It's probably something really basic... Weird how it's not bugged for the PC, that's probably how I didn't notice it in testing. Edit: It makes total sense. The attacks script calls itself with a 1s delay, so saving and loading during that time will not have the script call persist to after the loading. I wonder where else this might break things... perhaps that's why speedruns use save-load spams to bypass scripted conversations and cutscenes. It should be a relatively easy fix - putting in a "fail-safe" function to check if the boolean persists over more than one second and switch around the order of conditions and results a bit. If someone can remind me to look at it on Friday, that would be great, I am really forgetful at the moment...
  9. Hey there, the extra attacks don't really persist at all, and instead get re-applied every second or less as a temporary 1 second buff (that won't stack, if applied faster), to make sure the attacks count reacts quickly to weapon changes without being too computing-intensive. It's possible to break when starting to attack with a repeater and switching it to a different weapon and immediately attacking afterwards, that the next attack round can still receive the additional attack (or vice versa, missing the additional attack if attacking instantly after a switch, before the buff can be applied), but at the next time you attack, it should always be fine. What are the exact circumstances you had with Mission? You can PM me a save where it doesn't work, maybe I'll find time to take a look. Can you tell me more about these issues? I quickly wrote the blaster rifle including file as per a user's request, but wouldn't have thought there to be any differences to the repeater handling. I'll send you a PM.
  10. Playing Divinity Original Sin 2 right now, and it is an amazing game. And who do I see among the writers when checking the credits? Chris Avellone :D

    1. Tyren

      Tyren

      That's MASTER Chris Avellone to you, sir!

    2. jc2

      jc2

      Take a seat Chris Avellone!

  11. Late to the party, but I also think that the first load screen looks more fitting for an otherwise vanilla game.
  12. The screenshots are absolutely beautiful already. 😍 Might not use it anytime soon since I probably won't play KotOR in a while, but I'm downloading this just to save it.
  13. I don't really feel comfortable with it at this point. Quite some thought went into this (nobody else bothered to fix it in more than a decade) and I don't really want it to be reduced to a random entry on some list. 😕
  14. I don't care if it takes you one week or three years, because I'll still be coming back to KotOR by that time anyway. Take all the time you need!
  15. This particular version, no. But I could make one for TSL if you want. (Even though I think that that game is balanced around the idea of repeaters only having 1 attack per round when you look at their damage values.)
  16. I'd actually argue that KotOR 1's gameplay is better than TSL's. The combat is far more interesting and balanced, the items are more individually interesting, the levelling between non-Jedi and Jedi is more interesting, the level cap adds its own effect to it (an effect I personally approve, because it raises replayability for me and allows for more easy balance than "player could be anywhere between level 25 and 35 in the end game"). For example, in TSL you fight no more than a dozen force users, so many force powers are nearly useless. In K1, you fight quite a large amount, each of them using force powers liberally.
  17. Basically, what the title says. Apparently I can write replies to posts in pretty much any other sub-forum, except in that one. Is this intended..?
  18. Finally I can use my favourite head from K1 in TSL! Will definitely use it the next time I play it.
  19. That's a very nice change with the Rodians! I seem to remember a mod that made Jagi appear like a mandalorian, except in black armour. Don't remember which one it was, but it was pretty cool.
  20. Does anyone know if new on hit effects for items can be added? I'd like to add the knockdown effect to an item (which is possible in TSL, but not K1), and while I find a 2da with the onhit effects, I can't seen to find any actual references. Can't find any in scripts either, so I'm fearing it might be hardcoded. 😕
  21. Not only that, it also affects enemies, so those with repeaters will pack quite an additional punch! It sounds weird but I was pretty glad to see all those additional red numbers over my party when running circles around heavy sith troopers for testing.
  22. Only just came across the thread and only watched the "Sith Reign" mod video so far, but I like your commenting and editing style! Just had to skip some walking sometimes.
  23. I feel like I have to bring this old topic of mine closure (since it was recently linked in other threads) by stating that I finally fixed the issue with repeating blasters not getting their attacks. (The heavy repeater special effects from rapid shot cannot be reproduced since there is no way to check when a combat feat is used, you can only know it after it was used. Additionally, it fould feel very weird compared to all other weapons sharing the same feat effects.) Now only the blaster carbine pricing remains a mystery...
  24. View File Repeating blaster attacks restoration Short story: Repeating blasters were originally intended to give the user an additional attack in every round of combat (like twin-blade melee weapons do). This mod implements that effect. I.e. a character without force speed would normally do 1 attack when using a repeater, 2 when using rapid shot as well. Now, 2 attacks will be done when using the default attack and 3 when using rapid shot. Long story: After investigating in 2015 what could be the reason for repeaters costing more (500 vs 300) credits while having a worse crit range (5% vs 10%) than blaster rifles while having no advantage whatsoever, I found out that repeaters were originally intended to give the user an additional attack per round, sort of making them the double-blades of the blasters. Sadly, this was never implemented, as one internal item comment even comments on. I didn't know enough about scripting back then and quickly lost interest in fixing this. But now, more than 3 years later, it's finally fixed via scripting, placing the required code in the k_ai_master script. Known issues: Due to hardcoded mechanics, power blast can never do more than 1 attack, and sniper shot never more than 2. Normal attack appears to usually only do 2, but may rarely do 3 when using force speed as well. Sadly, these cannot be changed without access to the game code. This information turned out to be incorrect, and the user Darg727 made a fix for this. However, this has a downside: It works by making power blast and sniper shot always shoot 4 shots regardless of how many attacks are available, which looks very strange because all shots that don't have a corresponding attack round are auto-misses. For example, using a sniper shot with a blaster rifle or single pistol will cause 4 shots to be fired simultaneously, like a shotgun blast, with 3 of the 4 automatically hitting the floor/ceiling/wall. Using knight speed would allow 2 of those 4 to hit and only 2 would be an auto-miss, etc.... As per Darg727's upload permissions, I have included the responsible file (weapondischarge.2da) as an optional mod in the download for additional visibility for those people that might want to use the feature but would not come across his modification otherwise. Compatible with any mod that does not edit the k_ai_master.ncs file, and incompatible with any that does. (However, it is easy for any modder to add the compatibility, source is included.) Note that this fix works for both the player and enemies! This can make some fights of the game slightly more challenging. Submitter R2-X2 Submitted 11/20/2018 Category Mods K1R Compatible Yes  
×
×
  • Create New...

Important Information

By using this site, you agree to our Guidelines.