Jump to content

How can a misc_model_breakable fire a laser?


Recommended Posts

I have been checking some singleplayer maps to see if I can reproduce some of the concepts there and there's something that eludes me which I find interesting for some ideas. 

 

How is it possible to make a misc_model_breakable entity shot an fx_runner like in pic related? Both vjun1 and t3_byss have ships that are flying around shooting lasers while in movement and I have no idea how to achieve that effect. 

 

How does the fx_runner get an impact fxfile? How can it be fired from whenever the misc_model_breakable is located? It seems like the fx_runner follows the misc_model entity. 

 

Pic related: I want to know how to do this

 

106a2af.jpg

Link to comment

In case of the TIE Bomber it's actually hardcoded - you make a misc_model_breakable with that .glm model and it automatically drops bombs whenever the player is in range. They are deadlier as you get closer to it.

Link to comment

In case of the TIE Bomber it's actually hardcoded - you make a misc_model_breakable with that .glm model and it automatically drops bombs whenever the player is in range. They are deadlier as you get closer to it.

Maybe it works with specific tag in that model not just tie bomber :o It is interesting tough... Jka have a lot of mistery and interesting stuff . @@Noodle create a single glm cube or something like that that will present your vehicle. Then just add to it the tag that is used for tie-bomber ( check i modview how it is called. Maybe the game is looking for one tag that is created only for this model) and then just check in the game. If You are asking about this i am sure You know how to make models right? D: If not it would be nice if someone else would check this thing :) very interesting

Link to comment

My mistake, it's not the .glm model, it's the .md3 model of the bomber.

 

Checking out the code (the related code is in g_breakable.cpp), if the misc_model_breakable uses the TIE Fighter and TIE Bomber models it's supposed to play the correct tie explosion effect. Also, apparently it's a check on the model it uses. The TIE bomber is hardcoded to have a set of effects and to trigger the bombing run, which seems to start from the model_root, directly to the ground, a bit forward, whenever the player is in range, and to take damage by heavy weapons only.

Asgarath83 likes this
Link to comment

My mistake, it's not the .glm model, it's the .md3 model of the bomber.

 

Checking out the code (the related code is in g_breakable.cpp), if the misc_model_breakable uses the TIE Fighter and TIE Bomber models it's supposed to play the correct tie explosion effect. Also, apparently it's a check on the model it uses. The TIE bomber is hardcoded to have a set of effects and to trigger the bombing run, which seems to start from the model_root, directly to the ground, a bit forward, whenever the player is in range, and to take damage by heavy weapons only.

Damn... it is kinda stupid that they make a hard way for us to make mods for this game. Srlsy... i think they could make it by using diffrent methods that would be easier for us to understand and re used them for our needs.

I wanted to make the bespin pod that is func_breakable ( i do t like misc_model breakable... i prefer misc_model and parent it to the func_breakable brush that presents a hitbox of it too) and i wanted to make it shoot at the player. But i couldnt find any way to make this working...

 

Hmm put it is possible to add the models to this code?

Asgarath83 likes this
Link to comment

Maybe it works with specific tag in that model not just tie bomber :o It is interesting tough... Jka have a lot of mistery and interesting stuff . @@Noodle create a single glm cube or something like that that will present your vehicle. Then just add to it the tag that is used for tie-bomber ( check i modview how it is called. Maybe the game is looking for one tag that is created only for this model) and then just check in the game. If You are asking about this i am sure You know how to make models right? D: If not it would be nice if someone else would check this thing :) very interesting

 

Sadly I haven't explored the fascinating world of modeling yet, just mapping, scripting and a tiny bit of coding :(

 

My mistake, it's not the .glm model, it's the .md3 model of the bomber.

 

Checking out the code (the related code is in g_breakable.cpp), if the misc_model_breakable uses the TIE Fighter and TIE Bomber models it's supposed to play the correct tie explosion effect. Also, apparently it's a check on the model it uses. The TIE bomber is hardcoded to have a set of effects and to trigger the bombing run, which seems to start from the model_root, directly to the ground, a bit forward, whenever the player is in range, and to take damage by heavy weapons only.

 

