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

Members Online

»
0 Active | 66 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP 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 4
Category: CoD4 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: cod4 fx problem
routerv2
General Member
Since: Feb 25, 2011
Posts: 10
Last: Mar 5, 2011
[view latest posts]
Level 0
Category: CoD4 Scripting
Posted: Friday, Feb. 25, 2011 03:51 pm
Hi,
At the moment I am working on my map (mp_arabic_b) now everything goes on well but now I want to add somer FXs. I have followed multiple tutorials. I managed to add one FX to my map
(cs_steam.efx) But now i want to add the effect cigarsmoke_exhale.efx. I have tried various ways. I copied the lines from cs_steam and changed cs_steam to cigarsmoke_exhale. ( Also I changed createOneshotEffect to createLoopEffect since i dindn't see the FX with createOneshotEffect.)

Quote:
ent = maps\_utility::createLoopEffect( "cigarsmoke_exhale" );
ent.v[ "origin" ] = ( -126, -253.6, -578.8 );
ent.v[ "angles" ] = ( 270, 0, 0 );
ent.v[ "fxid" ] = "cigarsmoke_exhale";
ent.v[ "delay" ] = 0.5;


Then I get the following error:

ERROR
script compile error
Could not find script 'maps/_utility'
ent = maps\_utility::createloopeffect("cigarsmoke_exhale")'
(see console for details)


Ofcourse I checked the console but there was just the same.

Also I've tried this line
Quote:
maps\mp\_fx::loopfx("cigarsmoke_exhale", (-126.4, -253.6, -578.8.0), 0.2);


Then I don't get an error but the FX will not appear

Ofcourse I added the effect to my CSV
Quote:
fx,smoke/cigarsmoke_exhale

I've added a rar with my GSCs

Thanks in advance

Router

( I forgot the attach the file -.-) and i cant Change it so here is a link. Click



edited on Feb. 25, 2011 10:51 am by routerv2

edited on Feb. 26, 2011 06:31 am by routerv2

edited on Feb. 26, 2011 06:31 am by routerv2
Share |
odilasa1
General Member
Since: Nov 7, 2010
Posts: 66
Last: Dec 24, 2011
[view latest posts]
Level 3
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Saturday, Feb. 26, 2011 04:45 pm
Looks like you need to add this in your .gsc:

Code:
	maps\createfx\mp_arabic_b_fx::main();


Also if you still don't see it where you want it, you may need to adjust the angles of the FX.
Share |
routerv2
General Member
Since: Feb 25, 2011
Posts: 10
Last: Mar 5, 2011
[view latest posts]
Level 0
Category: CoD4 Scripting
Posted: Saturday, Feb. 26, 2011 06:56 pm
Thank you for you reply

Ok so that would be 270, 0, 0 for straight up i guess ?
but how would the line look like then ?

something like this ?
Code:
maps\mp\_fx::loopfx("cigarsmoke_exhale", (-126.4, -253.6, -578.8.0), 0.2) 270, 0, 0); 


about the line I need to add

in my mp_arabic_b.gsc stands
Code:
maps\mp\mp_arabic_b_fx::main();


and in my mp_arabic_b_fx.gsc ( in raw/maps/mp) stands
Code:
maps\createfx\mp_arabic_b_fx::main();


so that should be ok correct me if I'm wrong im a complete newb in scripting [confused]

Router



Share |
odilasa1
General Member
Since: Nov 7, 2010
Posts: 66
Last: Dec 24, 2011
[view latest posts]
Level 3
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Saturday, Feb. 26, 2011 09:13 pm
I noticed also you had a typo (wrong location) in:

\raw\maps\createfx\mp_arabic_b_fx.gsc
Code:

ent = maps\_utility::createLoopEffect( "cigarsmoke_exhale" );


Should have
Code:

ent = maps\mp\_utility::createLoopEffect( "cigarsmoke_exhale" );


Good luck. [thumbs_up] [biggrin]

edited on Feb. 26, 2011 04:13 pm by odilasa1
Share |
Samuel033
General Member
Since: Dec 10, 2009
Posts: 484
Last: Dec 25, 2015
[view latest posts]
Level 5
Category: CoD4 Scripting
Posted: Saturday, Feb. 26, 2011 09:39 pm
Both utility files (maps and maps/mp) have that function. But maybe one of them doesnt recognize something?
Share |
routerv2
General Member
Since: Feb 25, 2011
Posts: 10
Last: Mar 5, 2011
[view latest posts]
Level 0
Category: CoD4 Scripting
Posted: Saturday, Feb. 26, 2011 10:38 pm
Okay I've done the following.

I changed the line you said that was wrong. I recompiled my map. and tested it, once more cs_steam works.
but cigarsmoke_exhale won't work.

