:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::
Do you want to advertise at Project Perfect Mod. Find out how to do it HERE.

The time now is Fri Apr 03, 2020 12:49 am
All times are UTC + 0
 Forum index » Modding Central » Tiberian Sun Editing Forum
Needing help with a hack please.
Moderators: Global Moderators, Tiberian Sun Moderators
Post new topic   Reply to topic Page 1 of 1 [13 Posts] View previous topic :: View next topic
Author Message
Slavack
Soldier


Joined: 07 Jan 2008

PostPosted: Wed Dec 11, 2019 6:55 pm    Post subject:  Needing help with a hack please.
Subject description: freeunit_enhancements.asm
Reply with quote

I was humbly wondering if anyone had some insight on the (freeunit_enhancements.asm) from github. Is it by chance available in the form of exe hack?  Any help would be appreciated.

Back to top
View user's profile Send private message
E1 Elite
Commander


Joined: 28 May 2013

PostPosted: Thu Dec 12, 2019 2:07 am    Post subject: Reply with quote

Exe hacks that you expect are just replacement of few bytes but those compilable hacks which don't fit in a few bytes, jump to a new location and perform its actions and come back to the main processing and that particular hack does a lot of it. Several of those hacks are also dependent on other patches.

It is not hard to build those hacks yourselves, just follow the instructions in the readme.

Back to top
View user's profile Send private message
Slavack
Soldier


Joined: 07 Jan 2008

PostPosted: Thu Dec 12, 2019 3:03 pm    Post subject: Reply with quote

I see...So it makes sense that the more complex hacks migrated away from that original thread. I appreciate the info and the readme file I believe you speak of is this one?

https://github.com/CnCNet/ts-patches/blob/master/README.md

Back to top
View user's profile Send private message
E1 Elite
Commander


Joined: 28 May 2013

PostPosted: Thu Dec 12, 2019 3:41 pm    Post subject: Reply with quote

Yes, install winbuild wherever you want. Then download ts-patches and set the correct path of the winbuild bin path in say build_TSClient.cmd and then run that .cmd file. It will generate the compiled exe which is made for TSClient. Inside ts-patches/src/mods/tsclient/tsclient.mk file, can modify the list of hacks that you want. Can look at TI or DTA files for examples.

Back to top
View user's profile Send private message
Slavack
Soldier


Joined: 07 Jan 2008

PostPosted: Thu Dec 12, 2019 4:31 pm    Post subject: Reply with quote

Thank you for the help. I've been looking in on all the amazing work everyone has been contributing. For me, I have very limited knowledge of this and I've been wanting to start looking into it but it kinda overwhelming. I appreciate you getting me started

Back to top
View user's profile Send private message
Slavack
Soldier


Joined: 07 Jan 2008

PostPosted: Fri Dec 13, 2019 5:02 am    Post subject: Reply with quote

E1 Elite wrote:
Yes, install winbuild wherever you want. Then download ts-patches and set the correct path of the winbuild bin path in say build_TSClient.cmd and then run that .cmd file. It will generate the compiled exe which is made for TSClient. Inside ts-patches/src/mods/tsclient/tsclient.mk file, can modify the list of hacks that you want. Can look at TI or DTA files for examples.


So just so I'm clear, the hacks that I want to add (freeunit_enhancements.asm)... i need to add to the end list within the tsclient.mk file, run the build_TSClient.cmd and it complies into a useable exe?

Back to top
View user's profile Send private message
E1 Elite
Commander


Joined: 28 May 2013

PostPosted: Fri Dec 13, 2019 5:50 am    Post subject: Reply with quote

That hack is already included in tsclient.mk file in the latest commit at github, just build it, copy the new tsclientgame.exe to TSClient installation, rename it to Game.exe (overwrite after backup) and use.

Back to top
View user's profile Send private message
Bittah Commander
Defense Minister


Joined: 21 May 2003
Location: The Netherlands

PostPosted: Fri Dec 13, 2019 2:31 pm    Post subject: Reply with quote

Dkeeton coded this a while back but it's still incomplete, so right now it only allows factories to provide the unit type they produce as a FreeUnit (so a barracks can provide infantry as a FreeUnit and a helipad can provide aircraft as a FreeUnit).
_________________

Back to top
View user's profile Send private message Send e-mail ModDB Profile ID YouTube User URL Facebook Profile URL
Slavack
Soldier


Joined: 07 Jan 2008

PostPosted: Sat Dec 14, 2019 3:19 am    Post subject: Reply with quote

Thank you both for guiding me in the right direction. I accidentally downloaded a non master version of the patches without the latest additions. I did manage to run a patch but upon testing i could only get infantry to spawn successfully from the barracks. when i tried to add a FreeUnit=ORCA to the Helipad nothing will spawn. i verified it still had the correct tags (Factory=AircraftType). Did i maybe miss something?

Back to top
View user's profile Send private message
E1 Elite
Commander


Joined: 28 May 2013

PostPosted: Sat Dec 14, 2019 6:22 am    Post subject: Reply with quote

You are on right track. Looks like you have to add HoverPad=yes to helipads to spawn the free unit on the pad itself. Probably the hack could have included this info in the comments.

Without this hack if you give Orca as free unit to any building, it would have produced it by the side of the building. Now with this hack it crashes the game if you give it to wrong factorytype like giving Orca to barracks.

Back to top
View user's profile Send private message
Slavack
Soldier


Joined: 07 Jan 2008

PostPosted: Sat Dec 14, 2019 6:00 pm    Post subject: Reply with quote

Nice! I did in fact overlook adding that tag. I was able to test out and apply a few other available patches successfully so thank you again for walking me through it all. Forgive my greediness for asking more questions out of my league, but while I was trying to learn all of this LKO referred me to as section of a thread where ollydbg debugger is used for patching. This method seems like it's a completely different approach.. if I was planning on implementing air to air combat example:

00409112                 call    dword ptr [edx+58h]

to

00409112                 jmp 0x00409127

Is this something that can be integrated for compiling using what ive learned or do i need to do it with the debug method mentioned?

Back to top
View user's profile Send private message
E1 Elite
Commander


Joined: 28 May 2013

PostPosted: Sun Dec 15, 2019 3:17 am    Post subject: Reply with quote

If you are altering the game during runtime with a debugger, the same can be done as a hack that can be applied to the exe. It is not a different approach, you are only finding what you want to change by using the debugger.

Back to top
View user's profile Send private message
Slavack
Soldier


Joined: 07 Jan 2008

PostPosted: Mon Dec 16, 2019 12:14 am    Post subject: Reply with quote

E1 Elite! I managed to learn how to patch using both methods in only a few days and just a few posts with your help. Might not sound like much, but for someone with zero programming knowledge it feels great to be able to keep my game updated like the rest of you geniuses here.  My sincere thanks again good sir!

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [13 Posts] View previous topic :: View next topic
 Forum index » Modding Central » Tiberian Sun Editing Forum
Jump to:  
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.1381s ][ Queries: 10 (0.0249s) ][ Debug on ]