Aller au contenu

Photo

Sections of a Module Refusing to Bake.


  • Veuillez vous connecter pour répondre
24 réponses à ce sujet

#1
Sabranic

Sabranic
  • Members
  • 306 messages

Currently I am dealing with several problems in a module with regards to scrips firing and an area utterly refusing to properly bake. 

 

In our ToH module, there is a room containing a fountain, which I decided to move and improve upon for game play and aesthetic reasons.  I erased the old water, moved the fountain slightly towards the room's center, added some new water, added VFX, sent the entire thing to walkable and fianally painted a new walk-mesh cutter around it. 

 

No matter how many times I change things and bake the level, the new water never appears and the old pool of water remains.  I've tried deleting the tiles and then baking different ones in the same location to no effect.  I've also removed all the placeables, leaving only the walkmech cutter and the water and baked several times.  I've tried backing with a different tileset in those tile locations.  I also tried exporting the level, deleting it, saving, and re-importing it.

 

Additionally, there are five scripts that will not fire on entrance to the room... BUT... if I export the module and open it as a stand alone, outside the campaign... the scripts WILL properly spawn mobs...  I believe both issues are tied together.

 

Here is how the room appears in-game:

 

problem_1.jpg

 

Toolset views:

 

problem_2.jpg

 

 

problem_3.jpg

 

Additional weird behavior - the game registers and bakes the walk-mesh cutter around the fountain.  However, it does NOT stop your character when crossing it.  It continually allows you to run right through it, and it then rubber-band snaps you back in place after 5 or so seconds.

 

 

Edit: I just tried extracting this area, importing it into a brand new module and baking it as a stand alone.  Same issue.  I am beginning to lean towards some form of corruption.



#2
Sabranic

Sabranic
  • Members
  • 306 messages

Update: I rebuilt the area as a stand alone, and re-imported it into the module.  I cut and paste all of the elements from the old throne module into it and then deleted the bugged(?) throne module.  This corrected the issue with the area which refuses to bake - by doing away with it entirely.  While I can now make changes to the area and successfully bake the terrain, the five scripts that control a series of animated sword still will not fire unless I remove a different area (the_final_level).  Something in that other area is preventing the scripts from executing in throne room.

 

The scripts that won't fire are:

a_dance_death1

a_dance_rest_hb1

a_dance_set_off1

a_dance_set_on1

a_dance_set1



#3
Tchos

Tchos
  • Members
  • 5 042 messages

Are your scripts looking for objects by tag that exist in both of the areas you're talking about?  If so, it may be performing actions on the object in the area you're not in.


  • Sabranic aime ceci

#4
Sabranic

Sabranic
  • Members
  • 306 messages

I don't think so, unless... way-points/triggers need to be baked to add/remove. 

 

I think this entire fiasco is being  caused by the area I had to split.  The issue is I can't re-bake it that area, as it uses some very cool but very custom tile-set that won't bake properly for me.  I am trying to create duplicates of the scripts attached to new triggers/waypoints and see if I can get it to work that way.



#5
Tchos

Tchos
  • Members
  • 5 042 messages

Your reply doesn't really answer what I was trying to troubleshoot.  Baking doesn't have anything to do with waypoint placement.  I was asking about the tags.  The scripts don't necessarily need to have different names, since a single script can be written that works on different objects, but generally waypoints need different tags unless you're getting them with methods that ensure you're picking the right one.  In other words, unless it's a unique tag in the entire module, you may be picking one in a different area.


  • Sabranic aime ceci

#6
Sabranic

Sabranic
  • Members
  • 306 messages

EDIT: See next post.

 

 

Sorry about that, I will try to be a bit more detailed here.

 

Here are the scripts:

 

a_dance_death1

//Put this script OnDeath
void main()
{
	object oPlaceable = GetNearestObjectByTag("c_dance1", GetObjectByTag("dance_point1"), 1);
	
	DestroyObject(oPlaceable, 0.0, FALSE);

	int nDancers = GetGlobalInt("dancers2");
	
	SetGlobalInt("dancers2", nDancers-=1);
}

a_dance_rest_hb1

//Goes on creature's OnHeartbeat.
void main()
{
	
	object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC);
	
	if (GetLocalInt(GetObjectByTag("dance_point1"), "respit1") != 1) return;
	
	DestroyObject(OBJECT_SELF);

}

a_dance_set1

void main()
{
	SetGlobalInt("dancers2", 5);
}

a_dance_set_off1

