Jump to content
timmiej93

Game freezes about 1 or 2 seconds after starting freeplay

Recommended Posts

I edited one, and when I take that one out, it indeed works like normal.. It's just 700 lines, just got a good read ahead of me :P. Too bad it seems like there's nothing wrong with it

 

------

 

Now this is seriously getting strange...

I narrowed the errors down to LAFireStation and LAFireStationStart, but they just don't make sense...

 

I've put the default LAFireStation script back, moved my edited version out of the folder, and left my edited version of LAFireStationStart in it.

 

When running the game, after about 15 seconds, I get this error:

?(_LAFireStation8b572): Error: Symbol l1 is not defined in current scope ?(_LAFireStation8b572):  FILE:mod:/scripts/game/command/LAFireStation.script8b572 LINE:1293?(_LAFireStation8b572): Error: Failed to evaluate l1.GetNumObjects()?(_LAFireStation8b572): Possible candidates are...?(_LAFireStation8b572): filename       line:size busy function type and name  ?(_LAFireStation8b572): ?(_LAFireStation8b572): !!!Dictionary position rewound... ?(_LAFireStation8b572): !!!Error recovered!!!?(_LAFireStation8b572): Error: Symbol l1 is not defined in current scope ?(_LAFireStation8b572):  FILE:mod:/scripts/game/command/LAFireStation.script8b572 LINE:1293?(_LAFireStation8b572): Error: Failed to evaluate l1.GetNumObjects()?(_LAFireStation8b572): Possible candidates are...?(_LAFireStation8b572): filename       line:size busy function type and name  ?(_LAFireStation8b572): ?(_LAFireStation8b572): !!!Dictionary position rewound... ?(_LAFireStation8b572): !!!Error recovered!!!

This refers to the default, unedited LAFireStation script, so I'm completely baffled why this is happening.. Any ideas about what's happening?

Link to comment
Share on other sites

Quite simply, if you changed the vo's on the map and renamed them for example, or deleted some then the script won't function correctly anymore since it checks the map for said VOs/objects.

Link to comment
Share on other sites

You either renamed or deleted the control panel I bet, I just looked up the exact error location.. l1 is pointing towards an object missing on the map.

Link to comment
Share on other sites

l1 couldn't be defined because the caller (object that executes the script) isn't named 'fire_station',  'fire_station2', 'fire_station_controlpanel' or 'fire_station_controlpanel2'.

If any other object tries to run that part of the script (commandscript 'DummyDisableAlarm') it will result in that particular crash.

Link to comment
Share on other sites

Aha, I got it.

I added a simple logwrite saying "Not a firestation" like below, and indeed, two cases occur in the log and the game doesn't crash. Now I've gotta find out what is calling the Dummy then

		if(Caller->HasName(NAME_CONTROLPANEL) || Caller->HasName(NAME_FIRESTATION)) //= fire station 1			GameObjectList l1 = Game::GetGameObjects(NAME_FIRESTATION);		else if(Caller->HasName(NAME_CONTROLPANEL2) || Caller->HasName(NAME_FIRESTATION2)) //= fire station 2			GameObjectList l1 = Game::GetGameObjects(NAME_FIRESTATION2);		else			System::Log("not a firestation");			return;

--------------------

 

Alright, a small edit here:

I commented out the parts I thought that were causing the problem, but the log still shows two lines saying not a firestation. I guess there isn't a method to identify the callers name right?

 

So instead of Caller->HasName, something like Caller->FindName ?

 

 

--------------------

 

Was cheering too early again.. Now that has been fixed, the game starts freezing after a few seconds again.

This time though, I've been able to narrow it down to something very strange.

 

The problem seems to be the spawning of engineers.

When I disable the engineers spawning on startup, the techvans spawn perfectly, and everything works like it should. 
I also tried making the engineers pawn from a different VO, the same one where the battalion chief spawns from. Now, all 6 engineers spawn like they should and nothing seems wrong...

Could it be that I'm using names in the editor or in the script that aren't according to the "rules" that the game uses?

 

The VO is called "TT_spawn", in the script it's referred to as "VO_SPAWN_TT".

Could this be the cause? Or a wrong setting for the VO? Or maybe a problem with the building-model? (The spawn VO is inside an open building, just like the Fire Station.)

 

----------------------

 

So, after placing the VO outside of the building, the engineers happily spawn.. does anyone have a clue why they refuse to spawn inside?

 

PS. somewhere there's a big problem in this model or something, since I changed the code, so when l1 (the spawn vo) wouldn't fit the criteria, it should draw an error, but that error never showed up. Not ingame, not in the log.

		else if(v.IsCollidingWithVirtualObject(VO_SQUAD01_TT))		{  			ActorList l1 = Game::GetActors(VO_SPAWN_TT);			if(l1.GetNumActors() > 0)			{				Vector Spawn = l1.GetActor(0)->GetPosition();			}			else			{				Mission::PlayHint("Spawning problems");				System::Log("Spawning problems");				return;			}		}
Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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.



×
×
  • Create New...