![]() |
|
|
#1 (permalink) |
|
Neuer Benutzer
Registriert seit: 23.08.2009
Beiträge: 3
|
Hallo weiß jemand wie man eine weapon.def selber schreibt??
Ich möchte die luger durch eine kettensäge ersetzen wenn ich standard def der kettensäge benute stürtzt das spiel immer ab würde die gern anpassen. hier die def der kettensäge /************************************************** ********************* weapon_chainsaw.script ************************************************** *********************/ #define CHAINSAW_FIRERATE 0.1 // blend times #define CHAINSAW_IDLE_TO_LOWER 4 #define CHAINSAW_IDLE_TO_FIRE 4 #define CHAINSAW_RAISE_TO_IDLE 4 #define CHAINSAW_FIRE_TO_IDLE 4 object weapon_chainsaw : weapon_base { float next_attack; void init(); void Lower(); void Raise(); void Idle(); void Fire(); void ExitCinematic(); }; void weapon_chainsaw::init() { next_attack = 0; weaponState( "Raise", 0 ); } void weapon_chainsaw::destroy() { stopSound( SND_CHANNEL_WEAPON, false ); startSound( "snd_putaway", SND_CHANNEL_ITEM, false ); } void weapon_chainsaw::Raise() { weaponRising(); playAnim( ANIMCHANNEL_ALL, "raise" ); waitUntil( animDone( ANIMCHANNEL_ALL, CHAINSAW_RAISE_TO_IDLE ) ); weaponState( "Idle", CHAINSAW_RAISE_TO_IDLE ); } void weapon_chainsaw::Lower() { weaponLowering(); playAnim( ANIMCHANNEL_ALL, "putaway" ); waitUntil( animDone( ANIMCHANNEL_ALL, 0 ) ); weaponHolstered(); waitUntil( WEAPON_RAISEWEAPON ); weaponState( "Raise", 0 ); } void weapon_chainsaw::Idle() { float currentTime; float ammoClip; float avail; float clip_size; clip_size = clipSize(); weaponReady(); playCycle( ANIMCHANNEL_ALL, "idle" ); while( 1 ) { if ( WEAPON_LOWERWEAPON ) { weaponState( "Lower", CHAINSAW_IDLE_TO_LOWER ); } currentTime = sys.getTime(); if ( ( currentTime >= next_attack ) && WEAPON_ATTACK ) { weaponState( "Fire", CHAINSAW_IDLE_TO_FIRE ); } waitFrame(); } } void weapon_chainsaw::Fire() { float currentTime; playAnim( ANIMCHANNEL_ALL, "melee_start" ); melee(); startSound( "snd_startattack", SND_CHANNEL_WEAPON, false ); waitUntil( animDone( ANIMCHANNEL_ALL, 3 ) ); startSound( "snd_attack", SND_CHANNEL_WEAPON, false ); waitUntil( animDone( ANIMCHANNEL_ALL, 0 ) ); playCycle( ANIMCHANNEL_ALL, "melee_loop" ); next_attack = sys.getTime(); while ( WEAPON_ATTACK ) { currentTime = sys.getTime(); if ( currentTime >= next_attack ) { melee(); next_attack = currentTime + CHAINSAW_FIRERATE; } waitFrame(); } startSound( "snd_stopattack", SND_CHANNEL_WEAPON, false ); playAnim( ANIMCHANNEL_ALL, "melee_end" ); waitUntil( animDone( ANIMCHANNEL_ALL, 0 ) ); weaponState( "Idle", CHAINSAW_FIRE_TO_IDLE ); } void weapon_chainsaw::ExitCinematic() { next_attack = 0; weaponState( "Idle", 0 ); } und hier die der luger /************************************************** ********************* weapon_pistol.script ************************************************** *********************/ object weapon_pistol : weapon_clip { void preinit(); void DoFire(); // void PlayFireAnim(); } void weapon_pistol: reinit() {hasScope = false; hasIronSights = true; fireRateSingle = getFloatKeyWithDefault( "fire_rate", 0.2f ); float surfaceId = -1; if ( sys.getLocalViewPlayer() != myPlayer || pm_thirdperson.getBoolValue() ) { /* entity worldModel = getWorldModel( 0 ); // FIXME surfaceId = worldModel.getSurfaceId( "silencer" ); if (surfaceId >= 0) { worldModel.hideSurface( surfaceId ); }*/ } else { surfaceId = getSurfaceId( "silencer" ); if (surfaceId >= 0) { hideSurface( surfaceId ); } } } void weapon_pistol: oFire() {if ( !mainFireDown ) { FireSingle(); } } // TODO!!! /* void weapon_pistol::PlayFireAnim() { if ( ammoInClip( 0 ) == 1 ) { // TODO: click to indicate last bullet } if ( ironSightsEnabled ) { playAnim( ANIMCHANNEL_ALL, "fire_zoom" ); } else { playAnim( ANIMCHANNEL_ALL, "fire" ); } } */ Geändert von Monk3yMan (19.09.2009 um 15:25 Uhr) |
|
|
|
![]() |
| Lesezeichen |
| Themen-Optionen | |
| Ansicht | |
|
|