Crossroad self fixes

I am trying to fixup Crossroad for the OC.

The special mission time bugs - organizing men while a spec mission is on[costing more than 1 time unit] renders the mission uncompletable.
Which scripts control the time unit passing? I just want to set all missions to cost 1 time unit for now.

Any way to get Light Heavens, Joy to appear earlier instead of Act 3. - being greedy here… :wink:

To allow the keep stats to improve even when time passed = 100%, possible?

I’ll put more questions later.

Time unit passing is controlled by entering and leaving the area (really, it’s in the onEnter/onExit scripting), so you can advance time just by leaving and re-entering the keep. There might be other scripts that advance time, I don’t remember. iirc the special missions have their own scripting run when they are started indicating how many time units are needed for the mission, so you’d have to look at those.

The various sargents such as Kana and Light of Heavens could be manually put in or spawned in via the area scripts. I don’t know when they are supposed to be available, but if one isn’t available when they should be due to a bug, it should be possible to spawn them in via a fix in the area onEnter script.

Erm Kana is already available when you start the keep.

Heavens & Joy are available when Act 3 starts, I want to push them to Act 2 when you own the keep.

[
Keep time increases 2.5% every time you enter a new area in the keep
]

Any way to change the time passed to 1%? Cant find where this is controlled.

=======

Most of the control is in 21_inc_crossroad script.

I’ll work on it and see.

To make a script work, I have to use the toolset to compile it, and all the other scripts that are under [include], correct?

you have to find the calling script — the void main() or int StartingConditional() — and compile that script

How about this example;
[
// 21_inc_crossroad
/*
Include for Crossroad scripts
*/
// ChazM 7/11/05
// ChazM 8/31/05 - constants and some functions moved to 21_inc_cr_vars
// FAB 10/12/2005 - Added Recruit counting
// ChazM 10/12/05 - integrated recruit counting into recruit spawning
// Tevans 1/19/06 - Added companion spawning function
// Tevans 3/9/06 - Added a bunch of stuff for calculating sergeants deployment
// 9/27/06 - BDF: changed SpecialMissionResults() so that JUST_COMPLETED increments (instead of binary TRUE/FALSE)

#include “ginc_object”
#include “21_inc_cr_vars”
#include “ginc_debug”
#include “x0_i0_walkway”

const string PROCESSED_SUFFIX = “_P”;
const string TIME_UNITS_TRAINED = “01_TUT”;

const string RR_INJURED_GREYCLOAK = “21_injured_gc”;
const string TAG_COT = “21_greycloak_cot”;
const string SPECIAL_MISSION = “SpecialMission”; // tracks which Special Mission intro has been opened by Kana

const int MAX_INT = 1000000; // change to Max Int once found

//void main (){}

]

Thats the start of 21_inc_crossroad script. Void main is empty. So just compile this script will suffice? Then put into override folder?

I guess I should go read tutorials, but my experience with tutorials is that they dont deal with editing, and only demonstrate how to create a new script.

I can understand better with real examples so pardon me posting so much here.

I found kana’s dlg and moved it to override to fix the smart tithe bug, and will see if anything else needs fixing in there too.

Found Heaven’s spawn script;

// Check on Light of Heavens
object oArea = GetArea(oPC);
string sArea = GetTag(oArea);
object oLight = GetObjectByTag("31_light");
int nLightHere = GetLocalInt(oArea, "LightWasHere");
int nLightReject = GetGlobalInt("bRejectedLight");

