Fair Strides

Fair Strides' Script Shack

Recommended Posts

Yeah, that one should work. If it doesn't work as you want it to, you can try moving the SetGlobalFadeOut below the SetGlobalFadeIn, and then possibly adjust the first number.

Share this post


Link to post
Share on other sites

Yup. it cut to black suddenly on the fadeout.

#holdmuhbeer

 

Hey how does SetFadeUntilScript work?

 

Edited by Kaidon Jorn

Share this post


Link to post
Share on other sites

That's usually used at the start of a dialog (like a cutscene) and keeps the screen black until the first script fires that isn't a conditional (I think it won't fire for a conditional). Then it fades in, IIRC.

Can also be used during module loads so that you can have everything set up and in the right spots, then start a dialog that runs a script or starts a cutscene to fire a script.

Share this post


Link to post
Share on other sites

Got a question...

k_def_disturb01 in a creature's OnDisturbed field,... I know the script is blank and "not currently used", but what was it for? 

Is it like a OnInventoryDistubed on a placeable?

I want to have a droid drop a saber part, then fire a journal entry script.

So is the only way to do this for a creature is have the OnDeath script give you the part and add the journal entry?

Share this post


Link to post
Share on other sites

is there a copy of the K1 k_pdan_makejedi.nss anywhere that's in its original format instead of the 'I decompiled this but now it's just horrible machine code' format? I want to try and add/change a thing or two, but I can't find the source script with kotor tool and I can't make heads or tails of the decompiled .ncs

Share this post


Link to post
Share on other sites

Only global scripts have Bioware's original source. The module scripts are binary only. But I have cleaned up the generated source for a lot of the module scripts in the course of working on K1CP over the last couple of years, especially Dantooine.

#include "k_inc_dan"

void main() {
    
    object oPC = GetFirstPC();
    
    if (GetLevelByClass(CLASS_TYPE_JEDICONSULAR, oPC) == 0 && GetLevelByClass(CLASS_TYPE_JEDIGUARDIAN, oPC) == 0 && GetLevelByClass(CLASS_TYPE_JEDISENTINEL, oPC) == 0)
        {
            TurnPlayerIntoJedi();
        }
    
    ClearAllActions();
}

Many of the module scripts make heavy use of planet-specific include scripts, which you can find in the global source. As such what at first glance seem like large scripts often turn out to be quite simple, once you've cleaned out all the external functions.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

oh my gosh THANK YOU! that is so much more understandable. I think it will be quite a while before I'm anything like good enough at this to wade my way through the binary stuff, but I'll keep that in mind about the include scripts since those might be among the bits I could potentially pick out at least.

Share this post


Link to post
Share on other sites

Hey all

So I wanted to place an invisible placeable on an enemy with his OnDeath script. So that I may have you loot him normally, but have another script fire after you've looted him and gotten the part to the quest.

here's what I could think of...

void main() {
    
    if ((GetJournalEntry("ache_saber") == 20)) {
        CreateObject(64, "ache_lens_cont", GetLocation(GetObjectByTag("infernal_sith", 0)), 0);
                  }
    ExecuteScript("k_def_death01", OBJECT_SELF);
}

So the placeable is invisible and holds the part. Then dings the quest entry. 

Would this work or what am I forgetting/not doing right? 

I appreciate any help.

 

EDIT: Hey nevermind.

What I was doing worked. I just forgot to include the script that jumps the quest entry up. So then i moved the other items he drops to the invisible placeable so there's only one "Remains". Then looting that puts the quest up a notch. Woot. i did it!

  • Like 2

Share this post


Link to post
Share on other sites
41 minutes ago, Kaidon Jorn said:

Looking to get this 'ere script decompiled...

Should be looking like this, more/less --

Spoiler

// k_pend_cut23

void main()
{
	// Participants
	object oEnd_Trask = GetObjectByTag("end_trask");
	// Objects
	object oEnd01_SceneObj03 = GetObjectByTag("end01_sceneobj03");
	object oDarkJediSaber = GetItemPossessedBy(OBJECT_SELF, "g_w_drkjdisbr002");
	// Waypoints
	object oWP_Room8_02 = GetObjectByTag("wp_room8_02");
	
	int nUser = GetUserDefinedEventNumber();
	
	switch(nUser)
	{
		case 5:
			ActionEquipItem(oDarkJediSaber, INVENTORY_SLOT_RIGHTWEAPON, FALSE);
			DelayCommand(0.5, SetLightsaberPowered(OBJECT_SELF, TRUE, TRUE, FALSE));
			ActionDoCommand(SignalEvent(oEnd01_SceneObj03, EventUserDefined(0)));
			break;
		case 10:
			ActionMoveToObject(oWP_Room8_02);
			ActionPlayAnimation(ANIMATION_LOOPING_READY, 1.0, 10.0);
			break;
		case 25:
			ClearAllActions();
			ActionCastFakeSpellAtObject(FORCE_POWER_CHOKE, oEnd_Trask, PROJECTILE_PATH_TYPE_DEFAULT);
			DelayCommand(0.3, ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectChoke(), oEnd_Trask));
			break;
	}
}

