(Need Help!) Putting HL2SP code to Alien Swarm

Grab your favourite IDE and tinker with the innards of game engines

(Need Help!) Putting HL2SP code to Alien Swarm

Postby Ken Chan on Mon Apr 09, 2012 7:32 pm

So I tried to put the code into AS, and it compiled the mod can run...to the main menu.
When I run a map, the game exit with a message:
Image
Code: Select all
OnGameRulesCreationStringChanged: missing gamerules class 'CHalfLife2' on the client

I know it's a gamerules problem, but I checked the code and I didn't find any problem with the client-side gamerules.
Maybe the gamerules need a update? Because I just copy & paste the codes and fix changes(max->MAX)?

I can upload the whole code if someone wants, and cake for the ones that can fix the problem!
Last edited by Ken Chan on Mon Apr 09, 2012 8:36 pm, edited 2 times in total.
User avatar
Ken Chan
Regular
Regular
 
Joined: Mon Apr 09, 2012 7:16 pm
Location: Hong Kong

Re: (Need Help!) Putting HL2SP code to Alien Swarm

Postby Gary on Mon Apr 09, 2012 7:48 pm

Are you aware of the "Scratch" mod?
https://github.com/Sandern/aswscratch
Provides a basic sdk template for Alien Swarm including the following features:
- All specific Alien Swarm code is stripped from the project
- SDK Player with DOD model (from the 2007 sdk template)
- Player Animation State based off the Alien Swarm animation state
- Most of the Game UI is left intact, although the campaign and match
making options won't work.

Video:
http://www.youtube.com/watch?v=Lq3b-bSdd1k
Have a question related to modding or something I posted? Something that needs staff attention? I haven't been active lately, but feel free to PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Re: (Need Help!) Putting HL2SP code to Alien Swarm

Postby Ken Chan on Mon Apr 09, 2012 8:05 pm

I know, but I don't want SDK template, I want HL2 one.
And I find some interesting stuff:
CHalfLife2 and CAlienSwarm both use CSingleplayRules, that means the game supports Single player.
User avatar
Ken Chan
Regular
Regular
 
Joined: Mon Apr 09, 2012 7:16 pm
Location: Hong Kong

Re: (Need Help!) Putting HL2SP code to Alien Swarm

Postby Ken Chan on Tue Apr 10, 2012 7:27 pm

Anyone?

And here's my updated gamerules:
http://pastebin.com/jdfZZ4c1
User avatar
Ken Chan
Regular
Regular
 
Joined: Mon Apr 09, 2012 7:16 pm
Location: Hong Kong

Re: (Need Help!) Putting HL2SP code to Alien Swarm

Postby Ken Chan on Wed Apr 11, 2012 8:01 pm

FIXED!

Add this line at hl2_gamerules works:
Code: Select all
virtual void LevelInitPostEntity() {}


My good video coming soon!
User avatar
Ken Chan
Regular
Regular
 
Joined: Mon Apr 09, 2012 7:16 pm
Location: Hong Kong

Re: (Need Help!) Putting HL2SP code to Alien Swarm

Postby Ken Chan on Wed Apr 11, 2012 10:19 pm


New problem.
Only this camera is affected, the player is normal.
How to fix?
User avatar
Ken Chan
Regular
Regular
 
Joined: Mon Apr 09, 2012 7:16 pm
Location: Hong Kong

Re: (Need Help!) Putting HL2SP code to Alien Swarm

Postby Ken Chan on Thu Apr 12, 2012 11:29 am

