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

Members Online

»
0 Active | 54 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 MP Mapping
CoD 4 mapping and level design for multiplayer.
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: Destructible custom car
cskiller86
General Member
Since: Nov 23, 2009
Posts: 528
Last: Oct 25, 2011
[view latest posts]
Level 6
Category: CoD4 MP Mapping
Posted: Monday, Aug. 16, 2010 12:41 pm
Hey, guys.

So, I finally made my destructible custom car, but I took the easy route. It's based on the breakable windows script. So the normal car is replaced with a destroyed version, while an FX is played to cover up the replacement.

See here www.youtube.com

The destroyed version is a placeholder at the moment. I need to add a trigger to inflict damage in a certain radius and some explosions sounds, but I think it looks pretty realistic.

The only problem is that the car can be destroyed with bullets also. Does anyone know some way to destroy it only with explosives (grenades, RPG, C4) ?
Thanks.
Share |
_INSANE_
General Member
Since: Nov 7, 2008
Posts: 352
Last: Jul 10, 2011
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 MP Mapping
Posted: Monday, Aug. 16, 2010 06:49 pm
In the damage script..if you have meansofdeath defined...

Code:
car waittill("damage", damage, attacker, direction_vec, point, mod);


then say something below it like...

Code:
if(isDefined(mod) && (mod == "MOD_RIFLE_BULLET" || mod == "MOD_PISTOL_BULLET"))
	continue;
Share |
cskiller86
General Member
Since: Nov 23, 2009
Posts: 528
Last: Oct 25, 2011
[view latest posts]
Level 6
Category: CoD4 MP Mapping
Posted: Tuesday, Aug. 17, 2010 01:14 pm
Thanks for the reply, but I don't get it.
I tried just pasting the code, but I get an error: cannot cast undefined to bool. So, how do I define mod ?
Here's what the code looks like now:
Code:
		self waittill ("damage",amount, mod);
		if(isDefined(mod) && (mod == "MOD_RIFLE_BULLET" || mod == "MOD_PISTOL_BULLET"))
		continue;
		rmptotaldamage+=amount;
		if(rmptotaldamage>rmptargetdamage)
		{
			rmpbroken=1;
		}
The thread has been called on the trigger_damage, so the self at the beginning is that trigger.

I don't understand the waittill command very well. I know that a trigger_multiple or trigger_use will be triggered only when an entity will step inside or press Use if the following code is used
Code:
triggername waittill ("trigger". entity)
where entity can be level.player or an NPC in SP. Or that, in the code excerpt above, the trigger will be triggered only when it has "absorbed" a certain amount of damage.
So, I'm guessing there are multiple triggering conditions for each type of triggers. But what are those ? What words can be used ? Does anyone have a list ?

