Snigaroo

Mod Build Request Thread - KOTOR

Recommended Posts

57 minutes ago, Salk said:

a player on stealth should bypass the second trigger

Not possible in K1. There are no script functions to detect whether a creature is in stealth or not. That functionality was only added in TSL.

Share this post


Link to post
Share on other sites
3 hours ago, DarthParametric said:

Not possible in K1. There are no script functions to detect whether a creature is in stealth or not. That functionality was only added in TSL.

Not even with a workaround?

Like a combination of GetSoloMode() + a check for Invisibility effect / Movement speed?

Share this post


Link to post
Share on other sites

Stealth is hardcoded, it isn't applied as a spell effect. There's nothing detectable. That's why Obsidian added a function for it (and why ClearAllEffects doesn't remove it). You can test it yourself using the CP_ListEffects function from cp_inc_debug which will pipe out a list of all applied effects on the supplied creature to the Feedback window.

Share this post


Link to post
Share on other sites
11 hours ago, Snigaroo said:

@Hunters Run is still active, so yes certainly this is an option. I am always hesitant to ask modders to change content that they've already produced to fit my standards, unless they've specifically requested build consideration. However, if he's amenable and willing to bear with me probably needing a month or two before I can do a test playthrough of the mod and make a definitive list of what I'd want to see out of an update, I of course have no problem working with the existing mod.

After looking through the mod as it currently stands it probably could use a cleanup. Only problem is when. Things are slow right now.

As it pertains to the mod build, go ahead the que is now open to take improvements.

Share this post


Link to post
Share on other sites
14 hours ago, Salk said:

Going the Selven way is fine and dandy, but I think a player on stealth should bypass the second trigger without problems though. I don't remember what happens if you try to sneak in Selven's room while in stealth mode, but in Selven's case I'd go for an automatic detection.

13 hours ago, DarthParametric said:

Not possible in K1. There are no script functions to detect whether a creature is in stealth or not. That functionality was only added in TSL.

It should be possible to get around that restriction by checking if the NPC has perceived the player through their perception event. I don't know if there is an existing function to check if arbitrary creature x has perceived arbitrary creature y, but it could be tracked with local variables if necessary.

Share this post


Link to post
Share on other sites

Based on my experience with Xor, trying to rely on perception events is not going to work reliably. Besides, the entire point of stealth is that creatures don't perceive you.

Share this post


Link to post
Share on other sites
23 hours ago, Snigaroo said:

I understand that logic, however at least two merchants mention carrying swoop parts: the Rodian Czerka clerk on Tatooine and the Ithorian droid merchant on Manaan

Right. 

That part can be easily taken care of and in different ways. What I'm concerned about is: can we actually do anything to the bike used in the K1 game? Is it possible to, for instance, change its max speed? Because that's the main issue here. I have no idea whether we can modify the performance of the swoop bike used in the races.

Share this post


Link to post
Share on other sites

There are script functions that set the bike's speed/max speed/acceleration, presumably used with the boost pads. You could probably just set some globals for having mods installed and then add a multiplier to the speed/acceleration based on a check of those.

Edit: For example, when you hit a boost pad it checks the global for what gear you're in (MIN_RACE_GEAR) and, if you aren't in 5th gear, applies:

SWMG_SetPlayerAccelerationPerSecond(SWMG_GetPlayerAccelerationPerSecond() * 1.1);
SWMG_SetPlayerSpeed(SWMG_GetPlayerSpeed() * 1.05);

Similarly, if you hit an obstacle, it applies:

SWMG_SetPlayerSpeed(SWMG_GetPlayerSpeed() * 0.7);

For the purposes of mods, you wouldn't want to directly affect the current speed, so you'd likely stick to starting with:

SWMG_SetPlayerMinSpeed
SWMG_SetPlayerMaxSpeed

at the beginning of a race. Additionally you might also want to increase the performance of boost pads and/or reduce the effect of obstacles, depending on the mods installed. Or you could even do the opposite, decrease the effectiveness of boosts and increase the penalty of hitting obstacles, if you wanted certain mods to have drawbacks as well as bonuses. Or some combination thereof (e.g. a "Heavy Plating" mod that reduces max speed and the benefits of boost pads, but lets you plow through obstacles with a minimal reduction in speed).

  • Like 1

Share this post


Link to post
Share on other sites

I don't know how I missed this in my initial notes, but I have added one additional request that I forgot (Make T3 An Actual Character).

Share this post


Link to post
Share on other sites
On 5/24/2024 at 8:24 AM, DarthParametric said:

For the purposes of mods, you wouldn't want to directly affect the current speed, so you'd likely stick to starting with:


SWMG_SetPlayerMinSpeed
SWMG_SetPlayerMaxSpeed

at the beginning of a race.

I guess the script to work on is oncreate.ncs found in tat_m17mg and manm26mg?

I was thinking one merchant may sell a mod that improves speed while the other would sell one that improves acceleration. Simple enough, if it works properly. I guess there is no unused icons for swoop bike mods in either K1 or K2? In that case, we'll need to create them and I'll need help there.

Share this post


Link to post
Share on other sites
3 minutes ago, Salk said:

I guess the script to work on is oncreate

Depends on what the upgrades do. I'd expect multiple scripts would need to be edited.

5 minutes ago, Salk said:

I guess there is no unused icons for swoop bike mods in either K1 or K2?

You could probably use some TOR icons as a starting point. They have hundreds to choose from. There's probably something appropriate amongst those used for ship/weapon/armour upgrades. I extracted some for ebmar a couple of years back, but no doubt there have been a bunch of new ones added since.

  • Like 1

Share this post


Link to post
Share on other sites
13 hours ago, DarthParametric said:

Depends on what the upgrades do. I'd expect multiple scripts would need to be edited.

