Jump to content

SP Level Transitions


Go to solution Solved by MagSul,

Recommended Posts

Hi!

 

I'm having a problem when moving from my first map to my second map in my single player mod. The first one is a condensed version of the second purely to run a cinematic. When the script/cinematic is complete, the next level begins to load successfully. What happens next is best described with this video, the loading doesn't finish, I get this:

 

 

I can tap ESC to return to the main menu and then use /map or /devmap yavin_temple to load the map without issue. Does anyone have any suggestions as to why this is happening? I didn't run into this issue last time. :(

Link to comment

First time I saw anything like this! :D

It's a shot in the dark, but maybe there's some kind of faulty connection in the code? Like the code that 'stops' the previous level and loads up the next one. Maybe it starts to load the next map, but can't finish the task because of that gap or error or whatnot? :huh:

Link to comment

Hm. I'm not sure if it's anything related, but I had something similar happen to me noclipping outside of one or two maps. For some weird, unknown and probably wrong reason, it causes this effect, the camera going crazy, and not even setviewpos 0 0 0 0 seems to be able to fix it. Maybe try noclipping around that yavin_temple map and see if it happens.

Link to comment

I think I might know what's going on - I think that it's still got the camera enabled from the previous cutscene - try doing that again; when the glitch happens, type cam_disable into the console.

If it goes back to normal, then it confirms that's what the problem is.

Link to comment

I think I might know what's going on - I think that it's still got the camera enabled from the previous cutscene - try doing that again; when the glitch happens, type cam_disable into the console.

If it goes back to normal, then it confirms that's what the problem is.

Good suggestion! I double-checked my script for yavin_temple_cin1 and it doesn't disable the camera before triggering the next level. I added a brief wait in there to see if it would help but nothing has changed. I attempted the command you mentioned in the console, but sadly this didn't resolve the problem either. :(

 

EDIT: A fun fact is that changing the level to something other than yavin_temple does not replicate the issue. I changed the mapname key in the level_change to another test SP map and it loads without issue.

 

EDIT 2: If I try to devmap from the point of the error, I get MAX_PACKET_USERCMDS. Devmapping from the main menu after tapping ESC works perfectly.

 

EDIT 3: Just as a random thing - I quickly highlighted all the NPCs from the entity menu, deleted them and tried it. The map loads fine following on from the cutscene map no issues.  :huh:

I'm going to try making more of the NPCs spawn via a script following player spawn, rather than loaded from the map itself straight away and see if that allows all of this to work.

 

EDIT 4: That worked! The map loads, the NPCs spawn from one script then set about their tasks via one triggered after. However: Now the player does a stupid animation saber animation (without holding one) upon spawning in and I've no idea why.

Link to comment

The good news is that they're all spawning and doing what they should be doing. The bad news is, well...

 

Here's what's happening now:

 

 

Here's how I feel about it: https://youtu.be/rIzrkKAX9e0?t=55s

 

EDIT #1: It appears to be caused by NPC_spawners. Regular entities like npc_kyle, npc_luke do not seem to cause the player animation spasm. Removing the NPC_spawners from the script spawn list resolved the issue. They spawn as a part of the map now and all is well.

 

So: the NPC_spawners can't be done with a script without screwing the player. The level won't load following on from the cutscene level if the NPC_spawners are loaded as a part of the map.

 

Tl;dnr: Stressful afternoon.  :lol: 

Link to comment

Hm, if I had to guess I'd say it's something off with a script. I can't explain it in any other way - the player just doesn't do that kind of stuff on its own.

You're right, the player shouldn't be doing it on it's own. I removed everything surrounding the NPC temporarily and tried triggering it again. The player runs a random animation when he spawns. Why is a mystery. Considering he's only there for ambience, I think this particular guy is just going to burn in hell and get deleted. :P

 

9IH5y6e.png

Link to comment

Okay! There're two maps: yavin_temple_cin1 and yavin_temple. yavin_temple_cin1 is just a straight up cinematic (like the academy maps in the base game.) When the cinematic ends, the script loads the next level. The next level (yavin_temple) begins to load, but doesn't finish. What happens is what you see in the video at the top. I can open the console, but besides that I can't do anything else but tap ESC to return to the main menu. HOWEVER: If I use /map or /devmap to load yavin_temple from the main menu (bypassing the yavin_temple_cin1 map/cinematic) then everything loads fine.

 

I had a think about what could be causing this and I figured that my yavin_temple map and swapped it out with another map I'd made which was basically just a box. That map loaded completely fine, so I took a look at yavin_temple and figured I'd try using it with no NPCs. When I did this, the map loaded perfectly after the cinematic. At this point, I knew the NPCs in my map were causing the problem. So what I did was tie the spawning of all NPCs to a trigger in the map which the player touches upon spawning. What happened next is the map loaded, but the player would perform a random animation when she spawned, which I didn't want.

 

So as a wild guess, I decided to remove all NPC_spawners specifically (i.e. keep the NPC_luke and NPC_kyle entities and so on) and tested the map that way. The map again loaded completely fine and the player stopped doing a silly animation upon spawning. I then wondered if it was a specific NPC and briefly, I thought it was but I turned out to be wrong.

 

What I'm going to do this weekend is set up the map a bit more efficiently so that NPCs are only spawned when appropriate rather than all at once with the map loading. If during this process I run into more errors, I plan to share it on here with more specific details of what's happening so that I can get help dealing with it.

 

The current status of the map is I've put everything back to how it was before I started tinkering with it at the start of this thread. The second map doesn't load following the cinematic. I'll remove all NPCs over the next 2 days and re-add them so that they load into the level more efficiently and highlight issues I come across in the process.

RebelChum likes this
Link to comment

Ah ok that is strange and temperamental of JKA. Thank you for expanding on that!

 

Do you think the player is being forced to do that downstab move because it doesn’t like occupying the same coordinates as the fakeplayer NPC that you show in the dormroom? Even if they only do so for a microsecond?

Droidy365 likes this
Link to comment
  • Solution

No, the info_player_start is actually a grid unit behind the fake player NPC shown in the cinematic. I spawned two different custom NPCs earlier though with interesting results:

 

 

So I'm currently doing a cross-comparison to see if I can fix this by playing with the NPC files specifically.

 

EDIT #1: I changed the weapon line in the NPC files of the students from "WP_NONE" to "WP_SABER" and gave them a random hilt and colour configuration and the player no longer does an animation when they spawn. I'm assuming that means that there's some kind of rule about having "CLASS_JEDI" without a lightsaber (unless the lightsaber is later removed in a script as in Base game cinematics.)

 

EDIT #2: The NPC_spawner entities (i.e. my custom NPCs) are now spawned as a part of a script, set off when the player spawns and the end of that script triggers a second one which sets their behaviour. The second map now successfully loads after the first one (the cinematic) finishes. The player does no silly animations upon entering the level either.

 

In theory, that's it!  :winkthumb:

 

I shall not mark this thread as resolved until I'm 100% certain I don't have any more issues relating to this, though.  :P

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...