//Put this script OnEnter
void main()
{	
	object oPC = GetEnteringObject();
	
	if (!GetIsPC(oPC)) return;
	
	if (GetLocalInt(GetObjectByTag("gold_crown"), "equipped") == 1) return;
	
	if(GetGlobalInt("dancers2") == 0) return;
	
	SetLocalInt(GetObjectByTag("dance_point1"), "respit1", 1);
	
	SetLocalInt(GetObjectByTag("dance_point1"), "once1", FALSE);
}

a_dance_set_on1

//Put this script OnEnter
#include "nw_i0_generic"
void main()
{
	object oPC = GetEnteringObject();
	object oPlaceable = GetNearestObjectByTag("c_dance1", oPC, 1);
	
	if(GetLocalInt(GetObjectByTag("dance_point1"), "once") == TRUE) return;
	if(GetLocalInt(GetObjectByTag("gold_crown"), "equipped") == 1) return;
	if(!GetIsPC(oPC)) return;
	if(GetGlobalInt("dancers2") == 0) return;
	if(oPlaceable == OBJECT_INVALID) return;
	
	SetLocalInt(GetObjectByTag("dance_point1"), "respit1", 0);
	
	int nShields;
	for (nShields = 0; nShields < GetGlobalInt("dancers2"); nShields++)
	{
		object oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "dancing_sword", GetLocation(GetWaypointByTag("wp_dance1")));
		
		SetIsTemporaryEnemy(oPC, oSpawn);
		AssignCommand(oSpawn, ActionAttack(oPC));
		AssignCommand(oSpawn, DetermineCombatRound(oPC));
	}
	SetLocalInt(GetObjectByTag("dance_point1"), "once1", TRUE);
}

Generic Trigger: TAG - swords_off1 - On Enter: a_dance_set_off1

Generic Trigger: TAG - swords_off2 - On Enter: a_dance_set_off1

Generic Trigger: TAG - swords_on1 - On Enter: a_dance_set_on1

Generic Trigger: TAG - swords_on2 - On Enter: a_dance_set_on1

Waypoint: TAG - swp_dance1

Ipoint: TAG - sdance_point1  (Strange looking red flag with a waving design)

5x Plaque {Swords - TINT}: TAG - c_dance1

 

Functionality: The blue devil-face when interacted with dumps the unfortunate target into a room with a fountain and one exit.  If the player attempts to leave by that exit, (thus entering area swords_on1),  limitless numbers of swords and shields are spawned at swp_dance1 until they player dies or walks backwards over area swords_off1, which causes them all to de-spawn.  Any players on the outside attempting to enter from the front will have the same effect - unlimited numbers of vorpal swords are spawned from area swords_on2 until the player backs out over area swords_off2, which again de-spawns them.  I don't know what the Ipoint does, I think it's a sound effect of some form, but I am not certain.

 

 

The scripts work properly if I remove the area the_final_level,  However, it puzzles me, since I have used the Area Contents tab and visual inspection to make certain that waypoint swp_dance1 does not exist elsewhere, and just to make sure that was not the issue, I made copies of all of the scripts and everything they interacted with in the module, and then changed their code so they were native to the area, interacting with new tags.



#7
Sabranic

Sabranic
  • Members
  • 306 messages

Well, now its stopped working entirely, so i think I screwed the scripts up.  Going to revert them back to their original form.  Please don't spend a bunch of time fixing what I apparently broke with my hamifisted attempts at noodling with. 



#8
kevL

kevL
  • Members
  • 4 056 messages
go back to the originals. Put a debug right after void main() in each one,

SendMessageToPC(GetFirstPC(FALSE), "name_of_script");

and recompile. That will say whether the scripts are firing or not, or if the problem is further down the line .....
  • Sabranic aime ceci

#9
Sabranic

Sabranic
  • Members
  • 306 messages

Here are the scripts and way-points returned to their normal state:

 

a_dance_death

//Put this script OnDeath
void main()
{
	object oPlaceable = GetNearestObjectByTag("c_dance", GetObjectByTag("dance_point"), 1);
	
	DestroyObject(oPlaceable, 0.0, FALSE);

	int nDancers = GetGlobalInt("dancers");
	
	SetGlobalInt("dancers", nDancers-=1);
}

a_dance_rest_hb

//Goes on creature's OnHeartbeat.
void main()
{
	
	object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC);
	
	if (GetLocalInt(GetObjectByTag("dance_point"), "respit") != 1) return;
	
	DestroyObject(OBJECT_SELF);

}

a_dance_set

void main()
{
	SetGlobalInt("dancers", 5);
}

a_dance_set_off

