Art of War Central
View in iTunes
Please help us to raise in the ranks of podcasting and subscribe to our itunes feed using the link above.
The next MODSonair show will air LIVE on:
03/21/2010 12:03 EDT

Time remaining:
We Dontated to PixelEquity
"Mod or modification is a term generally applied to PC games, especially first-person shooters, RPGs and real-time strategy games." 2
 
Site News   |   Aggregated News   |   Forums   |   Tutorials   |   Downloads   |   Projects   |   Weblinks
Latest Forum Threads 
CoD4 MP Mapping.. Posts: (29) Views: (475) by {UST}Hogan
CoD4 General.. Posts: (82) Views: (99) by techno2sl
General Gaming.. Posts: (1) Views: (8) by Cerebral_Assassin
General Gaming.. Posts: (1) Views: (7) by Cerebral_Assassin
CoD2 MP Mapping.. Posts: (8) Views: (71) by PanZerReBorN
CoDWW Map + Mod .. Posts: (35) Views: (317) by dundy
CoD2 MP Mapping.. Posts: (4) Views: (53) by liltc64
CoD4 MP Mapping.. Posts: (10) Views: (144) by Infern4ll
CoD2 MP Mapping.. Posts: (9) Views: (75) by puncster1
CoD4 MP Mapping.. Posts: (17) Views: (88) by Infern4ll
Back to Home Page
MODSCON 2010 L4D2 Contest
Art of War Central
 
Forums
MODSonline.com 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, StrYdeR, techno2sl, batistablr, Welshy, Rasta, supersword, batistablr, playername, NovemberDobby
Latest Posts
Subscribed Posts
Search
Restricted Access Restricted Access subscribe
Author Topic: [NOOB] Random Script Help
Hippster
General Member
Since: Sep 21, 2008
Posts: 80
Last: Jan 21, 2010
[view latest posts]
Level 3
Category: CoD4 Scripting
Posted: Saturday, Jul. 4, 2009 04:36 am
Hellas out there,

i'm a total Noobie with scripting and i am pretty sure i didn't learn it ever...(i'm getting old)

I try to find a nice Tutorial or a Script to move a Brushmodel randomly...but i couldn't find something i can use...
In my special Case i try to move a Shadow Brush in random intervalls up and down, the Result should look like flickering lights...

When more Lights are used there are only the threadname has to be changed...

Is anyone willing to create me this script (i bet this is pretty simple) or show me how to do this?

I'll never get this scripting Thing into my Head (4* yrs old Fart)

Thx for making my Day [wave]
Sevenz
General Member
Since: Apr 24, 2006
Posts: 1988
Last: Mar 6, 2010
[view latest posts]
Level 8
Category: CoD4 Scripting
Posted: Saturday, Jul. 4, 2009 08:48 am
like this?

Call of Duty 4: Switches Primary Light
Hippster
General Member
Since: Sep 21, 2008
Posts: 80
Last: Jan 21, 2010
[view latest posts]
Level 3
Category: CoD4 Scripting
Posted: Saturday, Jul. 4, 2009 09:14 am
Hi Sevenz,

thanks, but...nope, this is the lightswitch i used [biggrin]...

what i need is a script where the brushmodels moving randomly...
cavia123
General Member
Since: Mar 30, 2007
Posts: 1
Last: Jul 4, 2009
[view latest posts]
Level 0
Category: CoD4 Scripting
Posted: Saturday, Jul. 4, 2009 10:15 am
Use the script from the tutorial and replace
self waittill("trigger");
by
wait(randomfloat(2));

where 2 is the maximum interval time in seconds.
Hippster
General Member
Since: Sep 21, 2008
Posts: 80
Last: Jan 21, 2010
[view latest posts]
Level 3
Category: CoD4 Scripting
Posted: Saturday, Jul. 4, 2009 12:52 pm
It Woks! [rocking]

Thanks a lot Dude, that is just what i need...
Great Board to get helped....[thumbs_up]
viper75
General Member
Since: Aug 18, 2009
Posts: 3
Last: Sep 13, 2009
[view latest posts]
Level 0
Category: CoD4 Scripting
Posted: Wednesday, Aug. 26, 2009 11:55 am
Hi guys I just did a bit change to the script that i found here:
cod4: Switches Primary light
Basically what i have done is just making that script working as a flicker light. That was pretty easy, but i can't get the light working.
I mean i can see the model swapping from com_studiolight_hanging_off to com_studiolight_hanging_on but when the shadow-caster brush move in order to cover the light just nothing happen . I tried to texture the brush with a concrete texture to see its correct behaviour on moving up and down and yes it is actually moving in the right way. My question is do i have to do some particular setting for a light? Also my gfx shadow option is turned on.

here my script:
Code:

main() { 
  precacheModel("com_studiolight_hanging_off"); 
  thread flicker(); 
} 
flicker(){ 
  while (true){ 
    speed = .01; 
    height = -36; 
    spotlight_hide = getent("spotlight_hide", "targetname");
    spotlight_model = getent( "spotlight_model", "targetname");
    if(isdefined(spotlight_model) && isdefined(spotlight_hide)){
       wait(randomfloat(0.6));       
       spotlight_hide movez (height, speed); 
       spotlight_model setmodel( "com_studiolight_hanging_off"); 
       spotlight_hide waittill ("movedone");
       wait(randomfloat(0.4)); spotlight_hide movez (height - (height * 2), speed); 
       spotlight_model setmodel( "com_studiolight_hanging_on" );  
       spotlight_hide waittill ("movedone"); 
    } else { 
       wait(6); 
       iprintlnbold ("Warning !!! - missing assets"); 
    } 
  } 
}


By the way my script has been tested and it is working good.
I bet i made a mistake on setting my light in cod4 radiant

Could you pls tell me what it's wrong?

Thanks a lot and sorry for my bad english as i am italian [pimp]


edited on Aug. 26, 2009 12:21 pm by viper75
Restricted Access Restricted Access subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 Scripting