Wow, it seems you're right! 

 

Just added a TIE bomber to my test map and it does bomb the living shit out of things. 

 

rwl0ro.jpg

 

However! This doesn't seem to apply with the normal TIE fighter, that ship just flies around without shooting. In the map t3_byss we can see some TIE fighters flying around and firing lasers, however the script that's used there is different than in vjun1. 

set ( "SET_OBJECTIVE_SHOW", "T3_BYSS_OBJ2" );
set ( "SET_COLLIDABLE_ROFFS", "true" );
set ( "SET_MUSIC_STATE", "DM_ACTION" );
declare ( FLOAT, "fNumDeadTies" );
set ( "fNumDeadTies", "0" );

affect ( "wave1_tie1", FLUSH )
{

	task ( "roff1" )
	{
		set ( "SET_ORIGIN", < 2410.513 692.380 3477.049 > );
		set ( "SET_ANGLES", < 0.000 0.000 0.000 > );
		play ( "PLAY_ROFF", "t3_byss/tie_01" );
	}


	loop ( -1.000 )
	{
		do ( "roff1" );
		wait ( "roff1" );
	}

}


affect ( "wave1_tie2", FLUSH )
{

	task ( "roff2" )
	{
		set ( "SET_ORIGIN", < 887.687 1994.076 3710.272 > );
		set ( "SET_ANGLES", < 0.000 0.000 0.000 > );
		play ( "PLAY_ROFF", "t3_byss/tie_02" );
	}


	loop ( -1.000 )
	{
		do ( "roff2" );
		wait ( "roff2" );
	}

}


affect ( "wave1_tie3", FLUSH )
{

	task ( "roff3" )
	{
		set ( "SET_ORIGIN", < 3790.808 291.668 2341.305 > );
		set ( "SET_ANGLES", < 0.000 0.000 0.000 > );
		play ( "PLAY_ROFF", "t3_byss/tie_03" );
	}


	loop ( -1.000 )
	{
		do ( "roff3" );
		wait ( "roff3" );
	}

}


affect ( "wave2_tie1", FLUSH )
{

	task ( "roff4" )
	{
		set ( "SET_ORIGIN", < 2522.273 3230.411 3857.344 > );
		set ( "SET_ANGLES", < 0.000 171.251 0.000 > );
		play ( "PLAY_ROFF", "t3_byss/tie_04" );
	}


	loop ( -1.000 )
	{
		do ( "roff4" );
		wait ( "roff4" );
	}

}


affect ( "wave2_tie2", FLUSH )
{

	task ( "roff5" )
	{
		set ( "SET_ORIGIN", < -1104.852 1465.268 3501.099 > );
		set ( "SET_ANGLES", < 0.000 231.172 0.000 > );
		play ( "PLAY_ROFF", "t3_byss/tie_05" );
	}


	loop ( -1.000 )
	{
		do ( "roff5" );
		wait ( "roff5" );
	}

}


affect ( "wave2_tie3", FLUSH )
{

	task ( "roff6" )
	{
		set ( "SET_ORIGIN", < 2434.926 1059.670 3826.119 > );
		set ( "SET_ANGLES", < 0.000 203.715 0.000 > );
		play ( "PLAY_ROFF", "t3_byss/tie_06" );
	}


	loop ( -1.000 )
	{
		do ( "roff6" );
		wait ( "roff6" );
	}

}


task ( "breakme" )
{
	set ( "fNumDeadTies", "+1" );

	affect ( "TieDeathCounter", FLUSH )
	{

		if ( $get( FLOAT, "SET_COUNT" ) = 0.000$ )
		{

			affect ( "player", FLUSH )
			{
				flush (   );
			}

		}

	}

}

use ( "air1" );
use ( "air2" );
use ( "air3" );
use ( "air4" );

