Sven Co-op 5.0 gamedata thread
For SC 5.0 to be supported properly in AMXX, I think it would be a good idea to create a thread (just like this one) where we gather all game data, and once enough is gathered, update AMXX with all our findings. This includes private data offsets, network messages information, hamdata, useful signatures for Okapi/Orpheu, etc...
I had some fun today in IDA and successfully pulled out a lot of useful information regarding CItemInventory. My main goal for this update is to find ways to control the new item inventory system through AMXX plugins. What I have currently are some private data offsets of CItemInventory (item_inventory) and I've analyzed two messages that come with it, InvAdd and InvRemove. Updated, uses real names now - everything that's exposed to AngelScript. Every offset is byte-aligned, so divide then by 4 for use in some natives, like get_pdata_int().
Spoiler
What these do can be found in: https://sites.google.com/site/svenma...item_inventory InvAdd arguments go as: Code:
Long (item_inventory index) Code:
Long (item_inventory index) Code:
InventoryList Your turn now! |
Re: Sven Co-op 5.0 gamedata thread
Support for SvenCoop should be completely dropped. It seems they're going out of their way to make amx incompatible with their game.
|
Re: Sven Co-op 5.0 gamedata thread
Quote:
Though just them giving us gamedata would mean they greatly support AMXX. |
Re: Sven Co-op 5.0 gamedata thread
Don't bother, Arks offered his help on this matter, they didn't even bother to answer him, why should we bother ?
|
Re: Sven Co-op 5.0 gamedata thread
Quote:
|
Re: Sven Co-op 5.0 gamedata thread
Quote:
Scroll down to the properties; m_pHolder is the first item_inventory property. Assuming they kept the AS API up to date with changes to the entity, this should be everything you need. See http://samvanheer.github.io/SC_Angel...BaseEntity.htm for CBaseEntity properties so you can filter out the stuff that isn't part of item_inventory. Also related to inventory: http://samvanheer.github.io/SC_Angel...ntoryRules.htm http://samvanheer.github.io/SC_Angel...entoryList.htm http://samvanheer.github.io/SC_Angel...entoryMisc.htm See https://github.com/SamVanheer/SC_Ang...mmits/gh-pages for the changes made to the API since the last version i uploaded. Apparently all they did is remove features, no surprise there. There is a way to get the Angelscript engine pointer; with some tricks you can extract all of the data from it and get the offsets for every member variable, the address of every method, function and global. You can also use it to add new API functionality, though you'll need to use some serious C++ magic to get strings to work since they get their memory from the server library's heap. Quote:
Releasing early and often would definitely help to catch compatibility issues, having at least one person doing AMX compat testing on their internal branch would help catch these problems. Quote:
Quote:
Quote:
I'm not going to say they don't care, i think it's more likely that they think they know what's best. Whether that's actually true or not remains to be seen. I wouldn't hold my breath if i were you. |
Re: Sven Co-op 5.0 gamedata thread
Quote:
Thanks anyway. Quote:
What I didn't know is that I could dump all that info from the engine itself. I guess I'll take a look at the AS API documentation. |
Re: Sven Co-op 5.0 gamedata thread
Well, you can't use its API to get that information. That's why i said you'll need to use some tricks; you'll have to get the library version used by SC (printed in the console on startup) and cast to the implementations of every interface to get to its data. It's not impossible, but unless you match up the right versions it will crash.
Getting the engine is a bit of work too, you'll need to create an entity that has a pointer to a function. trigger_script has one, and i've got the source code for that entity if you need it. You'll be able to use that to find the offset (CTriggerScript is 228 bytes on Linux, the function is the last member, so + 224 from 'this'). Then you just cast edict_t::pvPrivateData to a byte pointer, offset to that function pointer, and dereference it to get the script function contained in it. (it's actually a pointer to a wrapper, the wrapper's layout is vtable then asIScriptFunction*) Then you grab the engine pointer using asIScriptFunction::GetEngine. Do be aware that if they find out you're hacking into their code like this, they will likely take some form of action. Whether it involves shifting the trigger_script members around or changing how it stores the function entirely, i wouldn't put it past them to shoot themselves in the foot just to stop this. If they won't share the information willingly, they won't allow you to get it through other means either. That said, if they go through with Sniper's idea to reload Angelscript if a host error occurs, then you can just replace the Angelscript library that they'll be adding to do this. Implement asIScriptEngine and pass all methods through to the real engine. Then you're basically given the address/offset and name of every API member on a silver platter. This also has the advantage of working for the client side when client side scripting is added, since they'll probably make that use the same code. |
Re: Sven Co-op 5.0 gamedata thread
Just found out that I can grab all data from IDA, by looking at CASDocumentation::RegisterObjectProperty() calls, where I can grab everything that's exposed to AS. Main post updated. :mrgreen:
P.S. Should I feel dirty? |
Re: Sven Co-op 5.0 gamedata thread
That works too i guess :P Completely missed that as an option.
|
All times are GMT -4. The time now is 06:32. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.