advancedfx / advancedfx-prop

This sub-module of the advancedfx repository contains proprietary code that can not be moved or hasn't been moved yet under MIT license in the main repro.
https://github.com/advancedfx/advancedfx
57 stars 15 forks source link

Information about mirv_deathmsg fake (CS: GO) #27

Closed DManstrator closed 7 years ago

DManstrator commented 7 years ago

Hi.

I was playing around with mirv_deathmsg fake and wanted to figure out the location of the images getting loaded in the htmlString or at least the names of those images which can be used.

You put down one example into the console: mirv_deathmsg fake "<font color='#eabe54'>Cloud9 Stewie2K</font><font color='#eabe54'></font> <img src='icon-ak47.png' height='16'/><font color='#6f9ce6'>Na'Vi Zeus</font>" 0 0

I tried a few names from \Half-Life\cstrike\sprites\hud.txt but for example, icon-knife.png won't work.

Would be nice to get a response, thanks.

Yours sincerely, DMan

dtugend commented 7 years ago

Use JPEXS Free Flash Decompiler and open C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\resource\flash\huddeathnotification.swf and have a look at the images node (expand it), additionally open C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\resource\flash\iconlib.swf and have a look at the images node (expand it).

You can use all images in the images section of huddeathnotification and most in the iconlib images section (since most are exported in iconlib).

You will see there are several different knife icons available, for example the shaddow daggers are probably these:

mirv_deathmsg fake "<font color='#eabe54'>Cloud9 Stewie2K</font><font color='#eabe54'></font> <img src='icon-knife_push.png' height='16'/><font color='#6f9ce6'>Na`Vi Zeus</font>" 0 0
DManstrator commented 7 years ago

Hello,

thank you very much for the quick answer and the little tutorial!

Another question would be how to bind such a fake message to a key. Both, alias and bind await one string, so I tried escaping the quotes with a backslash like [code]bind key "mirv_deathmsg fake \"htmlString\" 0 0"[/code] but it didn't work. You're a bit deeper into developing for CS: GO, do you know a way to bind it?

Thank you again for your quick support!

Yours sincerely, DMan

dtugend commented 7 years ago

CS:GO Source engine console does not seem to have escape sequences for quotation marks (B).

What people usually do in this case it make a config file with the required contents (save text file as yourNameHere.cfg (not as .cfg.txt, so make sure display of file extensions in Windows Explorer is enabled or use some program like Notpad++) in a mounted cfg folder (A)) and then execute it in the bind using the exec console command: exec yourNameHere.cfg

(A) The game and HLAE mount the following cfg folders in the following priority (at least I think so):

  1. C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\cfg
  2. HLAE cfg sub-folder in the movie making parent config folder (CS:GO Launcher options, sets the USRLOCALCSGO environment variable), can have higher priority than (1) for the files config.cfg, video.txt, videodefaults.txt. Or if you didn't make HLAE set USRLOCALCSGO and it's not set elsewhere, it will be the C:\Program Files (x86)\Steam\userdata<accountNumberHere>\730\local\cfg folder
  3. HLAE mounts AfxHookSource\assets\csgo in the HLAE.exe folder, thus you can also use the cfg sub-folder in there.

I recommend 2., means to use the HLAE CS:GO launcher dialogue and enable Movie Making Parent Config Folder there and then use the cfg sub-folder in the folder you set there, because that way the config will only be available to the game when you use HLAE, also that way you won't mess up your gaming config, since the relevant mentioned config files (config.cfg, video.txt, videodefaults.txt) will be stored in that folder too then.

