Fake a cheat console

+
Fake a cheat console

During modding some kind of cheat console appears to be somewhat useful.

And there is:
Code:
00412F37  |>  33C0          XOR EAX,EAX
00412F39  |>  56            PUSH ESI                                 ; /Arg3
00412F3A  |.  68 88ADF100   PUSH OFFSET 00F1AD88                     ; |Arg2 = UNICODE "CHEAT_Console"
00412F3F  |.  A3 ECD26701   MOV DWORD PTR DS:[167D2EC],EAX           ; |
00412F44  |.  E8 B8F8FEFF   CALL 00402801                            ; |
00412F49  |.  50            PUSH EAX                                 ; |Arg1
00412F4A  |.  E8 5B0C7000   CALL 00B13BAA                            ; \witcher2.00B13BAA

To be found in the game exe and the editor.exe, too.
But how to launch it?
(On another little project "How to compile scripts without the scriptStudio" I managed to start the "Reload scripts" routine from outside the editor but then it crashed. So I stopped my investigations.)

But, there's a fairly simple workaround for the cheat thingie:

just place your cheat code here in witchergame.ws
Code:
	// Game started (world is already loaded)
	event OnGameStarted()
	{	
		theHud.OnGameStarted();
		
		//bToggle = false ;
		thePlayer.SetImmortalityModePersistent( AIM_Invulnerable );		
		thePlayer.GetInventory().AddItem('Forgotten Sword of Vrans');
		...
	}
and everything will work fine.

View attachment 170
 

Attachments

  • cheatViaScript.jpg
    cheatViaScript.jpg
    31.1 KB · Views: 209
Last edited:

Milgo

Forum regular
Hm, now you create a item with an startup event - where is the connection to a faked console?
 
Don't understand the question.
If you don't need it don't use it.

This thread was merely meant for people who like to share ideas for maybe someday having a working debug console for the Witcher 2.
 
Last edited:
I am not sure if I follow you. While in Redkit editor there is a proper debug console just by pressing "`" key (the one above Tab). What you want is create a mod to enable it in the regular game?
 
While in Redkit editor there is a proper debug console just by pressing "`" key (the one above Tab).
Well, I didn't know this. Thx, man!:)
But how to use it correctly? FreeCamera is working.
Teleport seems to require a parameter. Which?
Is there a help command or something similar?
Is this command list complete? -> Console, DebugPages, InstantKill, MovementOnPhysics, TimeScaling, FreeCamera, Teleport

What you want is create a mod to enable it in the regular game?
Since console seems to be present in the game code, too, I will try to enable the hotkey. (Maybe adding the console key to the input_xxxxx.ini will do the job?)

Above all I wanted to have an expandable console (like lua_console for Mafia 2) in the editor.
So far I got a teleport via hotkey more or less working. I also can spawn NPCs. This was my main intention.

It's working in an editor game session but not in the "standalone" game.
 
Last edited:
Is not working with the standalone because it doesnt use the scripts in \Witcher2EE\bin\scripts\, it uses the ones in Cooked PC possibly the one called compiledscripts.w2scripts.
One easy way to test it in stand alone is to make any level in editor, and use the usercontentcooker to make the files that can be used with the UserContentManager.
 
Top Bottom