This is what I got now:
raw/maps/mp/mp_arabic_b.gsc
Code:
main()
{
thread fanSpin();
maps\mp\_load::main();

maps\mp\mp_arabic_b_fx::main();

//maps\mp\_compass::setupMiniMap("compass_map_mp_shipment");

//setExpFog(500, 3500, .5, 0.5, 0.45, 0);
ambientPlay("ambient_middleeast_ext");
//VisionSetNaked( "mp_vacant" );

game["allies"] = "marines"; 
game["axis"] = "opfor"; 

game["attackers"] = "axis";
game["defenders"] = "allies";
game["allies_soldiertype"] = "desert"; 
game["axis_soldiertype"] = "desert"; 
setdvar( "r_specularcolorscale", "1" );

setdvar("r_glowbloomintensity0",".1");
setdvar("r_glowbloomintensity1",".1");
setdvar("r_glowskybleedintensity0",".1");
//setdvar("compassmaxrange","1500");
}


fanspin()
{
fan = getentarray("ventilator", "targetname");
for(i = 0; i < fan.size; i++)
fan[i] thread fanrotate(randomint(4) + 2);
}

fanrotate(speed)
{
while(1)
{
self rotateyaw(360, speed, 0 ,0);
wait(speed - 0.1);
}
}


raw/maps/mp/mp_arabic_b_fx.gsc
Code:
main()
{
	level._effect[ "steam_cs" ]	= loadfx( "smoke/steam_cs" );
               level._effect[ "steam_cs" ]	= loadfx( "smoke/cigarsmoke_exhale" ); 

	if ( getdvar( "clientSideEffects" ) != "1" )
		maps\createfx\mp_arabic_b_fx::main();
		
}


and raw/maps/createfx/mp_arabic_b_fx.gsc

Code:
//_createfx generated. Do not touch!!
main()
{
ent = maps\mp\_utility::createOneshotEffect( "steam_cs" );
ent.v[ "origin" ] = ( -398.0, 1708.0, -220.0 );
ent.v[ "angles" ] = ( 270, 0, 0 );
ent.v[ "fxid" ] = "steam_cs";
ent.v[ "delay" ] = -15;
ent.v[ "soundalias" ] = "fire_metal_large";


ent = maps\mp\_utility::createLoopEffect( "cigarsmoke_exhale" );
     	ent.v[ "origin" ] = (-126.4, -253.6, -578.8 );
     	ent.v[ "angles" ] = ( 270, 0, 0 );
     	ent.v[ "fxid" ] = "cigarsmoke_exhale";
     	ent.v[ "delay" ] = 0.5;
}


I really don't have an idea what could be wrong :S
maybe
Code:
maps\mp\_fx::loopfx("cigarsmoke_exhale", (-126.4, -253.6, -578.8.0), 0.2) 270, 0, 0); 

is this better but im not sure about the angle part ( 270, 0 ,0 that part)

Router



Share |
odilasa1
General Member
Since: Nov 7, 2010
Posts: 66
Last: Dec 24, 2011
[view latest posts]
Level 3
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Saturday, Feb. 26, 2011 11:11 pm
routerv2 writes...
Quote:

Code:

main()
{
	level._effect[ "steam_cs" ]	= loadfx( "smoke/steam_cs" );
        level._effect[ "steam_cs" ]	= loadfx( "smoke/cigarsmoke_exhale" ); 

	if ( getdvar( "clientSideEffects" ) != "1" )
		maps\createfx\mp_arabic_b_fx::main();
		



Here you defined the FX incorrectly. Just change it to match your createfx .gsc [ "cigarsmoke_exhale" ] and it should work. Also you don't have to recompile your BSP to see FX changes, just rebuild your fast file. Hope this helps [thumbs_up]

edited on Feb. 26, 2011 06:11 pm by odilasa1

edited on Feb. 26, 2011 06:11 pm by odilasa1
Share |
routerv2
General Member
Since: Feb 25, 2011
Posts: 10
Last: Mar 5, 2011
[view latest posts]
Level 0
Category: CoD4 Scripting
Posted: Sunday, Feb. 27, 2011 01:51 pm
Hi,

I changed the line to:
Code:
level._effect["cigarsmoke_exhale" ] = loadfx( "smoke/cigarsmoke_exhale" );


and once more no effect [cry]

about the recompile the map I made some changes
so I had to recompile [wink].

Router
Share |
odilasa1
General Member
Since: Nov 7, 2010
Posts: 66
Last: Dec 24, 2011
[view latest posts]
Level 3
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Sunday, Feb. 27, 2011 10:05 pm
Hmm...

Run your map and try this in your console

Code:
/noclip


Then:

Code:
/setviewpos -126.4, -253.6, -578.8


These are the coords for the FX, you should check this area and make sure it is facing the way you want. If it is up against a brush or model you might not see it.

edited on Feb. 27, 2011 05:06 pm by odilasa1
Share |
routerv2
General Member
Since: Feb 25, 2011
Posts: 10
Last: Mar 5, 2011
[view latest posts]
Level 0
Category: CoD4 Scripting
Posted: Monday, Feb. 28, 2011 01:45 pm
I've tried that nothing [cry]
The angle is 270,0,0 so it should point upwards right ?





edited on Feb. 28, 2011 08:47 am by routerv2
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 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

»