View Single Post
raydan
Senior Member
Join Date: Aug 2006
Old 03-21-2018 , 02:29   Re: [EXTENSION] NPCs in CS:S (extended)
Reply With Quote #4

https://github.com/raydan/npc-in-css
source code stop update at 2014, compile/reference with hl2sdk2013

i will try answer questions about the code, let see who can make it work

files in "_game_server_files"
Code:
*"monster.cstrike.games.txt" outdated
*unzip "monster.zip" to "custom" folder
*put "monster_download.txt" to "addons\sourcemod\configs" folder, use for "monster_core.sp"
*put "skill.cfg" to "cfg" folder
*upzip "stripper.zip" to "addons\stripper", use for  Stripper:Source extension
*"monster.sp" use for coop server, outdated need update
player regen health, show aiming npc name & health
show player death message by using a bot
start map vote at end game, "monster_map_end" command call from "CE_CGameEnd::AcceptInput"
"mp_playercollide" console var for player noclip each other
the following are unsolve/bug/missing/notes
Code:
*npc_combine_cannon
missing npc_combine_cannon

*CGrenadeHelicopter create bug
grenade_helicopter or grenade can't spawn, not sure

*momentary_rot_button, see CE_CMomentaryRotButton
rotate over 360 degree, it look like reset 0.
i created a map to test momentary_rot_button open a door, it work in hl2dm, but no in cs:s
i found the problem from "oc_manor" map, decompile it and get momentary_rot_button to make a test map

