| Author |
Topic: question about winter effects |
| Gagarin |
General Member Since: Apr 21, 2006 Posts: 35 Last: Feb 3, 2008 [view latest posts] |
|
|
|
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 ? |
 |
|
|
| sentchy |
General Member Since: May 6, 2006 Posts: 212 Last: Oct 31, 2006 [view latest posts] |
|
|
|
|
| Gagarin |
General Member Since: Apr 21, 2006 Posts: 35 Last: Feb 3, 2008 [view latest posts] |
|
|
|
|
| sentchy |
General Member Since: May 6, 2006 Posts: 212 Last: Oct 31, 2006 [view latest posts] |
|
|
|
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 |
 |
|
|
| FlesyM |
General Member Since: Jul 24, 2005 Posts: 399 Last: Jan 24, 2008 [view latest posts] |
|
|
|
|
| sentchy |
General Member Since: May 6, 2006 Posts: 212 Last: Oct 31, 2006 [view latest posts] |
|
|
|
|
| Gagarin |
General Member Since: Apr 21, 2006 Posts: 35 Last: Feb 3, 2008 [view latest posts] |
|
|
|
|
| sentchy |
General Member Since: May 6, 2006 Posts: 212 Last: Oct 31, 2006 [view latest posts] |
|
|
|
|
| sentchy |
General Member Since: May 6, 2006 Posts: 212 Last: Oct 31, 2006 [view latest posts] |
|
|
|
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!
|
 |
|
|
| Mystic |
 |
General Member Since: Apr 10, 2004 Posts: 6147 Last: Apr 15, 2018 [view latest posts] |
|
|
 |
 |
|
|
|
|
mp_TempleCall of Duty: Mods: Multiplayer (624.12Kb)
|