Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 11 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty
Category: CoD Mapping
CoD mapping and level design.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: sp tank problem
ilikepotatoes
General Member
Since: Jan 30, 2007
Posts: 35
Last: Dec 3, 2009
[view latest posts]
Level 2
Category: CoD Mapping
Posted: Saturday, Feb. 3, 2007 06:47 am
i cant find this in the tuts and in the forums. i making my first sp map and have no idea how to make destroyable tanks for an objective (like in railyard). i tried looking at other maps but i keep ending up with overlapping xmodels ( even if i use the hide() function) and you have to destroy them in a certain order. plz help.
Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoD Mapping
Posted: Saturday, Feb. 3, 2007 01:33 pm
Flak 88 objective tutorial. It's for CoD, but works for CoDUO too.
Share |
ilikepotatoes
General Member
Since: Jan 30, 2007
Posts: 35
Last: Dec 3, 2009
[view latest posts]
Level 2
Category: CoD Mapping
Posted: Sunday, Feb. 4, 2007 01:37 am
ok, but how do i change it so that panzerfausts destroy the tank. im making a sp map where you dont carry explosives.
thanks for your time.
Share |
playername
Preferred Member
Since: Aug 24, 2006
Posts: 821
Last: Apr 15, 2011
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD Mapping
Posted: Sunday, Feb. 4, 2007 02:26 am
i think that if you make a tank a scriptmodel and add a scriptnoteworthy (srry i don't know what it would be)or targetname (like tiger) to the tank and have a gsc file that calls up the local files it should work.
like Key:Scriptnoteworthy Value:Not sure but try tiger or tank.
OR Key:targetname Value:try tiger or tank.
then in the gsc file put

main()
maps/_load::main();
}
nullFew tips for coding.
1. Keep the script as short as possible.
2. Don't comment every line. Only comment portions where they may be needed to point something out.
3. Don't over complicate the script, keep it organized and easy to read.

These help you find simple errors and makes it easy to make changes.
Share |
WHC_Grassy
General Member
Since: Apr 20, 2005
Posts: 1426
Last: Aug 25, 2007
[view latest posts]
Level 8
Category: CoD Mapping
Posted: Sunday, Feb. 4, 2007 07:34 am
Hello there, I made this some time ago for an experiment.
It will work for SP although this is using UO fx you might have to change some the fx loaded at the top of the script for something else .
How it works, the trigger will wait for a hit from whatever damage you have enabled, in your case I would disable everything except rocket, so only panzerfausts will be allowed.
Each hit on the trigger will start an fx, (hit 1) will be small sparks and some small smoke, (hit 2) will be smalll fire and steam, (hit 3) will trigger the final tank explosion and switch over of models from good to destroyed.

Hope this helps you out, enjoy.
Grassy

Code:

// Special effects script used with a trigger_damage
// By Grassy



main()
{
	//Load effects needed
	level._effect["tankmetalexp"]	   = loadfx ("fx/weapon/explosions/tank_metal.efx");
	level._effect["smallfire"]			   = loadfx ("fx/fire/tinybon.efx");
	level._effect["ashsmoke"]              = loadfx ("fx/smoke/ash_smoke.efx");
	level._effect["impact_sparks"]    = loadfx ("fx/weapon/impacts/impact_smg_metal.efx");
	level._effect["steam"] 		   = loadfx ("fx/pi_fx/factory_steam.efx"); 

	thread tank_effects();
}