(B) It does have some sort of execution markers (that's what they call it themselves), but I am not sure what they do, might be possible to crash the program or even execute code with those, but I really don't know. The execution marker is

[$&*,`]

and if you enter it at once in console you will get WARNING: INVALID EXECUTION MARKER, if you enter everything but the last char manually, the console might close i.e..

PS: It's possible for me to add a mirv execute command, that has special escape sequences for quotation marks, but so far it was never required.

dtugend commented 7 years ago

I also want to inform you that there is a more convenient way to automatically execute / schedule the command in a demo on a specific time / tick:

  1. You can use demoui PlayCommands, this way you can schedule the mirv_deathmsg fake command as you would have typed in console, I recommend this way, also it can be saved with a demo, for more info see: https://developer.valvesoftware.com/wiki/Demo_Recording_Tools#Demo_editor
  2. There is the HLAE command mirv_cmd, which allows to schedule commands too, however it suffers from the quotation escaping problem, just like bind does.
DManstrator commented 7 years ago

Hello again,

thank you again for your helpful response, I chose the method with the PlayCommands of the DemoUI but I still have questions if this is okay.

You suggested to paste the command into a cfg and to execute it, but this also has the quotes escaping problem, doesn't it?

[fakedeathmsg.cfg]
bind x mirv_deathmsg fake "str" 0 0
// bind x "mirv_deathmsg fake \"str\" 0 0"

It's still the same code, just not directly entered into the console. I also tried escaping the quotes there, also with the execution marker you talked about but it returns a single orange quote (') every time.

I also didn't figured out how to set the USRLOCALCSGO variable with HLAE (I guess you meant -usrlocalcsgo /path/to/cfg or -mmcfg /path/to/cfg as an additional parameter to a custom Loader).

The only problem with the DemoUI method is that it only works once, after it was executed once you need to create a new event with the same values for a repeat which is kind of annoying. But finally it works automatically.

Thank you very much for your quick and helpful responses. :D

Yours sincerely, DMan

dtugend commented 7 years ago

1)

It was supposed to be like this for example (I made it a bit more complicated, so you see how to bind different things to the same button:

[fakeDeathMsg1.cfg]
mirv_deathmsg fake "str1" 0 0

[fakeDeathMsg2.cfg]
mirv_deathmsg fake "str2" 0 0

[fakeDeathMsg3.cfg]
mirv_deathmsg fake "str3" 0 0

[yourMovieMaking.cfg]
// add this in launch options, if you want it loaded automatically: +exec yourMovieMaking
alias fake1 "exec fakeDeathMsg1; alias fake fake2"
alias fake2 "exec fakeDeathMsg2; alias fake fake3"
alias fake3 "exec fakeDeathMsg2; alias fake fake1"
alias fake fake1
bind x fake

2)

USRLOCALCSGO is a Windows Environment Variable, which cannot be set in the CustomLoader. Please use HLAE -> Menu -> File -> Launch CS:GO, which is a dialogue that is similar, but for CS:GO only. Basically you check Movie making config parent folder checkbox and select a path with the browse button and HLAE will automatically take care of setting that USRLOCALCSGO environment variable accordingly for you. For more info see Loading Counter-Strike Global Offensive in the manual.

3.1) I don't remember 100% how PlayCommands work, you might need to save them and reload the demo for them to work again, but I don't know, maybe Google for how to use DemoUI PlayCommands.

3.2)

With mirv_cmd you could use the fakeDeathMsgX cfgs you have created and they work multiple times.

Pause the demo at the time you want to add the message and enter for example

mirv_cmd add exec fakeDeathMsg1

Then enable the command system (so it will replay the commands):

mirv_cmd enabled 1

There are also options for saving the commands or loading them from a file, for removing all or specific ones and for printing the current list. See Source:mirv_cmd - Built in command help / navigation for more information.

Hint: Since it's saved as an XML file with human readable encoding, you can easily edit the file with an texteditor.

Daryn0115 commented 7 years ago

Hi, I have a problem when I start the game, gives me the old version of the game, and I can not do what I want.

Daryn0115 commented 7 years ago

I need help, and as soon as possible, please

dtugend commented 7 years ago

Please do not hijack unrelated issues next time, open a new one here or in the forum instead please.

The answer was probably already given in this forum thread post:

Also please check that you are not launching an old install of CS:GO

The current (new) install of CS:GO should be located here: C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive

dtugend commented 7 years ago

Relevant information from this issue has been compiled into the Manual entry: Source:mirv_deathmsg fake, thus closing the issue.