*door can't open
there was a map(can't remember the map name, player are inside a house),
there is door can't open(press E), but i remember it working and i finished that map before.
and i was try decompile it and copy the door to make a test map, it work in hl2dm, but no in cs:s
may be added some new code make trace ray or something broken

*patch.cpp CleanUpMap
it try fix round restart make some entity(info_target) position/angle go wrong
in cs:s it auto call "round draw/TerminateRound" when first player join game, then some entity position/angle go wrong
problem happen in hl2dm too, but hl2dm no round restart. you can call it manually
example:
the last boss in coop_zelda01_b
any func_tank, example map tbr_coop_thousand_antlions_v3b

*patch.cpp CAI_NetworkBuilder_Build
see hl2sdk CAI_NetworkBuilder::Build. "ai_network_build_helper" not exists, that is only way to do it

*patch.cpp LoadNetworkGraph
see hl2sdk CAI_NetworkManager::LoadNetworkGraph. it try to bypass "AINET_VERSION_NUMBER" checking
it try to patch "DevMsg( "Checking version\n" );" 7 bytes
make it load *.ain directly from "maps\graphs", some .bsp packed .ain inside

*weapon_replace.cpp
there are weapon_rpg(weapon_flashbang), weapon_physcannon(weapon_c4)

*prop_vehicle_jeep
not sure it working

*new macros DECLARE_HOOK_SUBCLASS
see hl2sdk CAI_NPC::OnCalcBaseMove, Inherited from IAI_MotorMovementServices
not sure that is the correct way to do that
coop server.cfg setting, tickrate 33, 16 players
Code:
mp_playercollide 0
sv_pure 0
sv_lan 0
sv_airaccelerate 10
sv_gravity 800
mp_humanteam CT
mp_ignore_round_win_conditions 1
sv_hudhint_sound 0
sv_enablebunnyhopping 1
mp_buytime 0.5
mp_startmoney 1
mp_c4timer 45
mp_flashlight 1
mp_footsteps 1
mp_falldamage 1
mp_hostagepenalty 0
mp_timelimit 0
mp_winlimit 0
mp_maxrounds 0
mp_roundtime 1
mp_freezetime 0
mp_autoteambalance 0
mp_limitteams 0
mp_friendlyfire 0
mp_tkpunish 0
mp_autokick 0
mp_spawnprotectiontime 10
sv_timeout 60
mp_forcecamera 0
mp_allowspectators 1
sv_parallel_sendsnapshot 0
sv_parallel_packentities 0
sv_maxrate 1000000
sv_minrate 1000000
sv_maxupdaterate 33
sv_minupdaterate 33
fps_max 0
rate 1000000
sv_mincmdrate 33
sv_maxcmdrate 33
sv_cheats 0
sv_pausable 0
mp_chattime 8
mp_restartgame 0
phys_pushscale 1
sv_disablefreezecam 1
sv_nonemesis 1
sv_nomvp 1
sv_allow_wait_command 0
list of npc:
Code:
npc_headcrab
npc_headcrab_fast
npc_headcrab_black
npc_fastzombie
npc_fastzombie_torso
npc_zombie_torso
npc_zombie
npc_poisonzombie
npc_manhack
npc_antlionguard
npc_stalker
npc_antlion
npc_vortigaunt
npc_rollermine
env_headcrabcanister
npc_turret_floor
npc_combine_s
npc_helicopter
npc_enemyfinder
npc_enemyfinder_combinecannon
npc_cscanner
npc_clawscanner
npc_barnacle
npc_combinegunship
npc_strider
npc_combine_camera
bounce_bomb
npc_zombine
npc_turret_ceiling
npc_turret_ground
npc_crow
npc_seagull
npc_pigeon
npc_breen
npc_barney
npc_alyx
npc_eli
npc_gman
npc_kleiner
npc_dog
npc_monk
npc_mossman
npc_sniper
npc_metropolice
npc_citizen
npc_bullsquid
npc_houndeye
npc_hunter
npc_advisor
list of maps tested long ago
Code:
above_the_fallen_day2b
cl_coop_laserquest_b3
cl_coop_level1_escape
cl_coop_level2_survive_v6
cl_coop_level3_topside_b2
coop_canals_v4_r1
coop_citadel_escape_p6
coop_level01_dooms_entry_v1b
coop_level02_traps_v1c
coop_level07_scary_house_fix2
coop_meows_fun_day_out_z1
coop_meows_island_defence
coop_meows_sewer_mania_v4
coop_meows_symphony_eight_v_4
coop_meows_tower_of_babel_v_4
coop_missile_silo214
coop_mw_revenge_ttc_v1
coop_npcwar3_aldo
coop_resident_evil_sg_zb4
coop_resistance_part1_v1c
coop_wardogs_v5
coop_zelda01_b
jr_coop_undergroundescape_v1
js_coop_2fort_teleport_p1
js_coop_combine2_sg_b4
js_coop_combine2_ttc_p5
js_coop_dasole2_ttc_b1
js_coop_dasole2_v4
js_coop_haunted_house_v20
js_coop_missiontwo_v1f
js_coop_part2_powerworks_v1a
js_coop_part2_waterworks_v3
js_coop_part3_waterworks_v2
js_coop_powerworks_v2
js_coop_save_dog_tbr_v5
js_coop_save_scientist_v2
js_coop_shore_v6
js_coop_siege_v4
js_coop_stargate_p9
js_coop_swampthing_x_v3
js_coop_tbr_[a1]_ttc_v5a
js_coop_teleport_sg_zb3
js_coop_teleport_v9
js_coop_thunder_b4
js_coop_waterworks_ttc_v3
js_c_citadel_blast_hdr_fix11
js_lm_coop_underground_v4b
level04_across_the_darkness3a
level05_diehard_fix2
level06_the_base
level08_a_place_to_die_a4
level10_end_of_evil_a2
mph_fire_pit_final_v5
mph_rebel_incursionv2
nobeloffice
oc_big_gappoi_v6m
oc_danmaku_i
oc_inlight
oc_manor
oc_newgappi_g
oc_sogeki_v2b
Poison_Coop_RE1_Beta1
sg_coop_resistance_b2
sg_coop_runoff_zb
sg_coop_steamlab_b5
sp_sawlife2
synb2_diehard
synb2_school_for_freshman
synb2_underground
syn_across_the_darkness_b3
syn_breenoffice_v1c
syn_broken_escape_part1
syn_d_crimson_v1c
syn_lvcoop_part1
syn_lvcoop_part2
syn_starship_oblivion
tbr_coop_thousand_antlions_v3b
reference:
Code:
view page source code: http://www.facepunch.com/threads/807565-Applying-Patch-files
https://bugs.alliedmods.net/show_bug.cgi?id=4946
Obsidian Conflict
Synergy
found some test map and tested them in hl2dm & gmod today, in attachments
Code:
*test.bsp
*test3.bsp
momentary_rot_button
"key" entity from coop_zelda01_b, inside "stripper.zip" it try to fix
cs:s m_vDuckHullMax higher then hl2dm
*test_bug1.bsp
hl2dm crash
gmod work
should fixed in the extension
*test_bug2.bsp
CTriggerHurt::HurtAllTouchers
should fixed in the extension
*test_crash2.bsp
ShouldRemoveThisRagdoll
hl2dm crash
gmod work
should fixed in the extension
Attached Files
File Type: zip maps.zip (70.8 KB, 307 views)

Last edited by raydan; 03-21-2018 at 10:35.
raydan is offline