News:

One Minute Game Review by The Happy Friar: https://ugetube.com/@OneMinteGameReviews
Also on Rumble: https://rumble.com/c/c-1115371

idTech 4 (aka Doom 3 tech) Discord Server! https://discord.gg/9wtCGHa

Main Menu

How to check if a cutscene is playing

Started by VGames, September 19, 2015, 02:18:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Phrozo

Can you post the script that makes the soulknight so I can see how it works? I might be able to show you where.

VGames

Sure here it is:


/***********************************************************************

proj_soulcube.script

***********************************************************************/

object proj_soulcube {
void init();
};

void proj_soulcube::init() {
//don't do anything if this projectile has been created by the game on monster spawn
if( !self || sys.getTime() < 1 ) {
//if( !self ){ sys.println("created by a monster spawned by scripts or console" ); } //DEBUG ONLY
//if( sys.getTime() < 1 ){ sys.println("created at map start. name: " + getName()); } //DEBUG ONLY
return;
}
//sys.println("start init() for " + getName() ); //DEBUG ONLY
while( getProjectileState() < PROJECTILE_FIZZLED ) {
//sys.println("waiting for " + getName() + ". State: "+ getProjectileState()); //DEBUG ONLY
waitFrame();
if( !self ) {
//sys.println("This projectile has been removed!" ); //DEBUG ONLY
return;
}
}
vector angles;
vector temp_angles;
float i;

for ( i = 0; i < 1; i++ ) {

vector pos = getWorldOrigin();
vector ang = getAngles();

entity monster = sys.spawn("pet_soulknight");
monster.setOrigin( pos );
monster.setAngles( ang );

}

//sys.println("end init() for " + getName() ); //DEBUG ONLY
}


Its called from the Soul Cube's secondary projectile def.
Get the latest on Perfected Doom 3 here - http://www.moddb.com/mods/perfected-doom-3-version-500

Phrozo

#17
Replace:
entity monster = sys.spawn("pet_soulknight");
monster.setOrigin( pos );
monster.setAngles( ang );


with

if ( !globalPetSoulKnight ) {
    globalPetSoulKnight = sys.spawn("pet_soulknight");
} else {
        sys.println( "WARNING: pet soulknight already exists! Forget to remove him?" );
}
globalPetSoulKnight.setOrigin( pos );
globalPetSoulKnight.setAngles( ang );


And at the very top under your header comment add:

entity globalPetSoulKnight; // this is your global entity variable you use to reference the pet soul knight anywhere in script now

Being that your object is global, you'll have to be a little bit more careful with it. You'll also have to decide what to do when 'globalPetSoulKnight' is pointing to a soul knight and it is still alive when making a new soul knight. Do you remove it and spawn a new one? Do you do nothing? You'll have to decide but let's see if this works first before worrying about that.

By the way, multiple soul knights is going to be a problem. This solution is just for one.

VGames

I'll try this out ASAP. Thanks for the help. I'll get back to u tomorrow. Take care.
Get the latest on Perfected Doom 3 here - http://www.moddb.com/mods/perfected-doom-3-version-500

VGames

Man it still didn't work. I even tried it with just one Soulknight and the game still locks up. I always get the warning that says the Soulknight does not have an AAS when he's spawned which is of course from a lack of Hellknights or Barons in the map. Do you think that maybe if I added a Baron or Hellknight to the map and recompiled the map that that may fix the issue since there would the be an AAS for the Soulknight since it is the same size as the Baron and Hellknight?
Get the latest on Perfected Doom 3 here - http://www.moddb.com/mods/perfected-doom-3-version-500

Phrozo

No. AAS files are just to help monsters with path finding.

How do you know your 'soul knights' are causing this? Tried testing this without them? When I had issues it was because other script threads were running.

VGames

I already tried out the map without using a Soulknight during the final fight and it ran through the cutscene without any issues. It's the Soulknights. It's like it can't remember where they were at or something. Because the player as the Sabaoth are both moved to the center of the boss fight room after the cutscene is over. Maybe moving the Soulknights to the player position after the cutscene ends would help.
Get the latest on Perfected Doom 3 here - http://www.moddb.com/mods/perfected-doom-3-version-500

Phrozo

#22
Attach the script file the soul knight uses here so I can take a further look at it or email me. Include the soulcube too.

typo :3

VGames

#23
Ok by adding a EnterCinematic function to the Sabaoth's script file and adding this line:


    globalPetSoulKnight.remove();


in it I am able to keep the game from crashing if a Soulknight is still alive and kicking when the Sabaoth's death scene ends and control is handed back over to the player. So the problem is fixed but I am only able to have one Soulknight at a time. More then 1 crashes the game. I'm ok with this because of balancing. The Soulknight is one tough dude so one with the players help is enough to take care of most issues.

But if we did want more then one Soulknight at a time is there a way to keep track of them with like a number or something so that they can be removed according to that number? Like where Phrozo defines them as globalPetSoulKnight in my proj_Soulcube.script file its set up so that another souknight isn't spawned unless there isn't one. So how could we keep track of how many we have and what theyre known as? Like name them globalPetSoulKnight, then globalPetSoulKnight2, then globalPetSoulKnight3, and so on and so on each time one is spawned.
Get the latest on Perfected Doom 3 here - http://www.moddb.com/mods/perfected-doom-3-version-500