[Zombie Core] Replaced all scripts with scripts decompiled by...

Xensik's gsc-tool.
This commit is contained in:
JezuzLizard
2022-02-25 22:03:12 -08:00
parent 5467e47fa8
commit 0d2c068adb
157 changed files with 87715 additions and 94302 deletions

View File

@ -1,216 +1,201 @@
// T6 GSC SOURCE
// Decompiled by https://github.com/xensik/gsc-tool
setmodelfromarray( a )
{
self setmodel( a[ randomint( a.size ) ] );
self setmodel( a[randomint( a.size )] );
}
precachemodelarray( a )
{
i = 0;
while ( i < a.size )
{
precachemodel( a[ i ] );
i++;
}
for ( i = 0; i < a.size; i++ )
precachemodel( a[i] );
}
randomelement( a )
{
return a[ randomint( a.size ) ];
return a[randomint( a.size )];
}
attachfromarray( a )
{
self attach( randomelement( a ), "", 1 );
self attach( randomelement( a ), "", 1 );
}
new()
{
self detachall();
oldgunhand = self.anim_gunhand;
if ( !isDefined( oldgunhand ) )
{
return;
}
self.anim_gunhand = "none";
self [[ anim.putguninhand ]]( oldgunhand );
self detachall();
oldgunhand = self.anim_gunhand;
if ( !isdefined( oldgunhand ) )
return;
self.anim_gunhand = "none";
self [[ anim.putguninhand ]]( oldgunhand );
}
save()
{
info[ "gunHand" ] = self.anim_gunhand;
info[ "gunInHand" ] = self.anim_guninhand;
info[ "model" ] = self.model;
info[ "hatModel" ] = self.hatmodel;
info[ "gearModel" ] = self.gearmodel;
if ( isDefined( self.name ) )
{
info[ "name" ] = self.name;
info["gunHand"] = self.anim_gunhand;
info["gunInHand"] = self.anim_guninhand;
info["model"] = self.model;
info["hatModel"] = self.hatmodel;
info["gearModel"] = self.gearmodel;
if ( isdefined( self.name ) )
{
info["name"] = self.name;
/#
println( "Save: Guy has name ", self.name );
println( "Save: Guy has name ", self.name );
#/
}
else
{
}
else
{
/#
println( "save: Guy had no name!" );
println( "save: Guy had no name!" );
#/
}
attachsize = self getattachsize();
i = 0;
while ( i < attachsize )
{
info[ "attach" ][ i ][ "model" ] = self getattachmodelname( i );
info[ "attach" ][ i ][ "tag" ] = self getattachtagname( i );
i++;
}
return info;
}
attachsize = self getattachsize();
for ( i = 0; i < attachsize; i++ )
{
info["attach"][i]["model"] = self getattachmodelname( i );
info["attach"][i]["tag"] = self getattachtagname( i );
}
return info;
}
load( info )
{
self detachall();
self.anim_gunhand = info[ "gunHand" ];
self.anim_guninhand = info[ "gunInHand" ];
self setmodel( info[ "model" ] );
self.hatmodel = info[ "hatModel" ];
self.gearmodel = info[ "gearModel" ];
if ( isDefined( info[ "name" ] ) )
{
self.name = info[ "name" ];
self detachall();
self.anim_gunhand = info["gunHand"];
self.anim_guninhand = info["gunInHand"];
self setmodel( info["model"] );
self.hatmodel = info["hatModel"];
self.gearmodel = info["gearModel"];
if ( isdefined( info["name"] ) )
{
self.name = info["name"];
/#
println( "Load: Guy has name ", self.name );
println( "Load: Guy has name ", self.name );
#/
}
else
{
}
else
{
/#
println( "Load: Guy had no name!" );
println( "Load: Guy had no name!" );
#/
}
attachinfo = info[ "attach" ];
attachsize = attachinfo.size;
i = 0;
while ( i < attachsize )
{
self attach( attachinfo[ i ][ "model" ], attachinfo[ i ][ "tag" ] );
i++;
}
}
attachinfo = info["attach"];
attachsize = attachinfo.size;
for ( i = 0; i < attachsize; i++ )
self attach( attachinfo[i]["model"], attachinfo[i]["tag"] );
}
precache( info )
{
if ( isDefined( info[ "name" ] ) )
{
if ( isdefined( info["name"] ) )
{
/#
println( "Precache: Guy has name ", info[ "name" ] );
println( "Precache: Guy has name ", info["name"] );
#/
}
else
{
}
else
{
/#
println( "Precache: Guy had no name!" );
println( "Precache: Guy had no name!" );
#/
}
precachemodel( info[ "model" ] );
attachinfo = info[ "attach" ];
attachsize = attachinfo.size;
i = 0;
while ( i < attachsize )
{
precachemodel( attachinfo[ i ][ "model" ] );
i++;
}
}
precachemodel( info["model"] );
attachinfo = info["attach"];
attachsize = attachinfo.size;
for ( i = 0; i < attachsize; i++ )
precachemodel( attachinfo[i]["model"] );
}
get_random_character( amount )
{
self_info = strtok( self.classname, "_" );
if ( self_info.size <= 2 )
{
return randomint( amount );
}
group = "auto";
index = undefined;
prefix = self_info[ 2 ];
if ( isDefined( self.script_char_index ) )
{
index = self.script_char_index;
}
if ( isDefined( self.script_char_group ) )
{
type = "grouped";
group = "group_" + self.script_char_group;
}
if ( !isDefined( level.character_index_cache ) )
{
level.character_index_cache = [];
}
if ( !isDefined( level.character_index_cache[ prefix ] ) )
{
level.character_index_cache[ prefix ] = [];
}
if ( !isDefined( level.character_index_cache[ prefix ][ group ] ) )
{
initialize_character_group( prefix, group, amount );
}
if ( !isDefined( index ) )
{
index = get_least_used_index( prefix, group );
if ( !isDefined( index ) )
{
index = randomint( 5000 );
}
}
while ( index >= amount )
{
index -= amount;
}
level.character_index_cache[ prefix ][ group ][ index ]++;
return index;
self_info = strtok( self.classname, "_" );
if ( self_info.size <= 2 )
return randomint( amount );
group = "auto";
index = undefined;
prefix = self_info[2];
if ( isdefined( self.script_char_index ) )
index = self.script_char_index;
if ( isdefined( self.script_char_group ) )
{
type = "grouped";
group = "group_" + self.script_char_group;
}
if ( !isdefined( level.character_index_cache ) )
level.character_index_cache = [];
if ( !isdefined( level.character_index_cache[prefix] ) )
level.character_index_cache[prefix] = [];
if ( !isdefined( level.character_index_cache[prefix][group] ) )
initialize_character_group( prefix, group, amount );
if ( !isdefined( index ) )
{
index = get_least_used_index( prefix, group );
if ( !isdefined( index ) )
index = randomint( 5000 );
}
while ( index >= amount )
index -= amount;
level.character_index_cache[prefix][group][index]++;
return index;
}
get_least_used_index( prefix, group )
{
lowest_indices = [];
lowest_use = level.character_index_cache[ prefix ][ group ][ 0 ];
lowest_indices[ 0 ] = 0;
i = 1;
while ( i < level.character_index_cache[ prefix ][ group ].size )
{
if ( level.character_index_cache[ prefix ][ group ][ i ] > lowest_use )
{
i++;
continue;
}
else
{
if ( level.character_index_cache[ prefix ][ group ][ i ] < lowest_use )
{
lowest_indices = [];
lowest_use = level.character_index_cache[ prefix ][ group ][ i ];
}
lowest_indices[ lowest_indices.size ] = i;
}
i++;
}
lowest_indices = [];
lowest_use = level.character_index_cache[prefix][group][0];
lowest_indices[0] = 0;
for ( i = 1; i < level.character_index_cache[prefix][group].size; i++ )
{
if ( level.character_index_cache[prefix][group][i] > lowest_use )
continue;
if ( level.character_index_cache[prefix][group][i] < lowest_use )
{
lowest_indices = [];
lowest_use = level.character_index_cache[prefix][group][i];
}
lowest_indices[lowest_indices.size] = i;
}
/#
assert( lowest_indices.size, "Tried to spawn a character but the lowest indices didn't exist" );
assert( lowest_indices.size, "Tried to spawn a character but the lowest indices didn't exist" );
#/
return random( lowest_indices );
return random( lowest_indices );
}
initialize_character_group( prefix, group, amount )
{
i = 0;
while ( i < amount )
{
level.character_index_cache[ prefix ][ group ][ i ] = 0;
i++;
}
for ( i = 0; i < amount; i++ )
level.character_index_cache[prefix][group][i] = 0;
}
random( array )
{
return array[ randomint( array.size ) ];
return array[randomint( array.size )];
}

