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

Members Online

»
0 Active | 58 Guests
Online:

LATEST FORUM THREADS

»
Mohaa maps on Cod2?
CoD2 MP Mapping

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 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Previous Page
subscribe
Author Topic: move1 = ("move1","targetname"), anything wrong?
scillman
General Member
Since: Nov 23, 2006
Posts: 360
Last: Sep 1, 2012
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Friday, Jun. 5, 2009 12:43 pm
Dear Zelahim,

I tried your script and it just works fine over here. The only thing I noticed is that the "battlefield_smokebank_S" effect doesn't play.

Then there is a line that isn't used: "origin = move1 getorigin();" (You can better give origin a number or something it could cause errors in the future!

Yours,
Scillman

-----
P.S. the way I test it is with rewriting it on my own way, maybe you want to take a look into it ;)
Code:
main()
{
  maps\mp\_load::main();
  
  thread mortar();
}

mortarfx()
{
  level._effect[ "mortar_effect_dirt" ] = loadfx( "fx/explosions/artilleryExp_dirt_brown.efx" ); // Dirt effect
  level._effect[ "mortar_effect_smoke" ] = loadfx( "fx/smoke/battlefield_smokebank_S.efx" ); // Smoke effect (Didn't work!)
  level._effect[ "mortar_effect_3" ] = loadfx( "fx/explosions/mortarExp_beach.efx" ); // Unknown effect
}

mortar()
{
  level thread mortarfx(); // Load the FX

  mortar = getEnt( "mortar", "targetname" ); // The mortar
  mortar_shell_1 = getEnt( "mortarshell1", "targetname" ); // The shell wich will move into the air
  mortar_shell_2 = getEnt( "mortarshell2", "targetname" ); // The shell wich will move to the ground
  mortar_trigger = getEnt( "mortartrigger", "targetname" ); // The use trigger
  mortar_smoke = getEnt( "mortarsmoke", "targetname" ); // The place where smoke will be seen when fired
  mortar_origin = getEnt( "mortarorigin1", "targetname" ); // The place where the shell will move to
  mortar_effects = getEnt( "mortarfxorigin", "targetname" ); // The place for the impact fx
  top_layer = getEnt( "toplayer", "targetname" ); // The normal layer
  bot_layer = getEnt( "botlayer", "targetname" ); // The impact layer

  bot_layer Hide(); // Hide the impact layer
  mortar_shell_2 Hide(); // Hide the shell in the air

  mortar_trigger waittill( "trigger" ); // Wait for the trigger to be triggered
  playfx( level._effect[ "mortar_effect_smoke" ], mortar_smoke.origin ); // Play smoke from mortar
  // mortar_smoke playsound( "mortar_fired" ); // Plays a mortar fires sound

  mortar_shell_1 moveto( (mortar_origin.origin), 1 ); // Moves the shell into the air
  mortar_shell_1 waittill( "movedone" ); // Waits for the shell to arive

  mortar_shell_2 Show();
  mortar_shell_1 Delete();

  mortar_shell_2 moveto( (mortar_effects.origin), 1 ); // Moves the shell to the place of the impact
  mortar_shell_2 waittill( "movedone" ); // Waits for the sheel to arive at the ground

  playfx( level._effect[ "mortar_effect_dirt" ], mortar_effects.origin ); // The dirt effect
  playfx( level._effect[ "mortar_effect_smoke" ], mortar_effects.origin ); // The smoke effect
  playfx( level._effect[ "mortar_effect_3" ], mortar_effects.origin ); // The ? effect
  
  // mortar_effects playsound( "mortar_impact" ); // Plays the mortar impact sound

  mortar_shell_2 Delete(); // The shell will be deleted
  bot_layer Show(); // IMPORTANT otherwise players that are standing there can fall through, shows the impact layer
  top_layer Hide(); // Hides the normal layer

  earthquake( 0.3, 3, mortar_effects.origin, 5000 ); // Make a earthquacke on the place of impact
}
Share |
Zelzahim
General Member
Since: Dec 31, 2008
Posts: 42
Last: Sep 23, 2010
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Saturday, Jun. 6, 2009 12:58 am
Okey, now i finally solved it!

The error:

When i recalled the effects, i spelled it morteffekt(Im from sweden, where we spell it with k instead of c)
But when i've played the explosion, i spelled it with c.

Thanx for wasting your time anyway, It's gonna help me alot in the future!
Share |
Restricted Access Topic is Locked
Page
Previous Page
subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

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

»