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

Members Online

»
0 Active | 8 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 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 subscribe
Author Topic: question about winter effects
Gagarin
General Member
Since: Apr 21, 2006
Posts: 35
Last: Feb 3, 2008
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Tuesday, Jul. 11, 2006 07:55 pm
Hi all. I have a problem. I read tutorial how to make winter effects, but have a message "script compile error". Ok, i made map, name is gr_test. In gr_test.gsc I'm write script :


include maps\_utility;
#include maps\_anim;

#using_animtree("generic_human");


main()
{
maps\_load::main();
maps\gr_test_fx::main();

// makes ai do cool stuff
setEnvironment ("cold");
}

In gr_test_fx i write script :

main()
{
precacheFX();
level thread playerEffect();
}

precacheFX()
{
level._effect["snow_light"] = loadfx ("fx/misc/snow_light.efx");
level._effect["cold_breath"] = loadfx ( "fx/misc/cold_breath.efx" );
}

playerEffect()
{
player = getent("player","classname");
for (;;)
{
playfx ( level._effect["snow_light"], player.origin + (0,0,300), player.origin + (0,0,350) );
wait (0.75);
}
}

What I'm doing wrong ?
Share |
sentchy
General Member
Since: May 6, 2006
Posts: 212
Last: Oct 31, 2006
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Tuesday, Jul. 11, 2006 08:32 pm
Are you creating a single or multi player map?

The script is a custom script for single player maps.

Animations do not work in multi-player maps but some of the winter effects that are done in your script still can be done in multiplayer though the script code has to be changed quite a lot since you deal with more than just one static player.
Share |
Gagarin
General Member
Since: Apr 21, 2006
Posts: 35
Last: Feb 3, 2008
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Tuesday, Jul. 11, 2006 08:47 pm
Hm, ok. I made a mp map. What script i need to make a winter ?
Share |
sentchy
General Member
Since: May 6, 2006
Posts: 212
Last: Oct 31, 2006
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Wednesday, Jul. 12, 2006 12:43 am
The following will just do the breathing effect of a player though there is still a positioning issue for some reason, maybe someone else can help.

I spend about an hour to get this to work right but it does not since there are some weird differences between single and multiplayer code, in this case the breathing effect is too high for some weird reason even if the code was half taken from the single player script.

I might work some more on the position with a spawned script_origin that is in the right spot but maybe someone else can help.

Code:
main()
{
  maps\_load::main();
  precacheFX();
  level thread playerEffect(level._effect["cold_breath"], 3);
}

precacheFX()
{
  level._effect["cold_breath"] = loadfx("fx/misc/cold_breath.efx");

  level._effect["snow_light"] = loadfx("fx/misc/snow_light.efx");

}

playerEffect(effect, delay)
{
  while(true)
  {
    players = getentarray("player", "classname");
    for(i=0; i < players.size; i++)
    {
      player = players[i];
      if (isalive(player))
      {
        playfxOnTag ( level._effect["cold_breath"], player, "TAG_EYE");
        playfx ( level._effect["snow_light"], player.origin + (0,0,300), player.origin + (0,0,350));
        }
      }
    }
    
    wait(delay);
  } 
}


edited on Jul. 11, 2006 08:45 pm by sentchy
Share |
FlesyM
General Member
Since: Jul 24, 2005
Posts: 399
Last: Jan 24, 2008
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Wednesday, Jul. 12, 2006 03:43 am
I never looked into winter effects ... there's some stock maps that has them, couldn't we just copy what has been done in them ?

pretty much all russian maps has them, no ?
Share |
sentchy
General Member
Since: May 6, 2006
Posts: 212
Last: Oct 31, 2006
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Wednesday, Jul. 12, 2006 11:37 am
I think you can copy the russian map code, just have to find which parts =)
Share |
Gagarin
General Member
Since: Apr 21, 2006
Posts: 35
Last: Feb 3, 2008
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Saturday, Jul. 15, 2006 02:53 pm
How can I create snowfall ? Any ideas ? How to create snowfall, how on this screenshot
Share |
sentchy
General Member
Since: May 6, 2006
Posts: 212
Last: Oct 31, 2006
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Sunday, Jul. 16, 2006 04:27 pm
I assume you cannot read german, since the link you basically posted seems to be a tutorial how to add snow effects to the cod2 maps.

The basic apprach described in the article is play the effect snow_heavy.efx. You might want to take rastas rain script and instead of rain play the snow_heavy.efx instead.
Share |
sentchy
General Member
Since: May 6, 2006
Posts: 212
Last: Oct 31, 2006
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Sunday, Jul. 16, 2006 04:51 pm
Ok, much easier to add the snow. This is from the mp_downtown_fx.gsc.

All you need is two lines after the call the multiplayer load:

Code:
  level._effect["snow_light"] = loadfx ("fx/misc/snow_light_mp_downtown.efx"); 
  maps\mp\_fx::loopfx("snow_light", (1648,-1464,175), 0.8, (1648,-1464,275));


Adjust the x,y coordinates for both vectors to a location in the middle of your map.

Most importantly, you need to run DX9 for snow!

Share |
Mystic
General Member
Since: Apr 10, 2004
Posts: 6147
Last: Apr 15, 2018
[view latest posts]
Level 10
Forum Moderator
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Sunday, Jul. 16, 2006 05:00 pm
That will effect you FPS as one LARGE efx isn't as frae effective as a smaller efx spawned above the player!
Share |
Restricted Access Topic is Locked 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

»