task ( "DamageShip" )
{

	affect ( "script_HealthGunTurret1", FLUSH )
	{
		set ( "SET_DAMAGEENTITY", 3.000 );

		affect ( "script_HealthGunTurret2", FLUSH )
		{
			set ( "SET_DAMAGEENTITY", 3.000 );

			affect ( "script_HealthGunTurret3", FLUSH )
			{
				set ( "SET_DAMAGEENTITY", 3.000 );

				affect ( "script_HealthGunTurret4", FLUSH )
				{
					set ( "SET_DAMAGEENTITY", 3.000 );

					affect ( "script_HealthGunTurret5", FLUSH )
					{
						set ( "SET_DAMAGEENTITY", 3.000 );
					}

				}

			}

		}

	}

}


loop ( -1.000 )
{
	wait ( $random( 2500, 3500 )$ );
	do ( "breakme" );
	use ( "wave1_tie1" );
	camera ( SHAKE, $random( 1, 1 )$, $random( 1000, 1500 )$ );
	sound ( CHAN_ANNOUNCER, "sound/effects/thud.mp3" );
	use ( "spark1" );
	use ( "spark6" );
	use ( "spark8" );
	use ( "spark10" );
	wait ( $random( 4000, 6000 )$ );
	do ( "breakme" );
	camera ( SHAKE, $random( 1, 1 )$, $random( 1000, 2000 )$ );
	sound ( CHAN_ANNOUNCER, "sound/effects/thud.mp3" );
	use ( "spark1" );
	use ( "spark2" );
	use ( "spark5" );
	use ( "spark6" );
	use ( "spark10" );
	wait ( $random( 4000, 6000 )$ );
	do ( "breakme" );
	use ( "wave1_tie1" );
	use ( "wave2_tie2" );
	use ( "wave2_tie3" );
	camera ( SHAKE, 1.000, $random( 1000, 1500 )$ );
	sound ( CHAN_ANNOUNCER, "sound/effects/thud.mp3" );
	use ( "spark3" );
	use ( "spark4" );
	use ( "spark7" );
	use ( "spark9" );
	wait ( $random( 4000, 6000 )$ );
	do ( "breakme" );
	use ( "wave1_tie1" );
	use ( "wave2_tie3" );
	use ( "wave1_tie1" );
	camera ( SHAKE, $random( 1, 2 )$, $random( 1000, 2000 )$ );
	sound ( CHAN_ANNOUNCER, "sound/effects/thud.mp3" );
	use ( "spark1" );
	use ( "spark2" );
	use ( "spark5" );
	use ( "spark7" );
	use ( "spark8" );
	wait ( $random( 2000, 4000 )$ );
	do ( "breakme" );
	use ( "wave2_tie1" );
	use ( "wave2_tie2" );
	use ( "wave2_tie3" );
	use ( "wave1_tie1" );
	use ( "wave1_tie2" );
	use ( "wave1_tie3" );
	camera ( SHAKE, $random( 1, 1 )$, $random( 1000, 2000 )$ );
	sound ( CHAN_ANNOUNCER, "sound/effects/thud.mp3" );
	use ( "spark1" );
	use ( "spark4" );
	use ( "spark6" );
	use ( "spark7" );
	use ( "spark8" );
	wait ( $random( 4000, 6000 )$ );
	do ( "breakme" );
	use ( "wave2_tie2" );
	use ( "wave2_tie3" );
	use ( "wave1_tie1" );
	use ( "wave1_tie3" );
	camera ( SHAKE, $random( 1, 1 )$, $random( 1000, 1500 )$ );
	sound ( CHAN_ANNOUNCER, "sound/effects/thud.mp3" );
	use ( "spark2" );
	use ( "spark4" );
	use ( "spark6" );
	use ( "spark7" );
	use ( "spark9" );
	wait ( $random( 4000, 6000 )$ );
	do ( "breakme" );
	camera ( SHAKE, 0.500, 2800.000 );
	sound ( CHAN_ANNOUNCER, "sound/movers/objects/walkway_creak.mp3" );
	wait ( $random( 500, 1000 )$ );
}