//Put this script OnEnter
void main()
{	
	object oPC = GetEnteringObject();
	
	if (!GetIsPC(oPC)) return;
	
	if (GetLocalInt(GetObjectByTag("gold_crown"), "equipped") == 1) return;
	
	if(GetGlobalInt("dancers") == 0) return;
	
	SetLocalInt(GetObjectByTag("dance_point"), "respit", 1);
	
	SetLocalInt(GetObjectByTag("dance_point"), "once", FALSE);
}

a_dance_set_on

//Put this script OnEnter
#include "nw_i0_generic"
void main()
{
	object oPC = GetEnteringObject();
	object oPlaceable = GetNearestObjectByTag("c_dance", oPC, 1);
	
	if(GetLocalInt(GetObjectByTag("dance_point"), "once") == TRUE) return;
	if(GetLocalInt(GetObjectByTag("gold_crown"), "equipped") == 1) return;
	if(!GetIsPC(oPC)) return;
	if(GetGlobalInt("dancers") == 0) return;
	if(oPlaceable == OBJECT_INVALID) return;
	
	SetLocalInt(GetObjectByTag("dance_point"), "respit", 0);
	
	int nShields;
	for (nShields = 0; nShields < GetGlobalInt("dancers"); nShields++)
	{
		object oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "dancing_sword", GetLocation(GetWaypointByTag("wp_dance")));
		
		SetIsTemporaryEnemy(oPC, oSpawn);
		AssignCommand(oSpawn, ActionAttack(oPC));
		AssignCommand(oSpawn, DetermineCombatRound(oPC));
	}
	SetLocalInt(GetObjectByTag("dance_point"), "once", TRUE);
}

Generic Trigger: TAG - swords_off1 - On Enter: a_dance_set_off

Generic Trigger: TAG - swords_off2 - On Enter: a_dance_set_off

Generic Trigger: TAG - swords_on1 - On Enter: a_dance_set_on

Generic Trigger: TAG - swords_on2 - On Enter: a_dance_set_on

Waypoint: TAG - swp_dance

Ipoint: TAG - sdance_point  (Strange looking red flag with a waving design)

5x Plaque {Swords - TINT}: TAG - c_dance

 

The above is a working version, as it was originally written by Morbane before I took a, (very dull apparently), meat cleaver to it in an attempt to be too-smart-by-half. 



#10
Sabranic

Sabranic
  • Members
  • 306 messages

go back to the originals. Put a debug right after void main() in each one,

SendMessageToPC(GetFirstPC(FALSE), "name_of_script");

and recompile. That will say whether the scripts are firing or not, or if the problem is further down the line .....

 

Doing that right now.  Thanks!



#11
Sabranic

Sabranic
  • Members
  • 306 messages

Yes is prints name of script when I enter the areas.  It's firing.  Its either now spawning the swords or it's sending them somewhere else.  combing over the module looking for a duplicate place they might be going.

 

Edit: I wonder if the heartbeat on a_dance_rest_hb is a problem?



#12
kevL

kevL
  • Members
  • 4 056 messages
here's a fancy script you can pause the game and run at any time

// 'countobjects'
//
// Run from the console to find objects w/ tag "sTag".
// eg.
//
// rs countobjects("tag")
//
//
// NOTE: Tags are case-sensitive.
// NOTE: Does *not* look inside inventories.


void main(string sTag)
{
    SendMessageToPC(GetFirstPC(FALSE), "\n");
    SendMessageToPC(GetFirstPC(FALSE), "Search Areas for ( " + sTag + " )");

    object oObject;

    object oArea = GetFirstArea();
    while (GetIsObjectValid(oArea))
    {
        SendMessageToPC(GetFirstPC(FALSE), ". search Area : " + GetName(oArea) + " ( " + GetTag(oArea) + " )");

        oObject = GetFirstObjectInArea(oArea);
        while (GetIsObjectValid(oObject))
        {
            if (GetTag(oObject) == sTag)
            {
                SendMessageToPC(GetFirstPC(FALSE), ". . TAG found");
            }
            oObject = GetNextObjectInArea(oArea);
        }
        oArea = GetNextArea();
    }
}

  • Sabranic aime ceci

#13
Sabranic

Sabranic
  • Members
  • 306 messages

glee!!!

 

I will give it a shot.



#14
Sabranic

Sabranic
  • Members
  • 306 messages

Ok, so then.  This is getting "fun."

 

When I save the module as a directory, which is how I began working on it, I can bake things just fine, and everything is where it is supposed to be when I run a test game.  The very second I save the module as a single file, it forgets everything I baked, and now we are back to the green pool of water floating in midair and other nastiness.  If I save the module back as a directory, I can interact with the walkmesh cutters and see all the baked changes just fine... the difference is saving as a directory and saving as a single file.  That one change is it all it takes to make the area render properly.

 