tank_effects()
{

	//If any of these entities are missing exit safely from the script
	
	//Trigger_damage on the tank; targetname is "tank_trig"
	trig = getent ("tank_trig", "targetname");
	if(!isDefined(trig))
   return;
	
  //Undamaged tank model, make script_model, targetname "tank"
	goodmodel = getent("tank", "targetname");
	if(!isDefined(goodmodel))
   return;

  //Destroyed tank model, aslo script_model, targetname "tank_d"
	destroyedmodel = getent("tank_d", "targetname");
	if(!isDefined(destroyedmodel))
   return;

  //Script origin, place where fx will show on tank, targetname "fx_org"
 	fxpos = getent("fx_org", "targetname");
	if(!isDefined(fxpos))
   return;
	
	//Hide the destroyed model
	destroyedmodel hide();
   
	//Get the fx origin to play effects on   
	fxpos_org = fxpos getorigin();

	//Define a few variables used to keep track of damage levels
	//and to play or not play the effects
	hit_count = 0;
	level.fx = true;

	//Loop until damage level reaches 90 then exit loop		   
	while(1)
	{
   		
		//waits here for each hit on the trigger
		trig waittill("trigger");

		//Increment the variable hit_count by 30
		//this is for panerfaust hits as they will cause a lot of damage each hit
		//and three hits should be enough to kill a tank
		hit_count += 30;
		
		//When the hit_count reaches 30 play these effects
		if(hit_count == 30)
		{
			thread loopfx("impact_sparks", fxpos_org, 1, 1);
			thread loopfx("ashsmoke", fxpos_org, 0.5, 1);
		}
		
		//When hit_count reaches 60 set the level wide variable level.fx to false
		//so the routine "loopfx" below will stop playing them, wait .5 then reset
		//the variable so the new effects will play
		if(hit_count == 60)
		{
			level.fx = false;
			wait(0.5);
			level.fx = true;
			thread loopfx("steam", fxpos_org, 0.5, 1);
			thread loopfx("smallfire", fxpos_org, 0.3, 1);
		}

		//When we get to 90 stop all effects looping and play a nice BOOM!
		//then delete the goodmodel and show the damaged one
		//and exit the main loop, trigger is still there but dosn't do anything
		if(hit_count == 90)
		{
			level.fx = false;
			wait(2);
			level.fx = true;
			thread loopfx("steam", fxpos_org, 0.5, 1);
			playfx(level._effect["tankmetalexp"], (fxpos_org));
			goodmodel delete();
			destroyedmodel show();
			break;
		}
	}
}	
	
   

loopfx(fxId, fxPos, waitime) {
if( (!isDefined(fxPos)) || (!isDefined(fxId)) )
   return;
if(!isDefined(waitime))
   waitime = 1;

   while (level.fx) {
      playfx(level._effect[fxId], fxPos);
      wait (waitime);
   }
 }
 
Share |
WHC_Grassy
General Member
Since: Apr 20, 2005
Posts: 1426
Last: Aug 25, 2007
[view latest posts]
Level 8
Category: CoD Mapping
Posted: Saturday, Feb. 10, 2007 10:56 am
No comments? [confused]
Share |
ilikepotatoes
General Member
Since: Jan 30, 2007
Posts: 35
Last: Dec 3, 2009
[view latest posts]
Level 2
Category: CoD Mapping
Posted: Saturday, Feb. 10, 2007 11:19 am
lol, sorry for the long wait, ive been busy with school work and modding for cod2.
I like the idea of your script; how it accumilates damage and goes through all these different fxs, but it only applies to one tank. How do i apply this to all four of my tanks, so that you can destory them all in any order as an objective? Thanks for your help.[confused][crazy]
Share |
playername
Preferred Member
Since: Aug 24, 2006
Posts: 821
Last: Apr 15, 2011
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD Mapping
Posted: Saturday, Feb. 10, 2007 04:20 pm
ok correct me if i am wrong. I'm not good at scripting but i added threads onto the script like so...
Code:
// Special effects script used with a trigger_damage
// By Grassy 
// Edited by KKFPlayername for 4 different tanks


main()
{
	//Load effects needed
	level._effect["tankmetalexp"]	   = loadfx ("fx/weapon/explosions/tank_metal.efx");
	level._effect["smallfire"]			   = loadfx ("fx/fire/tinybon.efx");
	level._effect["ashsmoke"]              = loadfx ("fx/smoke/ash_smoke.efx");
	level._effect["impact_sparks"]    = loadfx ("fx/weapon/impacts/impact_smg_metal.efx");
	level._effect["steam"] 		   = loadfx ("fx/pi_fx/factory_steam.efx"); 

	thread tank_effects();
	thread tank_effects2();
	thread tank_effects3();
	thread tank_effects4();
}