The script here has some md3 playing specific roff files, but then a bunch of effects are triggered when the player reaches a certain point in the map. The camera starts shaking, the TIEs start moving and whenever an fx_runner of a spark is triggered, the TIEs shoot a laser at the same time. Could it be that in this case it isn't hardcoded and maybe there's a way to make an fx_runner play froma moving md3 model?

 

Pic related: TIE fighters firing lasers at the same time.

 

jfkosh.jpg

Link to comment

Damn... it is kinda stupid that they make a hard way for us to make mods for this game. Srlsy... i think they could make it by using diffrent methods that would be easier for us to understand and re used them for our needs.

I wanted to make the bespin pod that is func_breakable ( i do t like misc_model breakable... i prefer misc_model and parent it to the func_breakable brush that presents a hitbox of it too) and i wanted to make it shoot at the player. But i couldnt find any way to make this working...

 

Hmm put it is possible to add the models to this code?

 

I'm trying to do something similar, created a small ship that's attacked by enemy fighters. Instead of making it shoot at the player's ship, I'm working on a timer so that if you don't destroy a bunch of ships in a specific amount of time, your ship will get damaged untill it blows up. 

Link to comment

Are you sure it works like that? The fx_runners seem more related to the sparks and air gusts that activate when the ship is under attack.

 

I am not sure, don't know how to see what entities were used in that map. What I don't understand is why there are the 

use ( "wave1_tie1" );
	use ( "wave2_tie2" );
	use ( "wave2_tie3" );

commands on the loop at the end. If I had to guess, I'd think that they are related to the lasers that are fired by the misc_model entities, but I don't know at all. 

Link to comment

Apparently they're just used to make sure that the models follow their .ROFF path. I think it does a weird sort of calculation to know when to shoot - and again the TIE lasers start at the model_root, twin lasers in this case.

Link to comment

Ehi Folks. check the intro icarus script script of T1_rail and the scripts of map t1_rail itself...

you remember? there are dogfighst when cargo ships shoot the train with projectile and explosion.

there is also a part when a cargo ship is upon jaden and can Dmg in with explosion and Kyle arrive with raven claw by the front side of the map blasting and destroying the cargo. also, kyle speaks "too easy!" and the raven go over.

you can use the t1_rail map as example for make shooting air battles using ship models, fxrunner, tags, triggers,  and icarus ;)

Langerd likes this
Link to comment

Ehi Folks. check the intro icarus script script of T1_rail and the scripts of map t1_rail itself...

you remember? there are dogfighst when cargo ships shoot the train with projectile and explosion.

there is also a part when a cargo ship is upon jaden and can Dmg in with explosion and Kyle arrive with raven claw by the front side of the map blasting and destroying the cargo. also, kyle speaks "too easy!" and the raven go over.

you can use the t1_rail map as example for make shooting air battles using ship models, fxrunner, tags, triggers,  and icarus ;)

 

Yeah, I think that's what I'll try to imitate, though it's a pity you can't make an fx_runner target a player, it seems it must target an info_null or a similar entity. 

Link to comment

Ehi Folks. check the intro icarus script script of T1_rail and the scripts of map t1_rail itself...

you remember? there are dogfighst when cargo ships shoot the train with projectile and explosion.

there is also a part when a cargo ship is upon jaden and can Dmg in with explosion and Kyle arrive with raven claw by the front side of the map blasting and destroying the cargo. also, kyle speaks "too easy!" and the raven go over.

you can use the t1_rail map as example for make shooting air battles using ship models, fxrunner, tags, triggers,  and icarus ;)

 

That's probably just a misc_model_breakable or func_breakable that plays that specific effect - no shooting, except for the 3 rockets at the beginning, is present on the map.

Link to comment

For what i've seen editing t1_rail for my mod, the 3 rockets was fx_runner conncect to some kind of info,... i cannot check now, my pc is over. :(

mmm

@@Noodle

you can make 2 things:

- a cinematic when a fakeplayer is reached by the projectile efx in the same way this work on t1_rail with rockets. also there is a cutscene on t1_sour when a weequay shoot with rocket and destroy the wall, separing jaden by chewbacca.