It's like there are two versions of the area, and the game is grabbing a different one, but only when the game is saved as a stand alone file.

 

I am wondering if this is in any way related to the level I had to split in half?



#15
Tchos

Tchos
  • Members
  • 5 042 messages

It's possible to have both a directory version and a .mod version at the same time.  That can cause problems.

 

Personally, I hate the single file versions and never use them.


  • Sabranic aime ceci

#16
Sabranic

Sabranic
  • Members
  • 306 messages

I am beginning to hate them too.



#17
Sabranic

Sabranic
  • Members
  • 306 messages

Ok, it seems this is going to get ugly.  I am going to have to bake the level I split in half.  There are pathing issues I don't even begin to know how to correct.



#18
Sabranic

Sabranic
  • Members
  • 306 messages

Well so much for that, pretty much spun my wheels for 7 hours tonight.  Going to sleep.  I appreciate all of the tips and thoughts from everyone. 

 

If I bake the split level, which makes it impossible to move around in due to the very sweet looking custom tiles having some baking issues, that fixes a few of the issues - like the throne level not properly baking.  But then I am stuck with an un-traversable tomb level, and I have no clue how to fix the pathing.  The spawning sword scripts are now totally scuttled, i don't know what I did to them, they won't spawn anything no matter what I do anymore.  Exhaustion is getting to me I think.  Going to upload the latest version and get some sleep.



#19
kevL

kevL
  • Members
  • 4 056 messages
btw, you might try clearing the module(s) in the Campaign-editor, and clearing the user-temp folder of your OS. And re-adding the module with the Campaign Editor*

... after switching the mod to directory mode and moving the .Mod somewhere out of the way, asap.


* google for instructions on that ... even though it sounds simple it often takes me an hour to get right
  • Sabranic aime ceci

#20
Sabranic

Sabranic
  • Members
  • 306 messages

I will clear out everything, and then run Ccleaner on top of that.

 

 

 

 

I think I understand what's happening, and it involves how everything is packaged together when the toolset combines a folder as a single file. 

 

At one point, the throne and the final level were a single area.  However, due to the custom tileset used on part of it, baking the level was not possible, (as nothing I could do at the time would make the pathing function properly).  This was problematic since the throne area made some unacceptable use of stretched placeables and needed to be re-designed.  So, I duplicated the level, and deleted the identical parts.  I could then freely bake the throne for a revamp,  but the final level was left as-is - i.e. when you view it in the toolset, you'd see the pathing and geometry of the deleted areas.  I was extremely careful to remove all of the areas, objects and waypoints, before deleting tiles, and numerous checks and re-checks showed that there was nothing left in the deleted-but-still baked portion of the area. 

 

Yes, I was probably begging for trouble by doing this.  I realize that now having sunk many many hours into kludging around my error.  A fair bit of self inflicted agony there.

 

It is my theory that when I recombine the directory into a single file, the game is, for some reason, referencing the older walkmesh for both areas, resulting in strange terrain/pathing/scripting issues .  So my only option is to re-bake the throne.

 

I think I have a work-around, since the game will save the visual aspects of the terrain without baking.  I will walkmesh cutter the entire area manually to account for the pillars, then lay the final level out with a standard tileset, bake, delete the baked tileset and finally replace it with the custom one, which is well-made enough to be worth the trouble for the aesthetics alone.



#21
Sabranic

Sabranic
  • Members
  • 306 messages

That worked.  Now I have to redo the throne level. 

 

I not only had to re-bake the final level, but I also had to drop tiles back down over the portion in I had deleted, and bake them - THEN delete them.  And change the area names.

 

 

Sometimes the toolset can be... evil.  Additionally, I didn't do myself any favors I think.



#22
kevL

kevL
  • Members
  • 4 056 messages
FBF8_WUBGUR6_ILMT_LARGE.jpg

and we all know how that went
  • kamal_ et Sabranic aiment ceci

#23
Sabranic

Sabranic
  • Members
  • 306 messages

I think it turned out better for the mad scientist.  :wacko:

 

I still have the scripts screwed up for the swords but that's my own dumb fault for noodling with scripting I don't grok.  I will have to dig waaaay back in time to figure out what I missed to break that I suspect.



#24
kevL

kevL
  • Members
  • 4 056 messages
PM sent. ( massive spoiler )
  • Sabranic aime ceci

#25
Sabranic

Sabranic
  • Members
  • 306 messages

That's spiffy.  I love it when I "invent" problems that... aren't. 

 

/facepalm.

 

Thanks again.