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

Members Online

»
0 Active | 85 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
Category: CoD Mapping
CoD mapping and level design.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Setting trigger_damage spawn flags - I want grenade only damage!
Pikachupoo
General Member
Since: May 4, 2004
Posts: 48
Last: Oct 15, 2005
[view latest posts]
Level 2
Category: CoD Mapping
Posted: Wednesday, Oct. 6, 2004 04:52 pm
I'm having a bit of trouble setting spawnflags for a trigger_damage, for some reason they don't seem to work! I've got an exploding truck that I just want to explode from a grenade. I tick NO_Rifle etc, yet everything destroys it. I want only a very percise grenade shot to trigger it. You'll see from my script below that I've got lots of random things going on that'll spice up the gameplay. Anyways, does the damage settings need to be defined in the script?

Here's my script...

main()
{

//find everything with targetname "block"
thetrigger = getent("GMC2_trigger","targetname");

thetrigger thread GMC2_listens();


}
GMC2_listens()
{

//get the trucks

goodtruck = getent("GMC2_before","targetname");

truckafter = getent("GMC2_after","targetname");

//get location for special effects
fx = getent("GMC2_FX_pos","targetname");

if (isdefined(fx))
{FX_location = fx getorigin();
iprintln("fx defined");}
else
{iprintln("fx not defined");}


goodtruck show();
truckafter hide();

self waittill("damage", amount);


iprintln("effects play at: "+FX_location);
iprintln("the damage is " + amount);

randnum = randomIntRange(0,4);
randexplo = randomIntRange(0,3);
randsmoke = randomIntRange(5,10);
randsmoke2 = randomIntRange(5,10);
iprintln("randsmoke "+randsmoke);
iprintln("if it's 0 it'll explode "+randnum);

switch (randnum) { case 0:
switch (randexplo)
{
case 0:
goodtruck doDamage();
goodtruck playsound("mortar_explosion2");
playfx(level._effect["blacksmoke"], FX_location);
playfx(level._effect["explosion2"], FX_location);

goodtruck delete();
truckafter show();

for (i=0; i {
playfx(level._effect["blacksmoke"], FX_location);
wait(1);
}
break;
case 1:
//random smoke
for (i=0; i {
playfx(level._effect["fireheavysmoke"], FX_location);
wait(1);
}

//explode
goodtruck doDamage();
goodtruck playsound("mortar_explosion2");
playfx(level._effect["blacksmoke"], FX_location);
playfx(level._effect["explosion2"], FX_location);

goodtruck delete();
truckafter show();

for (i=0; i {
playfx(level._effect["blacksmoke"], FX_location);
wait(1);
}
break;
case 2:
//explode
goodtruck doDamage();
goodtruck playsound("mortar_explosion2");
playfx(level._effect["blacksmoke"], FX_location);
playfx(level._effect["explosion"], FX_location);

goodtruck delete();
truckafter show();

//random smoke
for (i=0; i {
playfx(level._effect["fireheavysmoke"], FX_location);
wait(1);
}

//explode
goodtruck doDamage();
goodtruck playsound("mortar_explosion2");
playfx(level._effect["blacksmoke"], FX_location);
playfx(level._effect["explosion2"], FX_location);

for (i=0; i {
playfx(level._effect["blacksmoke"], FX_location);
wait(1);
}
break;
default:
for (i=0; i {
playfx(level._effect["blacksmoke"], FX_location);
wait(1);
}
break;
}
default:
for (i=0; i {
playfx(level._effect["blacksmoke"], FX_location);
wait(1);
}
break;
}
}

doDamage()
{
die = getent("GMC2_boom","targetname");
borigin = die getorigin();
radiusDamage(borigin, 300.0, 2000, 1000);
return;
}



Share |
StrYdeR
General Member
Since: May 11, 2004
Posts: 11672
Last: Apr 20, 2024
[view latest posts]
Level 10
Admin
Forum Moderator
Im a HOST of MODSonair
Category: CoD Mapping
Posted: Wednesday, Oct. 6, 2004 10:40 pm
i dont think you can assign a health and expect your spawn flags not to be overridden...

try removing the health and see if the trigger (will only take one grenade..but will confirm my suspicion) only responds to nades then

[angryalien]
Share |
Pikachupoo
General Member
Since: May 4, 2004
Posts: 48
Last: Oct 15, 2005
[view latest posts]
Level 2
Category: CoD Mapping
Posted: Wednesday, Oct. 6, 2004 10:49 pm
Thanks for the reply Stryder, but what do u mean assigning a health? The only spawnflags I checked were NO_PISTOL and NO_RIFLE but it still works for any weapon :(

I'm pulling my hair out here cos I'm at the final stages of my map for the HOB Community Map Pack, think I might be holding up it's realease!
Share |
StrYdeR
General Member
Since: May 11, 2004
Posts: 11672
Last: Apr 20, 2024
[view latest posts]
Level 10
Admin
Forum Moderator
Im a HOST of MODSonair
Category: CoD Mapping
Posted: Wednesday, Oct. 6, 2004 10:54 pm
Quote:
self waittill("damage", amount);

this line i have to assume waits for a certain amount of damage to occur

i would redo your trigger script something like this:
change
Quote:
main()
{

//find everything with targetname "block"
thetrigger = getent("GMC2_trigger","targetname");

thetrigger thread GMC2_listens();


}

to
Quote:
main()
{
level thread GMC2_listens();
}


and
Quote:
GMC2_listens()
{

//get the trucks

goodtruck = getent("GMC2_before","targetname");

truckafter = getent("GMC2_after","targetname");

//get location for special effects
fx = getent("GMC2_FX_pos","targetname");

if (isdefined(fx))
{FX_location = fx getorigin();
iprintln("fx defined");}
else
{iprintln("fx not defined");}


goodtruck show();
truckafter hide();

self waittill("damage", amount);

didnt need to go further than this - all changes are up to this point
to
Quote:
GMC2_listens()
{

//get the trucks and the trigger

goodtruck = getent("GMC2_before","targetname");
thetrigger = getent("GMC2_trigger","targetname");
truckafter = getent("GMC2_after","targetname");

//get location for special effects
fx = getent("GMC2_FX_pos","targetname");

if (isdefined(fx))
{FX_location = fx getorigin();
iprintln("fx defined");}
else
{iprintln("fx not defined");}


goodtruck show();
truckafter hide();

thetrigger waittill("trigger", other);

[angryalien]
Share |
Pikachupoo
General Member
Since: May 4, 2004
Posts: 48
Last: Oct 15, 2005
[view latest posts]
Level 2
Category: CoD Mapping
Posted: Wednesday, Oct. 6, 2004 11:11 pm
Wow! Stryder, your the man! haha, you did in like a few mins what I've been trying to do all day! You'll certainly get a big thanks in the readme!

Oh btw, is there anyway to "fine tune" the damage, I mean I DO want it to explode from one grenade, but there's another truck nearby that blows up with it, I guess maybe reducing the damage from 300?

[biggrin]
Share |
StrYdeR
General Member
Since: May 11, 2004
Posts: 11672
Last: Apr 20, 2024
[view latest posts]
Level 10
Admin
Forum Moderator
Im a HOST of MODSonair
Category: CoD Mapping
Posted: Wednesday, Oct. 6, 2004 11:22 pm
reduce the damage radius...or try checking the splash and flame flags in the entity editor...that may do it for you too [angryalien]
Share |
Pikachupoo
General Member
Since: May 4, 2004
Posts: 48
Last: Oct 15, 2005
[view latest posts]
Level 2
Category: CoD Mapping
Posted: Wednesday, Oct. 6, 2004 11:27 pm
Tnx Stryder! I really appreciate your help [casanova]
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty : CoD Mapping

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

»