-- haven't script for a long-while so I might be missing things there, hahah.

Anyway, with case 25: -- is there any scenario in-game where Bandon choke Trask? Interesting, can't remember though to be honest.

Share this post


Link to post
Share on other sites

Looks like you are using the K1CP modified version there @ebmar. The vanilla script has a slightly different case 10 that introduces a slight hiccup in Bandon's walk forwards. You should use the K1CP version as a basis, I'm just clarifying the situation.

Edit: However, you must use this in conjunction with K1CP's k_pend_cut02, or you will end up with a soft-lock that prevents the cutscene from proceeding.

  • Thanks 1

Share this post


Link to post
Share on other sites

Oh, that I was decompiling the one KJ's attach.

5 minutes ago, DarthParametric said:

You should use the K1CP version as a basis, I'm just clarifying the situation.

Oh, I see -- guess it's all good then. Thanks for the heads-up. 👍

Also, @Kaidon Jorn -- better look/use the one DP's linking there as a basis, it's properly commented rather than I did.

Edited by ebmar

Share this post


Link to post
Share on other sites

Ok, awesome. Thanks to both of you for the heads up. I am using K1CP. This mod should be compatible with that I would think.

So then I need to include k_pend_cut02 when I compile the k_pend_cut23, correct?

Then of course. modify g_bandon001.utc to put the saber in his pack inventory, no?

Share this post


Link to post
Share on other sites
8 hours ago, Kaidon Jorn said:

So then I need to include k_pend_cut02 when I compile the k_pend_cut23, correct?

No, it's not an include. I meant that if you were distributing a mod, you'd have to include K1CP's k_pend_cut02.ncs as well because of the changes I listed above. If you are just making something for your own use and already have K1CP installed then you don't need to do anything.

Although I would advise in future not using content from MODs as a basis. Extract the RIMs instead. Start with the vanilla content, then check if something like K1CP modifies it afterwards.

8 hours ago, Kaidon Jorn said:

Then of course. modify g_bandon001.utc to put the saber in his pack inventory, no?

Not necessarily. Modifying the UTC is certainly one route, but you can also just give him items/equip them via script. Remember that modification of assets that are already stored in the save file (i.e. GIT, spawned NPCs, triggers, etc.) will require restarting the module over again. Scripting is therefore very useful for testing at least, even if you want to end up editing a UTC, etc.

Share this post


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

No, it's not an include. I meant that if you were distributing a mod, you'd have to include K1CP's k_pend_cut02.ncs as well because of the changes I listed above. If you are just making something for your own use and already have K1CP installed then you don't need to do anything.

Although I would advise in future not using content from MODs as a basis. Extract the RIMs instead. Start with the vanilla content, then check if something like K1CP modifies it afterwards.

Not necessarily. Modifying the UTC is certainly one route, but you can also just give him items/equip them via script. Remember that modification of assets that are already stored in the save file (i.e. GIT, spawned NPCs, triggers, etc.) will require restarting the module over again. Scripting is therefore very useful for testing at least, even if you want to end up editing a UTC, etc.

Ah. Alright I see.

I am simply going to inject files into the modules this time anyway since their isn't that many, the rest goes in override.

Thanks

Share this post


Link to post
Share on other sites
int StartingConditional() {
	int int1 = (!GetIsObjectValid(GetItemPossessedBy(GetFirstPC(), "G_W_DBLSBR004")));
	return int1;
}

Returns true if the player doesn't have any G_W_DBLSBR004 (yellow doublesaber), false if they do.

Share this post


Link to post
Share on other sites

Yes thank you. 

I needed to change the saber tags so it looks for the right one. Otherwise it will always return false and you'll end up with doubles.

Share this post


Link to post
Share on other sites

Ok, third playthrough of K1 and I'm realizing that the hurt Wookie in lower Shadowlands still isn't giving the "rough cut wookie amulet".  

Wondering if it's some old problem that's been fixed or should I get this decompiled and mess with it myself?

k_pkas_hurtgive.ncs

This is the script and I don't see one in K1CP folder. Can I get a decompile please?

Share this post


Link to post
Share on other sites

You really should just grab DeNCS.

void main() {
	
	object oPC = GetPCSpeaker();
	object oCrystal = GetItemPossessedBy(OBJECT_SELF, "kas25_wookcrysta");
	
	ActionGiveItem(oCrystal, oPC);
}

The problem is the UTC doesn't actually have the item in its inventory. They used ActionGiveItem because that makes the NPC walk to the PC and do an animation, but it needs to either be switched to a CreateItemOnObject directly spawning it into the PC's inventory, or it needs to first be spawned into the Wookiee's inventory and then given to the PC, or the Wookiee's UTC needs to be edited to add it.

6 hours ago, Kaidon Jorn said:

I don't see one in K1CP folder

If you find a problem that either Community Patch doesn't address, you can just raise an issue for it on the repo. I've added this one (and I also see an issue with the heal scripts).

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.