// See if Light of Heavens should be spawned here	
if ( !GetIsObjectValid(oLight) && nLightReject == 0 && nLightHere == 0 )
{
	// Create Light of Heavens at her waypoint in either the Merchant Quarter or Port Llast.
	// SCRIPTER: Spawn a more powerful version of Light of Heavens depending on how many PC's are in the party.
	location lLightLoc = GetLocation(GetObjectByTag("sp_" + GetStringLeft(sArea, 4) + "_light"));

	CreateObject(OBJECT_TYPE_CREATURE, "31_light", lLightLoc);
	SetLocalInt(oArea, "LightWasHere", 1);

From What I understand, need to create/designate a location in the module for her to spawn. And need to add a condition to spawn only when keep is owned - she cant be running around when you visit merchant district 1st time.

Joy is already placed in the act3 version of merchant district, inside the city A3 module, since there is only an animation script for her.

// Joy can dance if she wants to
object oJoy = GetObjectByTag("31_joy");
if (GetIsObjectValid(oJoy))
	PlayCustomAnimation(oJoy, "dance02",TRUE);

So need to cut her from the A3 area and move into Merchant Quarter module or city A2 module? A2 has no merchant district area.

This is getting to be a major project for me.

Moving Heavens is a lot of work;

// Check on Light of Heavens
object oArea = GetArea(oPC);
string sArea = GetTag(oArea);
object oLight = GetObjectByTag("31_light");
int nLightHere = GetLocalInt(oArea, "LightWasHere");
int nLightReject = GetGlobalInt("bRejectedLight");

// See if Light of Heavens should be spawned here	
if ( !GetIsObjectValid(oLight) && nLightReject == 0 && nLightHere == 0 && nDeekinAtCK > 0 )
{
	// Create Light of Heavens at her waypoint in either the Merchant Quarter or Port Llast.
	// SCRIPTER: Spawn a more powerful version of Light of Heavens depending on how many PC's are in the party.
	location lLightLoc = GetLocation(GetObjectByTag("sp_" + GetStringLeft(sArea, 4) + "_light"));

	CreateObject(OBJECT_TYPE_CREATURE, "31_light", lLightLoc);
	SetLocalInt(oArea, "LightWasHere", 1);
}

Use nDeekinAtCK > 0 to spawn after picking up deekin.

Put the code into the enter script for merchant quarter module.

Cut the spawn point from A3 and pasted into merchant quarter module, merchant q area.

Anything I missed?

it’s just an #include file, and main() is there only for testing its syntax/grammar. If you change any of the constants/functions in it, any script that uses whatever is changed [and has either a main() or a StartingConditional() function] should be recompiled.

that’s the simple/easy answer.

 
more technically, main() is an entry-point function and the #includes that it needs to compile [successfully] are its script’s dependencies.

Ps. you might find this amusing in yer spare time …
Basic Scripting (not so basic)

there are also

const int TU_CAP_NONE     = 0;
const int TU_CAP_ILLEFARN = 1;
const int TU_CAP_ACT2_MAX = 2;
const int TU_CAP_LUSKAN   = 3;
const int TU_CAP_REAVER   = 4;
const int TU_CAP_REFORGED = 5;
const int TU_CAP_ACT3_MAX = 6;

int CurrentTimeUnitCap();

that is, keep time will be capped (no matter how many times the area is entered) until conditions to remove the cap are met

1 Like

Does this allow time to keep going past 100%?

if (iTimeUnits >= 40)
{
//	iRet = TU_CAP_ACT3_MAX;
}

commenting out that line.

looks like it

CurrentTimeUnitCap() is called by scripts

‘2100_court_cliententer’
‘21_c_time_unit_cap’

 
So after making the change in ‘21_inc_crossroad’
recompile those two scripts.

 
uh, you know these changes won’t show up in reloaded Saves?

I have copied all the OC modules to the document folder to play with. And made a backup of them.

When I am satisfied I will overwrite those in the base folder - installation directory/modules

That will be long time aways yet.

What is scriptcomplier.exe used for? it just pops up, then closes. Is it an engine utility?

==========

Anything I missed in moving just 1 npc around?

not sure, but I think its for compiling scripts (i can’t say for sure partly because I don’t compile scripts in the toolset)

I’m not sure what you’re trying to do w/ Light. There are several places she can spawn/appear.

1st she has to be fought 3 times:

‘3063_cliententer’
‘2200_cliententer’
‘2112_farm_enter’ (i think this is also her spot after she’s recruited)

She can also take part in the Divine Connection scene:
‘31_trsn_cs_divine’
and if she’s recruited, the Infernal Connection scene never happens:
‘31_trsn_cs_infernal’

So i don’t know if you want to change the places she is available to fight, or change her spot after she’s been fought and recruited, or do away with the trials and just make her your buddy automatically so she appears at the keep after Deekin is recruited …

she’s one of the — if not The — most complicated spawn in the OC. so i think it’s safe to assume that the answer to your question is “yes”

I think making her appear after deekin appears is much better…

To do that I will have to look at the join functions right? Then remove/comment the spawn fight scripts in merchant 3, llast, keep.

Anything else other than that?

Actually theres not much to her 3 duels - the script checks for a waypoint named light, and the int that sets when she has been fought. they are put into the enter area scripts of merchant 3 and llast. after she has been fought the int is set so that she does not reappear at the same spot.

Is there a need to bake module when only removing spawn points and npc and changing scripts/dialogs? My understanding is that baking is to create walk paths and removing/adding people should not really involve pathing since walking chars can push others…

no need to rebake. Rebaking is needed only when you distinctly want to change the walkmesh: perhaps after moving around placeables, or using walkmesh cutters/helpers, or changing terrain level/textures/colors/ etc.

technically you want to look at the join variables – their getters/setters will be functions, but really you’re tracking the variables …

i like the idea, don’t know why but i tend to like quirky things like that

After thinking it over, its really easier to make her appear after another npc joins = less work :wink:

Thanks for pointing out all the things I missed. I have not found such a great game to self mod since C&C.

Right now I am also trying out having Amie survive her death… its rather nice to have a pack mule running around. I believe its the same function used for shandra - you cannot remove her from party, but she takes up a slot unlike shandra who hangs around but does not take a slot. The sexy addon makes them lovely to have around.

Oh well the debug can solve that problem hehe.

there’s a … thread, about that …

I took the folder amie from here;

https://neverwintervault.org/project/nwn2/script/nwn2-plot-fixes

So far no bugs.

1 Like

I;m trying to remove the time cap function to let keep time flow freely…

Commenting out the functions does not seem to work.

21_inc_crossroad
21_time_unit_cap

Anywhere else I have to dig?

==========

By having a module in documents/module, and script in override folder seems to cause the module script to be priority over the override folder’s script.

Well now theres more problems, the miners disappear, the weaponsmith disappears too… heh this isnt so easy…

i’ve been staring at code every day for over 10 years and yes the keep isn’t easy,

  • if a compiled script is in /override (not just the #include) it will take precedence. (provided you’ve reloaded the game…)

  • when overriding scripts like this, get in the habit of at least putting a debug message near the top of the function:

    SendMessageToPC(GetFirstPC(), "<scriptname> is running woohoo");
1 Like

I have a save just before going to keep for the 1st time.

You saw theres a cheat function script right in the module, but still have not discovered a way to activate them.

Right now time flows freely, but the spec missions stop appearing after the bugbears… long way to go for me.

The test stronghold module is a little difficult cause the ore is not processed.