On another note, I tried making a blast damage when the car explodes, using a trigger_hurt, but I can't seem to make it work. I've ticked the START_OFF, NO_PROTECTION and ONCE flags, but I don't know how to trigger it. I want it to trigger when the damage one is triggered (when the car switch takes place and the FX is played). I tried this code
Code:
rmpblast waittill("trigger", rmptrigs);
where rmpblast is the trigger_hurt and rmptrigs is the trigger_damage.
Another option was moving the trigger (but apparently you can't do that).
So how do I activate a trigger based on another trigger or event ?

Thanks.
Share |
cskiller86
General Member
Since: Nov 23, 2009
Posts: 528
Last: Oct 25, 2011
[view latest posts]
Level 6
Category: CoD4 MP Mapping
Posted: Wednesday, Aug. 18, 2010 10:29 am
BUMP

I managed to move the trigger_hurt by changing its origin, so the setup works correctly (at map start the trigger is moved up in the sky, then when the car explodes it returns to where the car is and kills everyone then it gets deleted).

However, I would still like to learn how to activate a trigger based on another event or action.
And I would still like to learn how waittill is used and what are the commands.

The "bullet that destroys car" problem is still there.

Also, when a stock destructible car kills you, a car icon appears next to your name. But when my trigger_hurt kills you, the normal suicide icon appears (the one with the skull). How do I change this ?
Share |
liverare
General Member
Since: Apr 20, 2010
Posts: 30
Last: Nov 28, 2010
[view latest posts]
Level 2
Im a fan of MODSonair
Category: CoD4 MP Mapping
Posted: Wednesday, Aug. 18, 2010 11:16 am
if ur car has a damage trigger you can make it so only explosions can touch it by pressing N then checking the boxes on what weapons you want to attack and what weapons can go suck a Uncle Jack :o...
:D

edited on Aug. 24, 2010 07:12 am by liverare
Share |
_INSANE_
General Member
Since: Nov 7, 2008
Posts: 352
Last: Jul 10, 2011
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 MP Mapping
Posted: Wednesday, Aug. 18, 2010 07:18 pm
I think you'd have to leave the line as long as i had it. I think a bunch of other defines come before the meansofdeath...so basically you put 'mod' where the 'attacker' would be.
Share |
radiantprospect
General Member
Since: Aug 8, 2010
Posts: 23
Last: Jun 17, 2011
[view latest posts]
Level 1
Category: CoD4 MP Mapping
Posted: Thursday, Aug. 19, 2010 10:44 am
Dude thats awesome, hope you get it running all sweet:D.

Just one question, i was wondering what texture u use to make the white line in the middle of the road? I was trying to find that ages ago but was a no go for me:(

Thanks
Share |
cskiller86
General Member
Since: Nov 23, 2009
Posts: 528
Last: Oct 25, 2011
[view latest posts]
Level 6
Category: CoD4 MP Mapping
Posted: Thursday, Aug. 19, 2010 11:41 am
@liverare: yeah, I already tried ticking the RIFLE_NO, PISTOL_NO and MELEE_NO flags, but that didn't help (I was still able to shoot the car and the trigger would activate).

@radiantprospect: thanks; the texture is com_streetlines2; it's a decal applied on a thin patch of terrain

@INSANE: I'm not a complete noob when it comes to scripting, but I'm not that good either, so could you explain more in-depth, please ?
I recently discovered that MOD is Means Of Death :), but how do I define it at the start of the script ? Or even better is there a variable that the game uses to store the MOD ?
I've tried this
Code:
self waittill ("damage",amount,MOD_MELEE);
which I thought it would only add damage to the trigger if it was made by melee, but it doesn't work like that I guess.


On another note, I removed the trigger_hurt altogether because I found a better way to inflict damage to players. It's the RadiusDamage() command. And it's a lot better because it has a linear damage, so it will hurt you more if you are closer to the car and less if you are further away.
Share |
_INSANE_
General Member
Since: Nov 7, 2008
Posts: 352
Last: Jul 10, 2011
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 MP Mapping
Posted: Thursday, Aug. 19, 2010 06:42 pm
I never said you didn't know what you were doing... i only said you probably have to use the full line.

When something like a vehicle is damaged... it's notified with a series of different variables or whatnot... that are in a certain order. Like i said, try leaving the line the way i had it.. instead of cutting out stuff.

This is in mp\_destructible.gsc
type is the meansofdeath in this line..but u can change it to whatever word you want.. like i had 'mod'.
Code:
self waittill("damage", damage, attacker, direction_vec, point, type);
Share |
cskiller86
General Member
Since: Nov 23, 2009
Posts: 528
Last: Oct 25, 2011
[view latest posts]
Level 6
Category: CoD4 MP Mapping
Posted: Thursday, Aug. 19, 2010 09:38 pm
Oops, I didn't mean to imply that you said I don't know what I'm doing.
I just didn't understand your second reply and thought that someone more advanced would have understood it.
So I was explaining that even though I know a little bit of scripting, I'm not very good so I'd appreciate a simpler explanation.
Sorry for the confusion.

Anyway, I added the line exactly how you wrote it and it works like a charm.
This is what I have now:
Code:
while(!rmpbroken)
{
self waittill("damage", amount, attacker, direction_vec, point, type);
iprintln ("Damage type: " + type);
if (type == "MOD_RIFLE_BULLET" || type == "MOD_PISTOL_BULLET" || type == "MOD_MELEE" )
	continue;
rmptotaldamage+=amount;
iprintln ("Damage: " + amount);
iprintln ("Total damage: " + rmptotaldamage);
if(rmptotaldamage>rmptargetdamage)
	{
	rmpbroken=1;
	}
}

But there is something I don't understand about the script. AFAIK this line
Code:
if (type == "MOD_RIFLE_BULLET" || type == "MOD_PISTOL_BULLET" || type == "MOD_MELEE" )
		continue;
would translate to: if the type of damage is pistol, rifle or melee then continue and destroy the car. But in the game, the exact opposite is happening, the script continues only if the damage is NOT caused by pistol, rifle or melee. Which is exactly what I want, I'm not complaining, I just don't understand why it happens this way.

Now I have to find out how to change the killicon.

Anyway thank you very much for your help, Insane.
And if you have any more information about the waittill command, feel free to share :D
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 MP 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

»