ANOTHER STUPID ERROR(for me)
Code: Select all
KeyValues Error: LoadFromBuffer: missing { in file cfg\cpu_level_2_pc.ekv

KeyValues Error: LoadFromBuffer: missing { in file cfg\cpu_level_2_pc.ekv
(*����l*),
KeyValues Error: LoadFromBuffer: missing { in file cfg\cpu_level_2_pc.ekv
(*����l*),
KeyValues Error: LoadFromBuffer: missing { in file cfg\cpu_level_2_pc.ekv
(*����l*),
KeyValues Error: LoadFromBuffer: missing { in file cfg\gpu_level_3_pc.ekv

KeyValues Error: LoadFromBuffer: missing { in file cfg\gpu_level_3_pc.ekv
(*w�O�?1���μHv��Ƈ�,8B[�   �*Ip~C�eCxfh�lH�����*),
KeyValues Error: LoadFromBuffer: missing { in file cfg\gpu_level_3_pc.ekv
(*w�O�?1���μHv��Ƈ�,8B[�   �*Ip~C�eCxfh�lH�����*),
KeyValues Error: RecursiveLoadFromBuffer:  got NULL key in file cfg\mem_level_2_pc.ekv
�RF_Z>!�h���:��\��H�莘����qe,
 Bad convar found in mem_level - ��yͭ
 Bad convar found in mem_level -
}

KeyValues Error: LoadFromBuffer: missing { in file cfg\gpu_mem_level_2_pc.ekv

What are these???
The files are exist and I didn't do anything about them..
They come after the gamerules are fixed...
User avatar
Ken Chan
Regular
Regular
 
Joined: Mon Apr 09, 2012 7:16 pm
Location: Hong Kong

Re: (Need Help!) Putting HL2SP code to Alien Swarm

Postby Sandern on Thu Apr 12, 2012 12:24 pm

Check ConfigureCurrentSystemLevel in cdll_client_int.cpp:

Code: Select all
#if defined( SWARM_DLL )
   char szModName[32] = "swarm";
#elif defined ( HL2_EPISODIC )
   char szModName[32] = "ep2";
#elif defined ( SDK_CLIENT_DLL )
   char szModName[32] = "sdk";
#endif

   UpdateSystemLevel( nCPULevel, nGPULevel, nMemLevel, nGPUMemLevel, VGui_IsSplitScreen(), szModName );


You likely removed SWARM_DLL and added HL2_EPISODIC to your project settings. If you change szModName to "swarm" again the errors should be gone. I guess the ekv (encrypted key values?) files are encrypted using the mod name and the files included are generated for alien swarm.
Sandern
Regular
Regular
 
Joined: Thu Jun 30, 2005 1:08 pm
Location: Netherlands

Re: (Need Help!) Putting HL2SP code to Alien Swarm

Postby Ken Chan on Thu Apr 12, 2012 1:57 pm

I see. But this workaround breaks particles...
And, I guess my camera problem is generated from the clientmode, or my mod missing *mod*_in_camera.cpp ?
Type status at console tell me that I keep at 0 x, 0 y, 64 z, but my 'ghost' can move around?
User avatar
Ken Chan
Regular
Regular
 
Joined: Mon Apr 09, 2012 7:16 pm
Location: Hong Kong

Re: (Need Help!) Putting HL2SP code to Alien Swarm

Postby Ken Chan on Thu Apr 12, 2012 4:41 pm

Can someone add me at steam?
I really need some help now, We can team up and finish this. :D

My steam profile:
http://steamcommunity.com/id/lolken
:arrow:
User avatar
Ken Chan
Regular
Regular
 
Joined: Mon Apr 09, 2012 7:16 pm
Location: Hong Kong

Re: (Need Help!) Putting HL2SP code to Alien Swarm

Postby ScarT on Wed May 09, 2012 3:35 pm

Bump. Did you fix this? I'm struggling with the same bug (view at 0, 0, 0 but player in world).
User avatar
ScarT
Senior Member
Senior Member
 
Joined: Sat Apr 02, 2005 7:33 pm
Location: Denmarkian Land

Re: (Need Help!) Putting HL2SP code to Alien Swarm

Postby Psy_Commando on Thu May 10, 2012 7:04 pm

Well it looks like something I had before. The view at 0,0,0 is probably caused by the new cells system for transmitting origin to the client. Its described there : https://developer.valvesoftware.com/wik ... 8%29#Cells

What you need to do is basically add this line to your client side hl2 player
Code: Select all
virtual bool ShouldRegenerateOriginFromCellBits() const{return true;}
Psy_Commando
Dumpling
Dumpling
 
Joined: Sat Aug 06, 2011 4:48 am
Location: Quebec, Canada

Re: (Need Help!) Putting HL2SP code to Alien Swarm

Postby ScarT on Mon May 14, 2012 6:45 am

Well, that fixed the view problem. The player spawns at 0, 0,0 (not only the view) and I can only move a few feet only to be pulled back to 0, 0, 0.

Ideas?
User avatar
ScarT
Senior Member
Senior Member
 
Joined: Sat Apr 02, 2005 7:33 pm
Location: Denmarkian Land

Re: (Need Help!) Putting HL2SP code to Alien Swarm

Postby Psy_Commando on Tue May 15, 2012 9:55 pm

ScarT wrote:Well, that fixed the view problem. The player spawns at 0, 0,0 (not only the view) and I can only move a few feet only to be pulled back to 0, 0, 0.

Ideas?


Well, that's what I had before I added that line to my code.. Have you set it to false ? :?
Psy_Commando
Dumpling
Dumpling
 
Joined: Sat Aug 06, 2011 4:48 am
Location: Quebec, Canada

Re: (Need Help!) Putting HL2SP code to Alien Swarm

Postby ScarT on Tue May 15, 2012 9:57 pm

No, I set it to true. No dice.
User avatar
ScarT
Senior Member
Senior Member
 
Joined: Sat Apr 02, 2005 7:33 pm
Location: Denmarkian Land
Next

Return to Programming

Who is online

Users browsing this forum: No registered users