At least initially, I would like to keep things simple: one mod to raise speed and one to raise acceleration. I'm not sure I'd like to introduce more complex upgrades with drawbacks or changes to the obastacle hits and boost pads.

I checked the vanilla script database you built and I cannot find there the decompiled heartbeat.ncs unfortunately.

In the decompiled onfire.ncs script (Should "// Byte code does not match" be a concern,  by the way?), I find some numerical values set for SWMG_SetPlayerMinSpeed, SWMG_SetPlayerMaxSpeed and SWMG_SetPlayerAccelerationPerSecond. I guess this part covers the hyper speed state of the swoop?

Overall, I wonder if I'm biting off here more than I can chew.

Share this post


Link to post
Share on other sites
1 hour ago, Salk said:

I cannot find there the decompiled heartbeat.ncs unfortunately

Yes, those are still in my "cannot decompile" folder, comprising 3 of the last 11 remaining scripts. Not sure if @JCarter426's recent TSL successes would allow for any headway on these or not. Although I do have some that @th3w1zard1 produced for me a while back. Probably need to take a look at those.

1 hour ago, Salk said:

Should "// Byte code does not match" be a concern,  by the way?

You'd have to compile the NSS in question, then disassemble it and compare the bytecode to the vanilla script's to see what the disparity is. Nothing obvious in the source stands out, although I wouldn't be surprised if it was the format of the tunnel struct.

Edit: Looks like

SWMG_SetPlayerTunnelPos([0.0,0.0,20.0]);

should instead be

SWMG_SetPlayerTunnelPos([20.0,0.0,0.0]);

1 hour ago, Salk said:

I guess this part covers the hyper speed state of the swoop?

A brief perusal of a couple of the onfire scripts looks like it is defining performance values for each individual gear, given that it is referencing the global for gear selection. Seems like it would be pretty easy to add in some checks for upgrades being installed to adjust those. Just add in some multiplier variables that default to 1.0, then do a check for upgrades and adjust the multipliers based on that.

Share this post


Link to post
Share on other sites

I preliminarily made changes to the onfire.ncs and obstacle.ncs scripts that are used in the racing minigames.

I guess I'll need to test how this translates into the minigame itself and see if JC or th3w1zard1 can help out with decompiling the heartbeat script, if necessary.

Cheers!

Share this post


Link to post
Share on other sites
On 5/23/2024 at 8:11 AM, Snigaroo said:

I understand that logic, however at least two merchants mention carrying swoop parts: the Rodian Czerka clerk on Tatooine and the Ithorian droid merchant on Manaan.

Snigaroo,

I checked the Czerka clerk's dialogue and he's saying: "Oh, a swoop-jock, hm? I know I don't have the crazy suicide parts you're looking for." Could it be that you were thinking of someone else?

Share this post


Link to post
Share on other sites
4 hours ago, Salk said:

I checked the Czerka clerk's dialogue and it actually seems like he's saying he actually says: "Oh, a swoop-jock, hm? I know I don't have the crazy suicide parts you're looking for." Could it be that you were thinking of someone else?

Ah, I just remember him talking about swoop stuff and misremembered him saying he had items in stock. If that's the case, I think only the Czerka clerk on Tatooine explicitly mentions owning parts, but I am much less expert in K1 than K2, so even having just replayed it I might not know about edge case dialogue where other merchants might mention swoop items.

Share this post


Link to post
Share on other sites

I fear neither vendors explicitly speaks about selling swoop parts, although Wookieepedia reports Yortal's Emporium as a second hand shop where swoop bikes part can be purchased so it's not a stretch to have him sell a bike upgrade. The Czerka clerk instead says explicitly he doesn't sell any. But since I have now done most of the work for this, I will have Junix Nard sell the other in Tatooine.

Share this post


Link to post
Share on other sites

Wow, 0/2 eh? I must have really been spacing out when I was listening to their dialogue.

Share this post


Link to post
Share on other sites
10 minutes ago, Snigaroo said:

Wow, 0/2 eh? I must have really been spacing out when I was listening to their dialogue.

Well, to your credit there is a K1 quest where you can help a fellow swoop racer improve his time by lending him money to buy a swoop upgrade.

  • Like 1

Share this post


Link to post
Share on other sites

I'd rather not add NPCs to the game. One of the two upgrades will be for sale at Yortal's Emporium. I think the other will be obtainable as final reward from the Pazaak player Kudos on Tatooine, replacing the original prize (a vibration cell). Actually, after a brief research, the only place that makes 100% sense for the upgrades to be on sale is Yuka Laka's on Tatooine. Sorry, Manaan. Both the upgrades will be there. 

Now I wish even more that we'd have stores signs on Tatooine. 🙂

Share this post


Link to post
Share on other sites

Pretty sure the manaan Ithorian should sell swoop parts

Sith Soldier: You got any armor plating for my swoop bike?
Yortal Ixlis: Yes, I have a fine piece right here. A little dented, but still serviceable. And a real bargain at that price.

Share this post


Link to post
Share on other sites
1 hour ago, darthbdaman said:

Pretty sure the manaan Ithorian should sell swoop parts

Sith Soldier: You got any armor plating for my swoop bike?
Yortal Ixlis: Yes, I have a fine piece right here. A little dented, but still serviceable. And a real bargain at that price.

Aha! That was what I was thinking of--I'm glad I'm not quite as out of my mind as I thought.

Share this post


Link to post
Share on other sites

Yes, one upgrade will be at Yortal's but that cutscene seems to mostly hint at the fact that the merchant there sells second hand, repaired swoop bike party replacements rather than real upgrades. Nonetheless it's good enough for me.

The other upgrade will be at Yuka's.

I should be ready with the mod tomorrow.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.