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

Members Online

»
0 Active | 9 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: Flak destruction
BlindSniper
General Member
Since: Aug 22, 2008
Posts: 45
Last: May 29, 2013
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Tuesday, Aug. 2, 2011 01:01 pm
(For multiplayer) Basically what I'm doing is creating flak cannons that fire and create destruction on the other side of the map.
At the moment I have a working script for destroying tree & ground, it is variations on the following.
Code:
main()
{
 ground3_d = getent("ground3_d","targetname");
 ground3_d hide();ground3_d notsolid();
 ground3_d_decal = getent("ground3_d_decal","targetname");
 ground3_d_decal hide();ground3_d_decal notsolid();
 tree4_d = getent("tree4_d","targetname");
 tree4_d hide();tree4_d notsolid();
 thread tree_1();
{
ground3()
{
 impact = getent("ground3_impact","targetname");
 origin = impact GetOrigin(); 
 original = getent("ground3_org","targetname");		
 ground3_d = getent("ground3_d","targetname");	
 ground3_d_decal = getent("ground3_d_decal","targetname");	
 wait 1;
 thread flak1_fire();
 wait 1;
 impact playsound ("incoming", origin);
 wait 0.3;
 RadiusDamage(origin, 500, 1000, 500);
 Earthquake(0.75, 3, origin, 500);
 playfx(level._effect["dirt_impact"], origin);
 impact playsound ("dirt_impact", origin);
 wait 0.1;
 ground3_d  show();
 ground3_d solid();
 ground3_d_decal show();
 ground3_d_decal solid();
 original delete();
 thread tree4();
}
tree4()
{
 impact = getent("tree4_impact","targetname");
 origin = impact GetOrigin(); 
 original = getent("tree4_org","targetname");		
 tree4_d = getent("tree4_d","targetname");	
 wait 5;
 thread flak1_fire();
 wait 1;
 impact playsound ("incoming", origin);
 wait 0.3;
 RadiusDamage(origin, 500, 1000, 500);
 Earthquake(0.75, 3, origin, 500);
 playfx(level._effect["tree_impact"], origin);
 impact playsound ("tree_impact", origin);
 wait 0.1;
 tree4_d  show();
 tree4_d  solid();
 original delete();
 //thread tree5();
}
 flak1_fire()
{
 	flak_place = getent("flak_place1","targetname");
	origin = flak_place GetOrigin();
        //angles to be added later
  	playfx(level._effect["flak_flash"],origin);
	flak_place playsound ("flak88_fire",origin);
}

1. Is there a more efficient way of doing the same thing?
2. I have to define the destroyed brushmodel/script_models in the main and in each thread is there a way to define to for all threads?
3. I want to create destroyed walls, the way I was thinking of doing it was to have lots of brushmodels with the same name and then called in an array and hidden/show/deleted when needed but I don't know how to do this, can anyone help?

edited on Aug. 3, 2011 05:04 am by BlindSniper
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

»