PDA

View Full Version : PICK up and MOVE MG42 Mod (Mobile MG42)



G-Stuff002
22nd February 2018, 11:57
Hi, I want to combine a function pick up and move ("installation" put on the ground MG42) with allcustom weapons v1a mod.

I think this function is much more interesting rather than just carrying a gun like everyone else. With this the COD2 have more tactics play, i think.

I upload screens and mod to better understand. After i will be watch and disassemble/find scripts. If you can help, I'll be glad

1404 1405 1406 1407 1408 1409 1410 1411
1412 1413

G-Stuff002
22nd February 2018, 12:06
All Custom Weapons (v1a): https://www.nexusmods.com/callofduty2/mods/673?tab=files

awe_cod2_v3.4.2 mod with function for MG42: 1414

G-Stuff002
22nd February 2018, 16:10
In awe_cod2_v3.4.2 cut

images/hud_mg42.iwi
materials/weapon_mg42
weapons/mpmg42_mp - This file not include in weapons folder on All Custom Weapons (v1a) So MG42 is loaded from another location...

For try i renamed mg42_mp to p38_mp (because All Custom Weapons mod have it) and I saw the right weapon for installation (upload screen)
It is necessary to do the decoupling and loading from weapons folder for mpmg42_mp
1415

G-Stuff002
22nd February 2018, 16:17
...i go searching the scripts in AWE mod

