Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tutorial Destructible Editing 2
#1
Good evening

This is a second part from yesterdays tutorial about destructibles, this is not as good as the other. Is just info, I also found some other commands for them, but the game doesnt use them, because they are basically useless Sad

Destructibles uses 2 commands like hide() and show(), but for parts:

Code:
destructible ShowPart(tag name);
destructible HidePart(tag name);

The damages that it can suffer are depending on the damage mod:

Code:
melee = mod_melee, mod_crush
bullet = mod_pistol_bullet, mod_rifle_bullet
splash = mod_grenade, mod_grenade_splash, mod_projectile, mod_projectile_splash, mod_splsh
impact = mod_impact
unknown = mod_unknown

There are 2 types of destructibles: "real" destructibles and vehicles. You can know if its a vehicle using this:

Code:
isVehicle = ( GetSubStr( level.destructible_type[ self.destuctableInfo ].v[ "type" ], 0, 7 ) == "vehicle" );

You can destroy a destructible by using this:

Code:
destructible notify( "damage", 100000, self, self.origin, self.origin, "MOD_EXPLOSIVE", "", "" );

On some vehicles you can make their alarm sound with:

Code:
destructible do_car_alarm();

It uses this function to make them solid, it aplies a script_brushmodel

Code:
destructible destructible_handles_collision_brushes();

You can increase the number of destructibles with this:

Code:
level.destructibleSpawnedEntsLimit = 50;

Also destructibles have some damage and sound constants that can be nice to modify, you can find them in _destructible.gsc

Code:
MAX_SIMULTANEOUS_CAR_ALARMS = 2; //the number of alarms that can be played at same time, increasing it and shooting many cars is not a good idea, with a number higher than 4 laggs as hell
CAR_ALARM_ALIAS = "car_alarm"; //alarm sound
CAR_ALARM_OFF_ALIAS = "car_alarm_off"; //another alarm sound
CAR_ALARM_TIMEOUT = 25; //time it takes to the car alarm to stop if the car is not destroyed before, increase it to make an annoying battlefield, :troll:

MP_DAMAGE_BIAS = 1.0; //when you shot the damage that the destructible takes is the same as your weapon does
MP_EXPLOSIVE_DAMAGE_BIAS = 13.0; //with explosives the damage that your weapon cause is multiplied by 13
MP_SHOTGUN_BIAS = 4.0; //same as previous but with shotguns and multiplied by 4

You can modify these to customize a bit your maps

I also found this, but I havent tested it, when the map finishes loading some objects get deleted, I would like to know what they are:

Code:
deletables = GetEntArray( "delete_on_load", "targetname" );
foreach ( ent in deletables )
ent Delete();

And this is the way to get all destructibles:

Code:
destructibles = GetEntArray("destructible","targetname");

Destructibles also use this functions: SetCanDamage( true ); and ScriptModelPlayAnim

Another interesting thing is the use of a FX that creates a light, you can spawn this fx on your map on dark spots, can be great for zombie mod mapedits, on a dark bunker for example:

Code:
level._effect["spotlight_fx"] = loadfx("misc/fluorescent_spotlight");

All this + what I explained in this link allow you to customize many objects in the maps easily, also, you can modify many other objects such as metal detectors, vending machines or fans in _dynamic_world.gsc

http://www.itsmods.com/forum/Thread-Dest...iting.html

Good luck, Big Grin and OMA and Nyan Cat and Narwhal and Meow
Reply

#2
ty Tongue
are you sure about it ?
Code:
level._effect["spotlight_fx"] = loadfx("misc/fluorescent_spotlight");
it works only on some maps :3?
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#3
(10-08-2011, 17:58)Se7en Wrote: ty Tongue
are you sure about it ?
Code:
level._effect["spotlight_fx"] = loadfx("misc/fluorescent_spotlight");
it works only on some maps :3?

It works in all the maps that contain a fluorescent, and I think that all maps have at least 1(maybe afghan not)
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Request] need help with some mod editing aagje323 0 1,740 03-07-2013, 18:02
Last Post: aagje323
  Anti Killstreak Editing AboAlwe 5 4,224 04-28-2012, 11:00
Last Post: schoerg
  Help Can someone tell me which program do you use for creating/editing BO scripts/mods? fiki574_CRO 7 4,385 01-20-2012, 18:38
Last Post: fiki574_CRO
  [IDEA] editing code_gfx_pre/post.ff ProDiiGy 12 28,036 11-10-2011, 19:33
Last Post: ProDiiGy
Rainbow [Tutorial] Proper FX,sound,fog,ambient editing and spawning Yamato 0 3,230 10-08-2011, 15:49
Last Post: Yamato
  [Tutorial] Destructible Editing Yamato 1 2,833 10-08-2011, 13:18
Last Post: Nekochan
  [Test]Working Stat Editing Codes nity 17 11,025 07-05-2011, 05:24
Last Post: clxyeah
  GSC Editing Problem bill44445555 5 4,279 11-19-2010, 16:30
Last Post: TheSaboteur

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.