tank_effects()
{

	//If any of these entities are missing exit safely from the script
	
	//Trigger_damage on the tank; targetname is "tank_trig"
	trig = getent ("tank_trig", "targetname");
	if(!isDefined(trig))
   return;
	
  //Undamaged tank model, make script_model, targetname "tank"
	goodmodel = getent("tank", "targetname");
	if(!isDefined(goodmodel))
   return;

  //Destroyed tank model, aslo script_model, targetname "tank_d"
	destroyedmodel = getent("tank_d", "targetname");
	if(!isDefined(destroyedmodel))
   return;

  //Script origin, place where fx will show on tank, targetname "fx_org"
 	fxpos = getent("fx_org", "targetname");
	if(!isDefined(fxpos))
   return;
	
	//Hide the destroyed model
	destroyedmodel hide();
   
	//Get the fx origin to play effects on   
	fxpos_org = fxpos getorigin();

	//Define a few variables used to keep track of damage levels
	//and to play or not play the effects
	hit_count = 0;
	level.fx = true;

	//Loop until damage level reaches 90 then exit loop		   
	while(1)
	{
   		
		//waits here for each hit on the trigger
		trig waittill("trigger");

		//Increment the variable hit_count by 30
		//this is for panerfaust hits as they will cause a lot of damage each hit
		//and three hits should be enough to kill a tank
		hit_count += 30;
		
		//When the hit_count reaches 30 play these effects
		if(hit_count == 30)
		{
			thread loopfx("impact_sparks", fxpos_org, 1, 1);
			thread loopfx("ashsmoke", fxpos_org, 0.5, 1);
		}
		
		//When hit_count reaches 60 set the level wide variable level.fx to false
		//so the routine "loopfx" below will stop playing them, wait .5 then reset
		//the variable so the new effects will play
		if(hit_count == 60)
		{
			level.fx = false;
			wait(0.5);
			level.fx = true;
			thread loopfx("steam", fxpos_org, 0.5, 1);
			thread loopfx("smallfire", fxpos_org, 0.3, 1);
		}

		//When we get to 90 stop all effects looping and play a nice BOOM!
		//then delete the goodmodel and show the damaged one
		//and exit the main loop, trigger is still there but dosn't do anything
		if(hit_count == 90)
		{
			level.fx = false;
			wait(2);
			level.fx = true;
			thread loopfx("steam", fxpos_org, 0.5, 1);
			playfx(level._effect["tankmetalexp"], (fxpos_org));
			goodmodel delete();
			destroyedmodel show();
			break;
		}
	}
}	
	
   