G-Stuff002
22nd February 2018, 16:32
In awe_cod2_v3.4.2 (here are the script for plug (installation of MG42)

awe.cfg:

////////////////////
// Turret options //
////////////////////

// Disable all fixed MG42s in the map (0 = no, 1 = yes) (default 0)
//set awe_mg42_disable "0"

// Times before a turret overheats (0 = disabled, any other = time in seconds) (default 10)
//set awe_turret_overheat "10"

// Time before an overheated turret starts to cool down (time in seconds) (default 5)
//set awe_turret_cooldown "5"

// Time to plant a mobile turret, in seconds (default = 3)
//set awe_turret_plant_time "3"

// Time to pick up a mobile turret, in seconds (default = 2)
//set awe_turret_pick_time "2"

// Ammo for mobile MG42 (between 1 and 999, default = 250)
//set awe_mg42_ammo 250

// Allow to fix mobile turrets and unfix fixed turrets (0 = no, 1 = yes, default = 1)
//set awe_turret_fix_unfix "1"

// Time to fix a mobile turret, in seconds (default = 3)
//set awe_turret_fix_time "3"

// Time to unfix a fixed turret, in seconds (default = 2)
//set awe_turret_unfix_time "2"



//////////////////////
// Damage modifiers //
//////////////////////

// Turrets
//set awe_dmgmod_mg42_mp "100"

G-Stuff002
22nd February 2018, 17:57
In zzz_allcustom_v1a.iwd\maps\mp\gametypes\_mapentity .gsc

I found this script but i dont know what is do it

////Worm's REmove MG42 script////
Remove_Map_Entity()
{
if(getCvar("scr_allow_turret") == "")
setCvar("scr_allow_turret", "1");
level.allow_turret = getCvarInt("scr_allow_turret");

if (!level.allow_turret)
{
deletePlacedEntity("misc_turret");
deletePlacedEntity("misc_mg42");
}
}

deletePlacedEntity(entity)
{
entities = getentarray(entity, "classname");
for(i = 0; i < entities.size; i++)
entities[i] delete();
}

G-Stuff002
22nd February 2018, 18:17
In _dmgmod.gsc:

init()
{
// Damage modifiers

// Turrets
/*
level.awe_dmgmod["mg42_bipod_duck_mp"] = awe\_util::cvardef("awe_dmgmod_mg42_bipod_duck_mp",100,0,9999,"float")*0.01;
level.awe_dmgmod["mg42_bipod_prone_mp"] = awe\_util::cvardef("awe_dmgmod_mg42_bipod_prone_mp",100,0,9999,"float")*0.01;
level.awe_dmgmod["mg42_bipod_stand_mp"] = awe\_util::cvardef("awe_dmgmod_mg42_bipod_stand_mp",100,0,9999,"float")*0.01;

*/

level.awe_dmgmod["mg42_mp"] = awe\_util::cvardef ("awe_dmgmod_mg42_mp", 100, 0, 9999, "float") * 0.01;

}

G-Stuff002
22nd February 2018, 18:31
In _global.gsc

////////////////////
// Initialization //
////////////////////

// Do various startup things
init()
{
// Kill any global threads that are running
level notify("awe_killthreads");

SetupVariables();

// Init stuff
awe\_turrets::init();

--------------------------------------------------------

_player.gsc:

(Have many codes with turret)

//////////////////////
// Init and Cleanup //
//////////////////////

// Called from PlayerConnect
PlayerConnect()
{
Cleanup();

// Start threads
self thread StartPlayerThreads();
}

// Called from PlayerDisconnect
PlayerDisconnect()
{
// Kill running threads
self notify("awe_killthreads");

// Clear variables etc...
CleanupKilled();
}

PlayerDamage(eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime)
{
// Block friendly melee in some cases (body search, etc...)
if(level.awe_teamplay && isPlayer(self) && isPlayer(eAttacker) && self.sessionteam == eAttacker.sessionteam && sMeansOfDeath == "MOD_MELEE")
{
if(isDefined(self.awe_tripwiremessage) || isDefined(self.awe_turretmessage))
return -1;
}

// Damaged by a player while under spawnprotection?
if(isplayer(eAttacker) && self.awe_invulnerable)
{
if (eAttacker != self)
switch (level.awe_spawnprotectionpunish)
{
case 1 :
eAttacker iprintlnbold (&"AWE_SPROT_DONT_ATTACK");
eAttacker awe\_turrets::leaveTurret ();
eAttacker dropItem (eAttacker getcurrentweapon ());
break;
case 2 :
eAttacker iprintlnbold (&"AWE_SPROT_DONT_ATTACK");
eAttacker finishPlayerDamage (eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime);
break;
case 3 :
eAttacker iprintlnbold (&"AWE_SPROT_DONT_ATTACK");
eAttacker suicide ();
break;
default :
}
return -1;
}

if (isdefined (self.awe_funmod_active_pu) && (self.awe_funmod_active_pu == "invulnerable"))
return -1;

// Damage modifiers
if(sMeansOfDeath != "MOD_MELEE" && isdefined(level.awe_dmgmod[sWeapon]))
iDamage = int(iDamage * level.awe_dmgmod[sWeapon]);

// Was the attacker a spawnprotected player?
if(isPlayer(eAttacker) && eAttacker != self && eAttacker.awe_invulnerable && level.awe_spawnprotectiondropweapon)
{
eAttacker iprintlnbold(&"AWE_SPROT_DONT_ABUSE");
eAttacker dropItem(eAttacker getcurrentweapon());
}

// Stop damage from teamkiller
if(level.awe_teamplay && isPlayer(eAttacker) && (self != eAttacker) && (self.pers["team"] == eAttacker.pers["team"]))
{
if(eAttacker.pers["awe_teamkiller"])
{
eAttacker.friendlydamage = true;
iDamage = int(iDamage * .5);
// Make sure at least one point of damage is done
if(iDamage < 1)
iDamage = 1;

eAttacker finishPlayerDamage(eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime);
eAttacker.friendlydamage = undefined;

friendly = true;

iDamage = -1;
}
}

return iDamage;
}

PostPlayerDamage(eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime)
{
// Splatter on attacker?
if(isPlayer(eAttacker) && (sMeansOfDeath == "MOD_MELEE" || distance(eAttacker.origin , self.origin ) < 40 ) )
eAttacker thread awe\_bloodyscreen::Splatter_View();

// Still alive?
if(isalive(self))
{
// Pains sound
if(level.awe_painsound)
self painsound();

// Do helmetpopping etc... ?
switch(sHitLoc)
{
case "helmet":
case "head":
self thread awe\_bloodyscreen::Splatter_View();
if( randomInt(100) < level.awe_pophelmet && !self.awe_helmetpopped)
self awe\_popping::popHelmet( vDir, iDamage );
break;
}

/* // Do stuff
switch(sHitLoc)
{
case "right_hand":
case "left_hand":
case "gun":
if( !isdefined(level.awe_merciless) && randomInt(100)<level.awe_droponhandhit)
self dropItem(self getcurrentweapon());
break;

case "right_arm_lower":
case "left_arm_lower":
if(!isdefined(level.awe_merciless) && randomInt(100)<level.awe_droponarmhit )
self dropItem(self getcurrentweapon());
break;

case "right_foot":
case "left_foot":
if(randomInt(100)<level.awe_triponfoothit)
self thread spankme(1);
break;

case "right_leg_lower":
case "left_leg_lower":
if(randomInt(100)<level.awe_triponleghit)
self thread spankme(1);
break;
}*/
}
}

PlayerKilled(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration)
{
if(self.sessionteam == "spectator")
return;

if(isPlayer(attacker))
{
if(attacker == self) // killed himself
{
}
else
{
self thread awe\_announcer::checkHeadKill (attacker, sHitLoc, sMeansOfDeath);
attacker thread awe\_announcer::accountKill ();
attacker thread awardExtraPoints (sHitLoc, sMeansOfDeath, sWeapon);

if(level.awe_teamplay && self.pers["team"] == attacker.pers["team"]) // killed by a friendly
{
attacker awe\_teamkilling::TeamKill();
self thread awe\_announcer::teamkill (attacker);
}
else // killed by an enemy
{
}
}
}
else // If you weren't killed by a player, you were in the wrong place at the wrong time
{
}

self thread awe\_announcer::accountDeath ();
self thread awe\_announcer::checkFirstblood (attacker);

dopop = false;
// Check for headpopping
switch(sHitLoc)
{
case "head":
case "helmet":
self thread awe\_bloodyscreen::Splatter_View();
if( randomInt(100) < level.awe_pophelmet && !self.awe_helmetpopped)
self awe\_popping::popHelmet( vDir, iDamage );
if( level.awe_popheadbullet && sMeansOfDeath != "MOD_MELEE" && (awe\_util::isWeaponType("rifle",sWeapon) || awe\_util::isWeaponType("sniper",sWeapon) || awe\_util::isWeaponType("turret",sWeapon)) )
dopop = true;
break;
default:
break;
}
// iprintln("sMoD:"+sMeansOfDeath + " iDmg:" + iDamage + " sHL:" + sHitLoc);
switch(sMeansOfDeath)
{
case "MOD_MELEE":
if(level.awe_popheadmelee && iDamage>=100 )
dopop = true;
break;
case "MOD_PROJECTILE":
case "MOD_PROJECTILE_SPLASH":
case "MOD_GRENADE_SPLASH":
case "MOD_EXPLOSIVE":
if(level.awe_popheadexplosion && iDamage>=100 )
dopop = true;
break;
default:
break;
}

if(dopop)
{
if(randomInt(100) < level.awe_pophead && !self.awe_headpopped)
self awe\_popping::popHead( vDir, iDamage);
else if(randomInt(100) < level.awe_pophelmet && !self.awe_helmetpopped)
self awe\_popping::popHelmet( vDir, iDamage);
}

// Drop health
awe\_healthpacks::dropHealth();

// Clear variables etc...
CleanupKilled(sMeansOfDeath);
}

/////////////
// Threads //
/////////////

StartPlayerThreads()
{
// End this thread on disconnect only
self endon("disconnect");

self thread awe\_clan::PlayerConnect ();

self setClientCvar ("ui_compassmodel", level.awe_compassmodel);

self.awe_sprintweapon = level.awe_sprintweapon;

for(;;)
{
// Wait for player to spawn
self waittill("spawned_player");
RunOnSpawn();
wait .05;
}
}

// Thread run on each player, every second
EverySecondThread()
{
self endon("awe_killthreads");

sprinthudvisible = false;
self.awe_pace = 0;

oldprimary = self.awe_sprintweapon;
oldammo = 0;
oldclip = 0;
oldprimaryb = self.awe_sprintweapon;
oldammob = 0;
oldclipb = 0;

// Avoid some undefined errors
self.awe_oldprimary2 = self getWeaponSlotWeapon("primary");
self.awe_oldammo2 = self getWeaponSlotAmmo("primary");
self.awe_oldclip2 = self getWeaponSlotClipAmmo("primary");
self.awe_oldprimaryb = self getWeaponSlotWeapon("primaryb");
self.awe_oldammob = self getWeaponSlotAmmo("primaryb");
self.awe_oldclipb = self getWeaponSlotClipAmmo("primaryb");

ch_count=0;

if(level.awe_teamplay)
myteam = self.sessionteam;
else
myteam = self.pers["team"];

oldpos = self.origin;

while( isPlayer(self) && isAlive(self) && self.sessionstate=="playing" )
{
delayed = 0;
awe\_healthbar::UpdateHealthBar();

// Get the current weapon
cw = self getCurrentWeapon();

// Get the stance every second
self.awe_stance = self awe\_util::GetStance(false);

// Show/Hide the sprint hint
if(level.awe_sprint && level.awe_sprinthudhint)
{
if(!sprinthudvisible && self.awe_sprinttime && !self.awe_sprinting && self.awe_pace && level.awe_sprint>self.awe_stance)
{
if(isdefined(self.awe_sprinthud_hint))
{
self.awe_sprinthud_hint fadeOverTime (1);
self.awe_sprinthud_hint.alpha = 1;
sprinthudvisible = true;
}
}
else if(sprinthudvisible && (self.awe_sprinting || !self.awe_pace || level.awe_sprint<=self.awe_stance) )
{
{
if(isdefined(self.awe_sprinthud_hint))
{
self.awe_sprinthud_hint fadeOverTime (1);
self.awe_sprinthud_hint.alpha = 0;
sprinthudvisible = false;
}
}
}
}

// Save old weapon data
if(level.awe_sprint)
{
// Save 1 second old data
if(oldprimary != self.awe_sprintweapon)
{
self.awe_oldprimary2 = oldprimary;
self.awe_oldammo2 = oldammo;
self.awe_oldclip2 = oldclip;
}
if(oldprimaryb != self.awe_sprintweapon)
{
self.awe_oldprimaryb = oldprimaryb;
self.awe_oldammob = oldammob;
self.awe_oldclipb = oldclipb;
}

// Save new data
oldprimary = self getWeaponSlotWeapon("primary");
oldammo = self getWeaponSlotAmmo("primary");
oldclip = self getWeaponSlotClipAmmo("primary");
oldprimaryb = self getWeaponSlotWeapon("primaryb");
oldammob = self getWeaponSlotAmmo("primaryb");
oldclipb = self getWeaponSlotClipAmmo("primaryb");
}

// Be un-nice to Unknown Players?
if(level.awe_unknownmethod && self awe\_util::isUnknown())
{
self iprintlnbold("^" + randomInt(8) + "Change your name!");
switch(level.awe_unknownmethod)
{
case 1:
self dropItem(self getcurrentweapon());
break;
case 2:
self shellshock("default", 1);;
break;
default:
break;
}
}

// Override client cvars
if(ch_count>=15)
{
// Allow crosshairs?
switch(level.awe_allowcrosshair)
{
case 2: // Force crosshair on
self setClientCvar("cg_drawcrosshair", "1");
wait 0.05;
delayed += 0.05;
break;

case 1: // Let player choose
break;

default: // Force crosshair off
self setClientCvar("cg_drawcrosshair", "0");
wait 0.05;
delayed += 0.05;
break;
}
// Allow crosshairs names?
switch(level.awe_allowcrosshairnames)
{
case 2: // Force crosshair names on
self setClientCvar("cg_drawcrosshairnames", "1");
wait 0.05;
delayed += 0.05;
break;

case 1: // Let player choose
break;

default: // Force crosshair names off
self setClientCvar("cg_drawcrosshairnames", "0");
wait 0.05;
delayed += 0.05;
break;
}
// Allow crosshairs to switch color when aiming enemies?
switch(level.awe_allowcrosshaircolor)
{
case 2: // Force crosshair color on
self setClientCvar("cg_crosshairenemycolor", "1");
wait 0.05;
delayed += 0.05;
break;

case 1: // Let player choose
break;

default: // Force crosshair color off
self setClientCvar("cg_crosshairenemycolor", "0");
wait 0.05;
delayed += 0.05;
break;
}
if(level.awe_stopclientexploits)
{
self setClientCvar("r_lighttweakambient","0"); // "glowing" models
wait 0.05;
delayed += 0.05;
self setClientCvar("r_lodscale","1"); // See through bushes/trees
wait 0.05;
delayed += 0.05;
self setClientCvar("mss_Q3fs","1"); // Ambient sounds
wait 0.05;
delayed += 0.05;
self setClientCvar("r_polygonOffsetBias","-1"); // Not sure what this does
wait 0.05;
delayed += 0.05;
self setClientCvar("r_polygonOffsetScale","-1");// Same here, not a clue...
}
if(level.awe_quickfadecompassdots)
{
self setClientCvar("cg_hudCompassSoundPingFadeTime","0");
wait 0.05;
delayed += 0.05;
}
ch_count=randomInt(15); // Use a random interval between cvar forcing to create some chaos (1-15 seconds)
}
ch_count++;

// Do some unlimted voodoo magic to the ammo counters

primary = self getWeaponSlotWeapon ("primary");
unlimitedammo = level.awe_unlimitedammo["all"];
if (isdefined (level.awe_unlimitedammo[primary]))
unlimitedammo = level.awe_unlimitedammo[primary];

if (unlimitedammo)
{
self setWeaponSlotAmmo ("primary", 999);
if (unlimitedammo == 2)
self setWeaponSlotClipAmmo ("primary", 999);
}

primaryb = self getWeaponSlotWeapon ("primaryb");
unlimitedammo = level.awe_unlimitedammo["all"];
if (isdefined (level.awe_unlimitedammo[primaryb]))
unlimitedammo = level.awe_unlimitedammo[primaryb];

if (unlimitedammo)
{
self setWeaponSlotAmmo ("primaryb", 999);
if (unlimitedammo == 2)
self setWeaponSlotClipAmmo ("primaryb", 999);
}

if ((level.awe_unlimitedgrenades) || (isdefined (self.awe_funmod_active_pu) && (self.awe_funmod_active_pu == "unlimitednades")))
{
sWeapon = awe\_util::GetGrenadeType(game[myteam]);
ammo = self getammocount(sWeapon);
if(!ammo) self giveWeapon(sWeapon);
self setWeaponClipAmmo(sWeapon, 999);
}
if ((level.awe_unlimitedsmokegrenades) || (isdefined (self.awe_funmod_active_pu) && (self.awe_funmod_active_pu == "unlimitednades")))
{
sWeapon = awe\_util::GetSmokeGrenadeType(game[myteam]);
ammo = self getammocount(sWeapon);
if(!ammo) self giveWeapon(sWeapon);
self setWeaponClipAmmo(sWeapon, 999);
}

// Calculate current speed
wait 1 - delayed; // Wait 1 seconds minus whatever we were delayed while setting cvars
newpos = self.origin;
speed = distance(oldpos,newpos);
oldpos = newpos;

if (speed > 20)
self.awe_pace = 1;
else
self.awe_pace = 0;
}
}

// Thread run on each player, every frame
EveryFrameThread()
{
if(level.awe_teamplay)
team = self.sessionteam;
else
team = self.pers["team"];

if(team == "axis")
otherteam = "allies";
else
otherteam = "axis";

self endon("awe_killthreads");

// mindist = 9999;
// maxdist = 0;
count = 0;
stop_db = (level.awe_anti_dbbh == 1) || (level.awe_anti_dbbh == 3);
stop_bh = (level.awe_anti_dbbh == 2) || (level.awe_anti_dbbh == 3);
count2 = 0;
lastprone = 2;
lastjump = 3;
for(;;)
{
count++;
// Get the stance every half second
if(count>10)
{
self.awe_stance = self awe\_util::GetStance(false);
count = 0;
}

count2 ++;
if (count2 > 3)
{
stance = self awe\_util::GetStance (false);
jump = self awe\_util::GetStance (true);

// Test if dive bombing or bunny hopping
if ((stop_db && ((stance == 2) && (lastprone != 2))) || (stop_bh && ((jump == 3) && (lastjump != 3))))
self thread WeaponPause (0.4 + randomfloat (0.3));

lastprone = stance;
lastjump = jump;
count2 = 0;
}

myammo = self getammocount(awe\_util::GetGrenadeType(game[team]));
otherammo = self getammocount(awe\_util::GetGrenadeType(game[otherteam]));
ammo = myammo + otherammo;
if( level.awe_tripwire && ammo>1 && self.awe_stance==2 && !isDefined(self.awe_turretmessage) && !isDefined(self.awe_tripwiremessage))
self thread awe\_tripwire::checkTripwirePlacement(team, otherteam, myammo, otherammo);

/* if(self meleeButtonPressed())
{
while(self meleeButtonPressed())
wait .05;
level thread awe\_util::DropPiano(self);
}*/
// z = self.origin[2];
wait .05;
/* dist = self.awe_spinemarker.origin[2] - z;
if(dist<mindist) mindist = dist;
if(dist>maxdist) maxdist = dist;
if(self meleebuttonpressed())
{
self iprintlnbold("Min:" + mindist + " Max:" + maxdist);
mindist = 9999;
maxdist = 0;
}*/
}
}

WeaponPause (time)
{
self endon ("awe_killthreads");

self disableWeapon ();
wait time;
if (isPlayer (self) && (! isdefined (self.awe_plantbar)) && (! isdefined (self.progressbar)) && ((level.awe_gametype != "lib") || (! self.in_jail)))
self enableWeapon ();
}

///////////////
// Functions //
///////////////

Cleanup()
{
CleanupKilled();
CleanupSpawned();

awe\_teamkilling::Cleanup();
awe\_welcomemessages::Cleanup();
}

CleanupKilled(sMeansOfDeath)
{
// Create/Reset variables
if(!isdefined(self.pers["awe_unknown_name"])) self.pers["awe_unknown_name"] = "Unknown Soldier";
self.awe_stance = 0;

// Remove spine marker if present
if(isdefined(self.awe_spinemarker))
{
self.awe_spinemarker unlink();
self.awe_spinemarker delete();
}

awe\_healthbar::CleanupKilled();
awe\_laserdot::CleanupKilled();
awe\_popping::CleanupKilled();
awe\_spawnprotection::CleanupKilled();
awe\_sprinting::CleanupKilled();
awe\_tripwire::CleanupKilled();
awe\_turrets::CleanupKilled(sMeansOfDeath);
awe\_funmod::CleanupKilled ();
}

CleanupSpawned()
{
awe\_bloodyscreen::CleanupSpawned();
}

RunOnSpawn()
{
self CleanupSpawned();

// Kill any running threads
self notify("awe_killthreads");

self.spawntime = getTime ();

// Force primary and secondary weapons
self awe\_weapons::forcePrimarySecondary ();

// Limit ammo
self awe\_weaponlimiting::ammoLimiting();

// Wait for threads to die
wait .05;

// Attach spinemarker, used by GetStance()
self.awe_spinemarker = spawn("script_origin",(0,0,0));
self.awe_spinemarker linkto (self, "J_Spine4",(0,0,0),(0,0,0));
// self.awe_spinemarker linkto (self, "J_Neck",(0,0,0),(0,0,0));

// Handle the Unknown Soldiers
if(self awe\_util::isUnknown())
{
// Rename Unknown Soldiers
// Get names
names = [];
count = 0;
name = awe\_util::cvardef("awe_unknown_name" + count, "", "", "", "string");
while(name != "")
{
names[names.size] = name;
count++;
name = awe\_util::cvardef("awe_unknown_name" + count, "", "", "", "string");
}
if(names.size)
{
self.pers["awe_unknown_name"] = names[randomInt(names.size)] + " " + randomInt(1000);
self setClientCvar("name", self.pers["awe_unknown_name"]);
if(level.awe_unknownrenamemsg != "none")
self iprintlnbold(level.awe_unknownrenamemsg);
}

// Make sure an unknown player can't do much damage
if(level.awe_unknownreflect)
self.pers["awe_teamkiller"] = true;
}

// Start new threads
self thread EverySecondThread();
self thread EveryFrameThread();

self awe\_coldbreath::RunOnSpawn();
self awe\_healthbar::RunOnSpawn();
self awe\_laserdot::RunOnSpawn();
self awe\_servermessages::RunOnSpawn();
self awe\_spawnprotection::RunOnSpawn();
self awe\_sprinting::RunOnSpawn();
self awe\_weapons::RunOnSpawn ();
self awe\_welcomemessages::RunOnSpawn();
self awe\_warmup::RunOnSpawn ();
self awe\_clan::RunOnSpawn ();
self awe\_anticamp::RunOnSpawn ();
self awe\_funmod::RunOnSpawn ();
}

painsound()
{
if(level.awe_teamplay)
team = self.sessionteam;
else
team = self.pers["team"];

nationality = game[team];
num = randomInt(level.awe_voices[nationality]) + 1;

scream = "generic_pain_" + nationality + "_" + num; // i.e. "generic_pain_german_2"
self playSound(scream);
}

awardExtraPoints (sHitLoc, sMeansOfDeath, sWeapon)
{
extrapoints = 0;

if (level.awe_pointsbashkill && (sMeansOfDeath == "MOD_MELEE"))
extrapoints += level.awe_pointsbashkill;

weapontypes_array = strtok (level.awe_weapontypes, " ");
for (i = 0 ; i < weapontypes_array.size ; i ++)
{
weapontype = weapontypes_array[i];
if (awe\_util::isWeaponType (weapontype, sWeapon))
{
extrapoints += level.awe_pointsweapontype[weapontype];
break;
}
}

if (sHitLoc == "head")
{
if (level.awe_pointsheadshotx == -1)
extrapoints += level.awe_pointsheadshot;
else
extrapoints = extrapoints * level.awe_pointsheadshotx;
}

if (level.awe_roundbased)
{
self.pers["score"] += extrapoints;
self.score = self.pers["score"];
}
else
self.score += extrapoints;
}

playerSpawn (origin, angles)
{
self endon ("awe_killthreads");
self endon ("disconnect");

if ((! level.awe_parachutes) ||
((level.awe_parachutes == 1) && isdefined (self.awe_hasparachuted)) ||
((level.awe_gametype == "lib") && isdefined (self.awe_hasparachuted)) ||
(level.awe_attackdefend && level.awe_parachutesonlyattackers && (self.pers["team"] != game["attackers"])))
self spawn (origin, angles);
else
self awe\_parachute::parachuteSpawn (origin, angles);
}

G-Stuff002
22nd February 2018, 18:38
In _teams.gsc:

// Workaround for the 127 bones error with mobile turrets
if (awe\_util::cvardef ("scr_allow_30cal", 1, 0, 1, "int") || awe\_util::cvardef ("scr_allow_mg42", 1, 0, 1, "int") || level.awe_turretfixunfix)
{

G-Stuff002
22nd February 2018, 18:41
_turrets.cfg: 1416

G-Stuff002
22nd February 2018, 18:44
in _util.cfg:

}

isWeaponType(type,weapon)
{
weapon = tolower (weapon);

temp = false;
switch(type)
{
case "turret":
case "mg" :
switch(weapon)
{
case "mg42_bipod_duck_mp":
case "mg42_bipod_prone_mp":
case "mg42_bipod_stand_mp":
case "30cal_prone_mp":
case "30cal_stand_mp":
case "30cal_mp" :
case "mg42_mp" :
temp = true;
break;
default:
temp = false;
break;
}
break;

G-Stuff002
22nd February 2018, 20:14
Maybe needed this files from AdmiralMOD because I did not find them in awe_cod2_v3.4.2_ They both have similar functions

1417



And that's all probably, now it need to somehow add this function. I will think....

G-Stuff002
22nd February 2018, 21:52
nothing succeeded, tried to add scripts to the server part like mg24scripts.cfg, but they did not even start with game, it is necessary to analyze where everything should be coded...

this is probably the most difficult for edit

Tally
23rd February 2018, 11:22
Hi, I want to combine a function pick up and move ("installation" put on the ground MG42) with allcustom weapons v1a mod.

I think this function is much more interesting rather than just carrying a gun like everyone else. With this the COD2 have more tactics play, i think.

I upload screens and mod to better understand. After i will be watch and disassemble/find scripts. If you can help, I'll be glad

1404 1405 1406 1407 1408 1409 1410 1411
1412 1413

So, let me get this clear: you want to have an MG42 selectable from the weapons menu, and you want to be able to deploy it, so that it is like a static MG42? If I've got that right, let me make some points:

1. There are no animations for deploying an MG42, that is, a player going down to grab the handles of the MG42. So, it wont be smooth. One minute you will be standing there, the next you will be prone holding the MG42.

2. The code is complected because you have to take account of all the possible places it can be deployed. I've known this code to crash servers (with the "unhandled exception" error) when a player tries to deploy it or get players stuck in terrain where they can't get out. So, if you want it, you will have to do it "at your own risk"!

3. What about the allies? There is a 50cal machine gun going around the community. Why don't you add that to your mod as well? You can't really give one team a deployable machine gun and not the other. It wouldn't be fair.

4. I'm busy for the rest of today and weekends are always busy, but if you still want it, I'll see what Monday is like for business and get started on it.

G-Stuff002
23rd February 2018, 12:54
Yes, have an MG42 selectable from the weapons menu in zzz_allcustom_v1a mod. Replace and make the function "deploy" like a static MG42.

Here have explanation about MG42: http://www.modbase.be/download-406-info.html
example: "The M1919A6 .30cal and MG42 turrets (machine guns) must be planted before being fired. Planting is done by aiming down the sight (a la COD/UO)."

1. Yes all is exactly. No animation, MG42 is just visible like lying weapons in the left side - Screen: 1419
after selection of MG42 from weapons menu

Animation have only when shooting (after placing on the ground)

2. ..'code is complected' I know not all the places (grounds,surface) are available
..'I've known this code to crash servers' - It's not scary. I use only Local LAN Homenetwork for 4 players (Friends)
..'at your own risk' - ok, i understand!


3. zzz_allcustom_v1a mod Give to choose any weapons for any Teams. You are right! It will be available to all Teams.

EDIT____ !

About 50cal. zzz_allcustom_v1a have 2 heavy machine gun, one of two i wont to be change like deployed, it's will be different for gameplay and more interesting. In this mod, each team can choose any weapon for any nation this equates forces for all

This is the whole point of balancing the chances. zzz_allcustom_v1a - it for this.


Ok, I'll wait for help, Thank you! And I'll try to do it myself, I will sort this out and combine options

G-Stuff002
23rd February 2018, 22:30
Ok, what i know and found right now, maybe it will be useful not to forget:

-----------------------
for a note.
All Custom Weapons
consists of two files:
-zzz_allcustom_v1a.iwd
-zzz_optionaltotal.iwd
----------------------

"mg42" hosted in the - zzz_optionaltotal.iwd/weapons/mp/weapon1_mp

mg42 is renamed as weapon1_mp !! 1430 1431

This model (weapon1_mp) needs to be replaced (delete and past) by this: 1432 1433

This model does not shoot and just shown as the selected from the weapons menu. For this weapon need to embed code 'deploy' from 'awe 3.4.2'
Code need embed in zzz_allcustom_v1a.iwd or zzz_optionaltotal.iwd i dont know yet

G-Stuff002
23rd February 2018, 22:53
And there are is the most difficult part where to write the code, which I found (wrote on the first page) I'll try to find some weapon mod for one weapon and will see how it works, for a hint.. it may be necessary:1434

G-Stuff002
24th February 2018, 22:16
I had an idea that it was easier...(because it will need to edit fewer files) to add mg42 like deploy, it will be of secondary weapon in pistols menu. I thought about how this would be reflected in the battle and I think that was good as tactics, 'fast' and hidden battle.

I make additional points in weapons menu but I have a problem. Look at screen: 1435

I add flamethrower_mp, at the same time, that there was a slot ready for it (CHOICE6)
And rename mg42_mp to mg42dpl_mp (CHOICE7), because scripts on mg42 has already for another weapon. And this mg42dpl_mp it will be like deploy

1436

1437

G-Stuff002
25th February 2018, 15:56
I lost countenance..I'm investigating codes for deploy in _turrets.GSC. There are two names of MG42, the first is external

mg42_mp (my renamed like mg42dpl_mp) but he has an internal name as 'awe_mg42' - maybe that is awe.cfg, for run codes

Everything is very difficult...

Tally
26th February 2018, 19:27
Ok, what i know and found right now, maybe it will be useful not to forget:

-----------------------
for a note.
All Custom Weapons
consists of two files:
-zzz_allcustom_v1a.iwd
-zzz_optionaltotal.iwd
----------------------

"mg42" hosted in the - zzz_optionaltotal.iwd/weapons/mp/weapon1_mp

mg42 is renamed as weapon1_mp !! 1430 1431

This model (weapon1_mp) needs to be replaced (delete and past) by this: 1432 1433

This model does not shoot and just shown as the selected from the weapons menu. For this weapon need to embed code 'deploy' from 'awe 3.4.2'
Code need embed in zzz_allcustom_v1a.iwd or zzz_optionaltotal.iwd i dont know yet

I finally had some time to work on this. The first thing I did was download this allcustom_v1 mod. In my version (which I got from here: DOWNLOAD (https://gamefront.online/files/15954417/allcustomweaps.zip)), the MG42 was working fine. I did not have to fix it.

Do you want me to make this deployable MG42 and 30.cal using this allcustom_v1 mod? It is a dreadful mess. I had to fix 7 errors just to get it to run. In particular, the menu options are too close together. It is hard to actually pick the one you want. Do you want me to fix this and make the menus better? There are a number of missing weapon images. I could fix them as well if you want.

Of, if you don't care about this allcustom_v1 mod, I can make you a much better one, where the allies get the 30.cal and the germans get the MG42 from the menus. Then I could concentrate on the deployment mod.

BTW - which key do you want to press? The USE button? Or, the melee button? Or do you want to use another key? I can use any key you want, but it does require a file added to the mod in order for the game to detect that you are actually pressing it.

EDIT - LOL this allcustom_v1 mod is using a lot of my stuff. The pistols menu and images are mine, taken from the eXtreme+ mod. I was a member of the development team and made them back in 2006. I had forgotten how bad those pistol images were. I was a bit of a noob back then!

G-Stuff002
26th February 2018, 20:15
Only one deployable MG42 needed, this is enough since because all the weapons are available for any team in this mod.

'make the menus better' - can be left as is, or i dont know, maybe some fixes at your discretion, everything suits it, is important that all weapons remain in their places. And I had an very good idea, it is better to add deployable MG42 in pistols menu like CHOICE6 and after i wont add flamethrower CHOICE7 i upload the files later

'Of, if you don't care about this allcustom_v1 mod' - then i lose portable version of MG42 and the 30.cal from menu. If for you it is more convenient and easier, let it be so. EDIT.: Then this is the last сhoose/decision

'BTW - which key do you want to press? ' - Use key better like in original mod


It is possible at once to add additional items in the pistol menu ? i will uplaod the files. For flamethrower, supajoe's Nade Launcher (v2),
Knife that can be thrown from ASIOAS mod (1.5). There will be both strong support. I wanted to replace them with pistols but it's best to make additional items

G-Stuff002
26th February 2018, 20:43
allcustom_v1 - this is the best mod i think, because it has a lot, most of all weapons. It principal mod on which I based around him all the rest 'stand-alone' mods. To finish it well, to be the good basis.

If it need to know what I'm doing (This is all for the original COD2, just as add-ons not like a eXtreme+ or others Global mods they changes a lot and I just supplement the original)

'...pistols menu and images are mine' - I did not see better. Even now it looks great!

G-Stuff002
26th February 2018, 22:32
Pistols menu additional

1. supajoe's Nade Launcher (v2) 1439

2. flamethrower from this mod: https://www.nexusmods.com/callofduty2/mods/682
Patch for him: https://www.nexusmods.com/callofduty2/mods/683?tab=files

EDIT
3. Knife that can be thrown from this ASIOAS mod. Good enough idea, just checked, better than Torre's (German) Spade
This is a small addition but I think it will be a success. Players like to sometimes play only one weapon by agreement, and if take the knife it will be a fun battle

If everything turned out, it would be perfect mod

Tally
27th February 2018, 14:50
Pistols menu additional

1. supajoe's Nade Launcher (v2) 1439

2. flamethrower from this mod: https://www.nexusmods.com/callofduty2/mods/682
Patch for him: https://www.nexusmods.com/callofduty2/mods/683?tab=files

EDIT
3. Knife that can be thrown from this ASIOAS mod. Good enough idea, just checked, better than Torre's (German) Spade
This is a small addition but I think it will be a success. Players like to sometimes play only one weapon by agreement, and if take the knife it will be a fun battle

If everything turned out, it would be perfect mod

I'm nearly done with the deployable mg42 and 30cal. It's nearly finished. So, I'm not going to do more additions right. I simply don't have the time. Maybe in a week or so, when I get some spare time, I can rethink it. But for now, I have to say "no".

FYI - you have to pay to use that Nexus mod site. You can't download anything unless you subscribe. But, you can find all COD2 mods for free here:

https://gamefront.online/files/listing/pub2/Call_of_Duty_2/Mods/

G-Stuff002
27th February 2018, 15:33
Thanks Tally, I'll try to do additions it myself, but what's my error? I make additional points in weapons menu but I have wrong distance
1440

1441
1442


I both reviewed all the content of the sites Nexus and gamefront and did not find the necessary stand-alone versions, many are repeated and the most interesting are not present

Tally
27th February 2018, 15:52
Thanks Tally, I'll try to do additions it myself, but what's my error? I make additional points in weapons menu but I have wrong distance
1440

1441
1442


I both reviewed all the content of the sites Nexus and gamefront and did not find the necessary stand-alone versions, many are repeated and the most interesting are not present

You have this for the flamethrower:


itemDef
{
name "button_flamethrower"
visible 1
rect 0 0 128 24
origin ORIGIN_CHOICE5
forecolor GLOBAL_UNFOCUSED_COLOR
type ITEM_TYPE_BUTTON
text "@6. flamethrower"
textfont UI_FONT_NORMAL
textscale GLOBAL_TEXT_SIZE
textstyle ITEM_TEXTSTYLE_SHADOWED
textaligny 20
dvartest "ui_allow_pistols"
showDvar { "1" }
action
{
play "mouse_click";
scriptMenuResponse "flamethrower_mp";
}
onFocus
{
play "mouse_over";
hide webley_info;
hide tt30_info;
hide colt_info;
hide luger_info;
hide p38_info;
hide mg42dpl_info;
show flamethrower_info;

}
}


In that one, your ORIGIN_CHOICE number is 5. That position is already occupied by the P38. So, you should renumber it to 6:


itemDef
{
name "button_flamethrower"
visible 1
rect 0 0 128 24
origin ORIGIN_CHOICE6
forecolor GLOBAL_UNFOCUSED_COLOR
type ITEM_TYPE_BUTTON
text "@6. flamethrower"
textfont UI_FONT_NORMAL
textscale GLOBAL_TEXT_SIZE
textstyle ITEM_TEXTSTYLE_SHADOWED
textaligny 20
dvartest "ui_allow_pistols"
showDvar { "1" }
action
{
play "mouse_click";
scriptMenuResponse "flamethrower_mp";
}
onFocus
{
play "mouse_over";
hide webley_info;
hide tt30_info;
hide colt_info;
hide luger_info;
hide p38_info;
hide mg42dpl_info;
show flamethrower_info;

}
}


If you ever get 2 weapons in the same place, always check your ORIGIN_CHOICE numbers.

G-Stuff002
27th February 2018, 16:02
Clear!, I did not see, missed that it also needs to be renamed.

You are the best programmer, just looked at the code and found an error, it's amazing! thank you! interesting to know you are still developing something, you do everything very qualitatively

Tally
27th February 2018, 18:06
Okay, here it is. Please get the download from here: DOWNLOAD (http://www.filehosting.org/file/details/727170/sF8ZpatgD6Ef4VAc/deployable_turrets.rar)

Some notes:

1. I did not mess too much with the menus. In my opinion, they are a mess, but it would take a long time to sort them out, and I just don't have the time.

2. You can deploy any fixed turret on a map that has them (some gametypes don't have them - like CTF for example). Also, of course, if you pick either the MG42 or the 30CAL from the menu, you can deploy them as per the AWE mod. There is a "user hint" at the top of the screen which tells you what to do.

3. I renamed weapon1_mp to mg42_carry_mp; and weapon2_mp to 30cal_carry_mp. I tried to name them to mg42_mp and 30cal_mp, but that crashed the server for some reason. I'm not quite sure why. So, I renamed them to "_carry_mp" instead.

4. Other than in maps\mp\gametypes\_turrets.gsc all the script functions are in _weapons.gsc. There are a lot of them. You have to watch weapon changes, and watch for binocular usage as well.

5. I put all the init() functions in _callbacksetup.gsc to kick it all off instead of using the gametype files.

6. I removed the deletePlacedEntitys function as the AWE code has it as well. So, you can delete placed fixed turrets on maps with a dvar. Please see the config file for all the dvar settings.

G-Stuff002
27th February 2018, 18:29
Tally, you got it! excellent work! but important function you did not, this is very sadly..

1443
1444
1445

G-Stuff002
27th February 2018, 18:54
EDIT


WOW! This is even better than in the original!!, you combined portable and deployable version ) Cool! just need to add fix unfix function, this gives more opportunities in using this weapon

Thank you very much Tally, this is a dream! Now have a basis to work on (continue work)


"1. I did not mess too much with the menus." - It not necessary i think, menu is simple and convenient, for each nation is shown his native weapon, and extra weapons are shown nearby. It is not convenient to choose weapon if the menu is complex, it's need to spend more time while the fight is going on without you, in my opinion. This menu is remembered more in memory, the whole picture, everything is in sight. At least I do not know your ideas..


Thanks that wrote in what files codes are written, it is useful

Tally
27th February 2018, 19:04
Tally, you got it! excellent work! but important function you did not, this is very sadly..

1443
1444
1445

The AWE code was broken. You aren't supposed to stand there with a turret gun in your hands, and have a turret on the floor. That isn't deploying your weapon, that's spawning another new weapon on the floor.

With my code, you don't need the "fix" function, because with my version, when you deploy it, you are holding the turret gun. There is no more need to press melee. This is the way it is supposed to be. The AWE code was broken. So, I fixed it.

G-Stuff002
27th February 2018, 19:18
I understood that. Yes indeed, so it will even be better, there will be no errors on the server

G-Stuff002
27th February 2018, 19:29
The rest of the addition will do myself and then I'll show you (Upload for you), I hope everything will turn out

Tally
27th February 2018, 19:31
I found a problem - the MG42 is missing xmodels. You get the default horse xmodel. No idea how this happened. One minute it was fine; the next, it was broken.

I'm just fixing it now, and I'll upload a new download once I've done.

G-Stuff002
27th February 2018, 19:37
Tally if you are some time, could you look Please at this mod 1446 + CFG (+exec for the server) I edited it 1447
Here is sorted and works but loads a lot of unnecessary

This is full mod from which I make stand-alone: 1448

I deleted some files but can not delete the rest, everything stops working. Two days worked and sorted but nothing happened

Need to remove all unnecessary codes, except Map Ambience Effects, Weather Ambience System, War Ambience System , Mortar Effects, Airplane Effects - this is writes in CFG

This is a very important mod, with it the maps and battle feel differently. I try to make the environment more alive, filled active environment. It does not exist as stand-alone anywhere

G-Stuff002
27th February 2018, 22:10
Everything works well for me, tested about 20 minutes at first time re-creat server, changing teams,deploy for all team, it's all fine. Can after some time something is lost.. by xmodels, but not now.

Ok i'll be wait fixed version

Could not tear himself off, very well done, this is even better than in the original version, you combined portable and deployable version, I did not even think about it..

G-Stuff002
4th March 2018, 08:10
Somebody Help me Please, this is over my mind..

I try to understand how its work, tried all the options, analyzed, looked at errors in the console.

IzNoGoD
4th March 2018, 12:54
You're coding way above what you're able to handle. Start simple.

You don't need "help with modding", you need to employ a full time modder.

G-Stuff002
4th March 2018, 13:53
That's are is simple start. Just need to remove all unnecessary codes, except Ambience effects weather and war..

For example i delete all unnecessary lilke "#include "ui_mp/menudef.h" etc. from files but some codes are still needed.. The startup structure definitely need codes is not clear

English and programming language, slang, reduction of, get confused me


ok, i will try and try again...