- a script that lock player movement and get it shooted by a target_shooter weapons or something like that. when player is hitted, you activate a trigger_hurt into the zone for damaging the player... or you can edit icarus and set_health player to a lower value of 100

Noodle likes this
Link to comment

I don't know if this will help but maybe.

 

So I think you want a md3 to fire a bomb.  Tie bomber to bomb something.  An fx runner can start off and can be triggered to work.  If you want it to shoot once, add a target delay and have the target delay target the fx to turn the fx off again after it's been used or else the fx runner will keep running.  If you want it to loop you can change the wait times.  Wait I think in seconds, delay is milliseconds so in milliseconds 1000 equals one second or 10000 equals 10 seconds.  If you want it to shoot a bomb out every so many seconds you change some of those variables. 

 

If it's an md3 and a train i think the crush through flag will make the train trigger something.  Like if there is a trigger at a certain point the train goes through it and it fires a efx or something or whatever.  I've not exactly tested that however.  But entity info does say that is what it will do.  I don't believe this works in JO however so that may be one reason why I have not tested that, I know everything else works, I'm just not sure crush through in JO will work.

 

 

So, trigger_multiple targets a target relay and a target delay, the target relay and delay both target the fx.  the relay will instantly start the fx_runner and set the delay with a wait value to turn the fx off again.  That way the fx is triggered on to drop a bomb then triggered off again so it stops dropping the bombs.

 

Maybe you can try that?  Maybe that's not what you are intending to do?  Maybe it'll give you an idea to make it work a different way. 

 

 

Another thing with a train, I helped a friend during the making of the Shroomduck map pack get something to work he was having trouble with.  A map called big cannon.  I got all the cannons to work for him triggereing a physical object / train so shoot out of 10 separate cannons all converging on the top of a hill.  It worked but the wierd thing was the train had to target the last path_corner and when triggered would run the path backwards.  It worked pretty well, I just had to rearrange the targeting of path corners to point from the hill up into the air and then into the cannon then when triggered it would look like the cannonball was coming out of the cannons.  

 

You could have a md3 fire a physical missile that way made from patches or brushes or another md3 if you want to take it that far.  If course the trajectory will be fixed..

 

So there's another idea.  I don't know if that will help or if I have lost ya already.  :)

 

 

 

oh and the impact fxfile, in the efx file there is a coding to let the game know to do something if a collision of the fx is detected.  You can open the efx file and find where this coding is and can direct it to do something next, like trigger another efx for the impact. Im not sure if that will answer your question exactly but maybe it'll help.

Link to comment

I don't know if this will help but maybe.

 

So I think you want a md3 to fire a bomb.  Tie bomber to bomb something.  An fx runner can start off and can be triggered to work.  If you want it to shoot once, add a target delay and have the target delay target the fx to turn the fx off again after it's been used or else the fx runner will keep running.  If you want it to loop you can change the wait times.  Wait I think in seconds, delay is milliseconds so in milliseconds 1000 equals one second or 10000 equals 10 seconds.  If you want it to shoot a bomb out every so many seconds you change some of those variables. 

 

If it's an md3 and a train i think the crush through flag will make the train trigger something.  Like if there is a trigger at a certain point the train goes through it and it fires a efx or something or whatever.  I've not exactly tested that however.  But entity info does say that is what it will do.  I don't believe this works in JO however so that may be one reason why I have not tested that, I know everything else works, I'm just not sure crush through in JO will work.

 

 

So, trigger_multiple targets a target relay and a target delay, the target relay and delay both target the fx.  the relay will instantly start the fx_runner and set the delay with a wait value to turn the fx off again.  That way the fx is triggered on to drop a bomb then triggered off again so it stops dropping the bombs.

 

Maybe you can try that?  Maybe that's not what you are intending to do?  Maybe it'll give you an idea to make it work a different way. 

 

 

Another thing with a train, I helped a friend during the making of the Shroomduck map pack get something to work he was having trouble with.  A map called big cannon.  I got all the cannons to work for him triggereing a physical object / train so shoot out of 10 separate cannons all converging on the top of a hill.  It worked but the wierd thing was the train had to target the last path_corner and when triggered would run the path backwards.  It worked pretty well, I just had to rearrange the targeting of path corners to point from the hill up into the air and then into the cannon then when triggered it would look like the cannonball was coming out of the cannons.  

 