loopfx(fxId, fxPos, waitime) {
if( (!isDefined(fxPos)) || (!isDefined(fxId)) )
   return;
if(!isDefined(waitime))
   waitime = 1;

   while (level.fx) {
      playfx(level._effect[fxId], fxPos);
      wait (waitime);
   }

tank_effects2()
{

	//If any of these entities are missing exit safely from the script
	
	//Trigger_damage on the tank; targetname is "tank_trig"
	trig = getent ("tank_trig2", "targetname");
	if(!isDefined(trig))
   return;
	
  //Undamaged tank model, make script_model, targetname "tank2"
	goodmodel = getent("tank2", "targetname");
	if(!isDefined(goodmodel))
   return;

  //Destroyed tank model, aslo script_model, targetname "tank_d"
	destroyedmodel = getent("tank_d2", "targetname");
	if(!isDefined(destroyedmodel))
   return;

  //Script origin, place where fx will show on tank, targetname "fx_org"
 	fxpos = getent("fx_org2", "targetname");
	if(!isDefined(fxpos))
   return;
	
	//Hide the destroyed model
	destroyedmodel hide();
   
	//Get the fx origin to play effects on   
	fxpos_org = fxpos getorigin();

	//Define a few variables used to keep track of damage levels
	//and to play or not play the effects
	hit_count = 0;
	level.fx = true;

	//Loop until damage level reaches 90 then exit loop		   
	while(1)
	{
   		
		//waits here for each hit on the trigger
		trig waittill("trigger");

		//Increment the variable hit_count by 30
		//this is for panerfaust hits as they will cause a lot of damage each hit
		//and three hits should be enough to kill a tank
		hit_count += 30;
		
		//When the hit_count reaches 30 play these effects
		if(hit_count == 30)
		{
			thread loopfx("impact_sparks", fxpos_org, 1, 1);
			thread loopfx("ashsmoke", fxpos_org, 0.5, 1);
		}
		
		//When hit_count reaches 60 set the level wide variable level.fx to false
		//so the routine "loopfx" below will stop playing them, wait .5 then reset
		//the variable so the new effects will play
		if(hit_count == 60)
		{
			level.fx = false;
			wait(0.5);
			level.fx = true;
			thread loopfx("steam", fxpos_org, 0.5, 1);
			thread loopfx("smallfire", fxpos_org, 0.3, 1);
		}

		//When we get to 90 stop all effects looping and play a nice BOOM!
		//then delete the goodmodel and show the damaged one
		//and exit the main loop, trigger is still there but dosn't do anything
		if(hit_count == 90)
		{
			level.fx = false;
			wait(2);
			level.fx = true;
			thread loopfx("steam", fxpos_org, 0.5, 1);
			playfx(level._effect["tankmetalexp"], (fxpos_org2));
			goodmodel delete();
			destroyedmodel show();
			break;
		}
	}
}	
	
   

loopfx(fxId, fxPos, waitime) {
if( (!isDefined(fxPos)) || (!isDefined(fxId)) )
   return;
if(!isDefined(waitime))
   waitime = 1;

   while (level.fx) {
      playfx(level._effect[fxId], fxPos);
      wait (waitime);
   }

tank_effects3()
{

	//If any of these entities are missing exit safely from the script
	
	//Trigger_damage on the tank; targetname is "tank_trig"
	trig = getent ("tank_trig3", "targetname");
	if(!isDefined(trig))
   return;
	
  //Undamaged tank model, make script_model, targetname "tank2"
	goodmodel = getent("tank3", "targetname");
	if(!isDefined(goodmodel))
   return;

  //Destroyed tank model, aslo script_model, targetname "tank_d"
	destroyedmodel = getent("tank_d3", "targetname");
	if(!isDefined(destroyedmodel))
   return;

  //Script origin, place where fx will show on tank, targetname "fx_org"
 	fxpos = getent("fx_org3", "targetname");
	if(!isDefined(fxpos))
   return;
	
	//Hide the destroyed model
	destroyedmodel hide();
   
	//Get the fx origin to play effects on   
	fxpos_org = fxpos getorigin();

	//Define a few variables used to keep track of damage levels
	//and to play or not play the effects
	hit_count = 0;
	level.fx = true;

	//Loop until damage level reaches 90 then exit loop		   
	while(1)
	{
   		
		//waits here for each hit on the trigger
		trig waittill("trigger");

		//Increment the variable hit_count by 30
		//this is for panerfaust hits as they will cause a lot of damage each hit
		//and three hits should be enough to kill a tank
		hit_count += 30;
		
		//When the hit_count reaches 30 play these effects
		if(hit_count == 30)
		{
			thread loopfx("impact_sparks", fxpos_org, 1, 1);
			thread loopfx("ashsmoke", fxpos_org, 0.5, 1);
		}
		
		//When hit_count reaches 60 set the level wide variable level.fx to false
		//so the routine "loopfx" below will stop playing them, wait .5 then reset
		//the variable so the new effects will play
		if(hit_count == 60)
		{
			level.fx = false;
			wait(0.5);
			level.fx = true;
			thread loopfx("steam", fxpos_org, 0.5, 1);
			thread loopfx("smallfire", fxpos_org, 0.3, 1);
		}

		//When we get to 90 stop all effects looping and play a nice BOOM!
		//then delete the goodmodel and show the damaged one
		//and exit the main loop, trigger is still there but dosn't do anything
		if(hit_count == 90)
		{
			level.fx = false;
			wait(2);
			level.fx = true;
			thread loopfx("steam", fxpos_org, 0.5, 1);
			playfx(level._effect["tankmetalexp"], (fxpos_org3));
			goodmodel delete();
			destroyedmodel show();
			break;
		}
	}
}	
	
   

loopfx(fxId, fxPos, waitime) {
if( (!isDefined(fxPos)) || (!isDefined(fxId)) )
   return;
if(!isDefined(waitime))
   waitime = 1;

   while (level.fx) {
      playfx(level._effect[fxId], fxPos);
      wait (waitime);
   }

tank_effects4()
{

	//If any of these entities are missing exit safely from the script
	
	//Trigger_damage on the tank; targetname is "tank_trig"
	trig = getent ("tank_trig4", "targetname");
	if(!isDefined(trig))
   return;
	
  //Undamaged tank model, make script_model, targetname "tank2"
	goodmodel = getent("tank4", "targetname");
	if(!isDefined(goodmodel))
   return;

  //Destroyed tank model, aslo script_model, targetname "tank_d"
	destroyedmodel = getent("tank_d3", "targetname");
	if(!isDefined(destroyedmodel))
   return;

  //Script origin, place where fx will show on tank, targetname "fx_org"
 	fxpos = getent("fx_org4", "targetname");
	if(!isDefined(fxpos))
   return;
	
	//Hide the destroyed model
	destroyedmodel hide();
   
	//Get the fx origin to play effects on   
	fxpos_org = fxpos getorigin();

	//Define a few variables used to keep track of damage levels
	//and to play or not play the effects
	hit_count = 0;
	level.fx = true;

	//Loop until damage level reaches 90 then exit loop		   
	while(1)
	{
   		
		//waits here for each hit on the trigger
		trig waittill("trigger");

		//Increment the variable hit_count by 30
		//this is for panerfaust hits as they will cause a lot of damage each hit
		//and three hits should be enough to kill a tank
		hit_count += 30;
		
		//When the hit_count reaches 30 play these effects
		if(hit_count == 30)
		{
			thread loopfx("impact_sparks", fxpos_org, 1, 1);
			thread loopfx("ashsmoke", fxpos_org, 0.5, 1);
		}
		
		//When hit_count reaches 60 set the level wide variable level.fx to false
		//so the routine "loopfx" below will stop playing them, wait .5 then reset
		//the variable so the new effects will play
		if(hit_count == 60)
		{
			level.fx = false;
			wait(0.5);
			level.fx = true;
			thread loopfx("steam", fxpos_org, 0.5, 1);
			thread loopfx("smallfire", fxpos_org, 0.3, 1);
		}

		//When we get to 90 stop all effects looping and play a nice BOOM!
		//then delete the goodmodel and show the damaged one
		//and exit the main loop, trigger is still there but dosn't do anything
		if(hit_count == 90)
		{
			level.fx = false;
			wait(2);
			level.fx = true;
			thread loopfx("steam", fxpos_org, 0.5, 1);
			playfx(level._effect["tankmetalexp"], (fxpos_org4));
			goodmodel delete();
			destroyedmodel show();
			break;
		}
	}
}	
	
   

loopfx(fxId, fxPos, waitime) {
if( (!isDefined(fxPos)) || (!isDefined(fxId)) )
   return;
if(!isDefined(waitime))
   waitime = 1;

   while (level.fx) {
      playfx(level._effect[fxId], fxPos);
      wait (waitime);
   }
 }

try that, but i slaped it together and didn't test it so corrections would be nice b/c I would like to fix my scripting errors for letter use. Thanks
nullFew tips for coding.
1. Keep the script as short as possible.
2. Don't comment every line. Only comment portions where they may be needed to point something out.
3. Don't over complicate the script, keep it organized and easy to read.

These help you find simple errors and makes it easy to make changes.
Share |
ilikepotatoes
General Member
Since: Jan 30, 2007
Posts: 35
Last: Dec 3, 2009
[view latest posts]
Level 2
Category: CoD Mapping
Posted: Saturday, Feb. 10, 2007 09:24 pm
ive added this to my gsc file, but now when i fire at a tank with a panzerfaust, nothing happens, no effects, no damage, no explosion, no nothing.[confused] Also becasue each tank has a separate thread, how do i link them all up into one objective?
Share |
WHC_Grassy
General Member
Since: Apr 20, 2005
Posts: 1426
Last: Aug 25, 2007
[view latest posts]
Level 8
Category: CoD Mapping
Posted: Saturday, Feb. 10, 2007 11:30 pm
Erm... I have re written the script to handle single or multiple targets, it's now mainly for SP usage.
Will test it today with a simple test map to shake out any bugs.
So hold on a little longer guys [thumbs_up]
Grassy
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty : CoD Mapping

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»