View File

@ -1,23 +1,26 @@
// T6 GSC SOURCE
// Decompiled by https://github.com/xensik/gsc-tool
main()
{
/#
assert( isDefined( self ) );
assert( isdefined( self ) );
#/
wait 0;
if ( isDefined( self ) )
{
wait 0;
if ( isdefined( self ) )
{
/#
if ( isDefined( self.classname ) )
{
if ( self.classname != "trigger_once" || self.classname == "trigger_radius" && self.classname == "trigger_multiple" )
{
println( "" );
println( "*** trigger debug: delete.gsc is deleting trigger with ent#: " + self getentitynumber() + " at origin: " + self.origin );
println( "" );
if ( isdefined( self.classname ) )
{
if ( self.classname == "trigger_once" || self.classname == "trigger_radius" || self.classname == "trigger_multiple" )
{
println( "" );
println( "*** trigger debug: delete.gsc is deleting trigger with ent#: " + self getentitynumber() + " at origin: " + self.origin );
println( "" );
}
}
#/
}
}
self delete();
}
self delete();
}
}

View File

@ -1,41 +1,29 @@
// T6 GSC SOURCE
// Decompiled by https://github.com/xensik/gsc-tool
initstructs()
{
level.struct = [];
level.struct = [];
}
createstruct()
{
struct = spawnstruct();
level.struct[ level.struct.size ] = struct;
return struct;
struct = spawnstruct();
level.struct[level.struct.size] = struct;
return struct;
}
findstruct( position )
{
_a20 = level.struct_class_names;
key = getFirstArrayKey( _a20 );
while ( isDefined( key ) )
{
_ = _a20[ key ];
_a22 = level.struct_class_names[ key ];
val = getFirstArrayKey( _a22 );
while ( isDefined( val ) )
{
s_array = _a22[ val ];
_a24 = s_array;
_k24 = getFirstArrayKey( _a24 );
while ( isDefined( _k24 ) )
{
struct = _a24[ _k24 ];
if ( distancesquared( struct.origin, position ) < 1 )
{
return struct;
}
_k24 = getNextArrayKey( _a24, _k24 );
}
val = getNextArrayKey( _a22, val );
}
key = getNextArrayKey( _a20, key );
}
foreach ( key, _ in level.struct_class_names )
{
foreach ( val, s_array in level.struct_class_names[key] )
{
foreach ( struct in s_array )
{
if ( distancesquared( struct.origin, position ) < 1 )
return struct;
}
}
}
}