You could have a md3 fire a physical missile that way made from patches or brushes or another md3 if you want to take it that far.  If course the trajectory will be fixed..

 

So there's another idea.  I don't know if that will help or if I have lost ya already.  :)

 

 

 

oh and the impact fxfile, in the efx file there is a coding to let the game know to do something if a collision of the fx is detected.  You can open the efx file and find where this coding is and can direct it to do something next, like trigger another efx for the impact. Im not sure if that will answer your question exactly but maybe it'll help.

 

Those are all great ideas! I'll have to try them during this weekend when I get the time for it. 

 

Thanks!

Link to comment

I still have the map file for big cannon. I could try to contact him if I can find an email address to see if I could release it as a source file for learning purposes or a prefab for someone to add to.

 

 

At the very least I could at least take what I did from the map for illustration without using anything the original author made.

 

Of course I am also thinking of making some source files for release as a group so people can access areas and see how they can make some stuff work without scripting or being too overly complicated. Also I've made a vehicle test map I hope to expand upon recently.  I've put some things in there to test like certain angles, water, forcefields, blocks of varying heights to see how well a vehicle will overcome and obstacle or jump or something.  It would help someone putting together a vehicle map so they know how to build stuff bikes like before they build it.  Eventually I'll try to get something put together :P

Noodle likes this
Link to comment

I still have the map file for big cannon. I could try to contact him if I can find an email address to see if I could release it as a source file for learning purposes or a prefab for someone to add to.

 

 

At the very least I could at least take what I did from the map for illustration without using anything the original author made.

 

Of course I am also thinking of making some source files for release as a group so people can access areas and see how they can make some stuff work without scripting or being too overly complicated. Also I've made a vehicle test map I hope to expand upon recently.  I've put some things in there to test like certain angles, water, forcefields, blocks of varying heights to see how well a vehicle will overcome and obstacle or jump or something.  It would help someone putting together a vehicle map so they know how to build stuff bikes like before they build it.  Eventually I'll try to get something put together :P

 

That'd be great. I've learned a lot of things about mapping with the three sample maps that JA has. More examples are always a good thing. 

Link to comment

There are other ways like decompiling a map to find out how someone did something.  I had to do that recently to find out how to spawn a rancor npc.

 

I'm aware of that, but  I was unsuccessful when I tried. If I could, I would've checked how the t3_byss map works. 

Link to comment

It's not a big secret, it can be frowned upon if someone decompiles a map but I think it is a necessary learning tool. 

 

First you have to have the pk3 in your base folder for the map, in a different folder extract the contents of the pk3 or just extract the bsp file for the map you want to decompile.  Once you get a hold of the bsp, open the base/maps folder for Jedi Academy and place the .bsp file there. then you go to the next step.

 

Next open the command prompt for windows and run as administrator. If you open the command prompt in Windows, you will be in the windows directory.  type cd.. enter then cd.. enter and you should be in the c: directory, one there the command is:

 

"C:\Program Files\LucasArts\Star Wars JK II Jedi Outcast\q3map2.exe" -convert -format map -fs_basepath "C:/Program Files/LucasArts/Star Wars Jedi Knight Jedi Academy/GameData/" -game ja "C:/Program Files/LucasArts/Star Wars Jedi Knight Jedi Academy/GameData/base/maps/decompilemapname.bsp"

 

 

Adjust the above code to where you have q3map and Jedi academy installed and make sure you change the map name in the code to the .bps you want to convert.  Just be mindful and use for educational purposes.  The good thing about decompiling a map is it will not be perfect and textures will be all out of wack, brushes will be out of place, leaks will occur.  Decompiling makes a very inaccutare copy.  It can be used for retrieving lost work as long as you have a bps around somewhere you can convert it but it'll take a long time to get it back to the way it was but it would be better with errors than no map file to work with at all.

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...