Jump to content

Change sides during gameplay


Recommended Posts

I have been trying to hack Dune 2000 all day and I finally got something worth sharing. I found a memory location that allows you to in-game change sides. So if you play for example in mission 9 as Ordos you can switch to the Harkonen on the fly and control the units/buildings while the AI just keeps going on. This might be useful when having a computer AI that does not rebuild. The memory location contains the house index value, so for example 2 = Ordos. The memory location is 00798544. Just use Cheat Engine to change the value.

 

Here is some proof controlling the Mercenaries (house index 6):

 

post-2251-0-53664500-1390174488_thumb.jp

 

I have today also figured out a way to inject code in the DUNE2000.DAT file so that I can run any code I want without needing a trainer or cheat engine. I only tried a small injection, like changing a memory value after a certain event, and it's all by hand (calculating offset etc, so takes much time to code), but it's a step in the right direction.

 

edit: Download patcher that allows to change side by numkeys here: http://forum.dune2k.com/topic/26356-change-sides-during-gameplay/?p=385825

Edited by D2k Sardaukar
  • Upvote 6
Link to post
Share on other sites

I have done this already in my mod..

In a mission we can switch between fremen and atriedies..

I just added a code into the uil file and it worked..

My brofher was flabbergasted..

I showed him how I did it and he said I should make it in my mod demo..

So as per my brother's request I'll be doing it..

Have fun when I release it..

@d2ksardaukr

nice finding.. but it doesn't need binary editing..

Just a minor tweak in uil file and we can switxh teams in-game. .

You'll be surprised by the stuff the uil and uib files can do..

I found a lot of things..

I'll be releasing some tutorials on how to make menus and add functions etc. .

  • Upvote 1
Link to post
Share on other sites

you will need to free up some space in the binary to add extra code, so its prolly not so easy to explain :D

Tell me a hotkey you like to have and the possible values (is it 0,1,2 or 1,2,3 ?) im gonna try to add the code for you and afterwards you can check it out

Link to post
Share on other sites

you will need to free up some space in the binary to add extra code, so its prolly not so easy to explain :D

Tell me a hotkey you like to have and the possible values (is it 0,1,2 or 1,2,3 ?) im gonna try to add the code for you and afterwards you can check it out

cool..

you uswd which software? ?

Link to post
Share on other sites
Add this button code under IG*MIS.uil..

* is the name of the mis for example A1 means Atriedes mission 1..

IG*MIS.uil defines the ingame briefing...

Try it and see if it works..

If any problems please tell me..

I have played around with uil files and know most of it by now..

 

BUTTON <name> //(give a unique name to each button)

<screen x>, <screen y> //(this determines where the button should be)

30, 20

<Text in text.uib> // button text (Atriedes,Ordos,Harkonnen,or any name from text.uib)

LightPurple // highlight

VDarkPurple // lowlight

Red // button up colour

LightRed // button down colour

Black // font up colour

Grey // font down colour

NONE // upGfx

NONE // downGfx

SetValueS4To gSideId X //(X=0ATR,1=HARK,2=ORD,3=EMP,4=FRE,5=SMUG,6=MERC,7=SAND)(Give in place of X these numbers to get corresponding houses)

END_BUTTON

  • Upvote 2
Link to post
Share on other sites

 

Add this button code under IG*MIS.uil..
* is the name of the mis for example A1 means Atriedes mission 1..
IG*MIS.uil defines the ingame briefing...
Try it and see if it works..
If any problems please tell me..
I have played around with uil files and know most of it by now..
 
BUTTON <name> //(give a unique name to each button)
<screen x>, <screen y> //(this determines where the button should be)
30, 20
<Text in text.uib> // button text (Atriedes,Ordos,Harkonnen,or any name from text.uib)
LightPurple // highlight
VDarkPurple // lowlight
Red // button up colour
LightRed // button down colour
Black // font up colour
Grey // font down colour
NONE // upGfx
NONE // downGfx
SetValueS4To gSideId X //(X=0ATR,1=HARK,2=ORD,3=EMP,4=FRE,5=SMUG,6=MERC,7=SAND)(Give in place of X these numbers to get corresponding houses)
END_BUTTON

 

Nice work. This way you can easily make an extra menu where you can select which side to play.

 

I did a quick test with also a LAN game and it does not really work. I did have for a short time control of the other LAN player units, but soon got a out of sync error. Perhaps suppressing that error makes it possible to play with two players on one side/camp with multiplayer game, but not sure for how long that would go good. nvm, it goes directly out of sync

Link to post
Share on other sites

I set this within missions so we can control multiple bases..

I'm surprised you used it on lan..

you might have uses your opposing human's base right??

Hahaha..

Anyways I'll make videos on dune 2000 modding after few months..

So that it'll be easier for all especially new dune 2000 modders to understand..

Link to post
Share on other sites

Let's say I wanna control Harks in Ordos mission 9, will it completely change the sides ? (including alliances and map vision?) So if i get harks, will I actually see their units and will the Ordos & Mercs vision disappear for me? 

Link to post
Share on other sites

Let's say I wanna control Harks in Ordos mission 9, will it completely change the sides ? (including alliances and map vision?) So if i get harks, will I actually see their units and will the Ordos & Mercs vision disappear for me?

the uil code above will switch teams that is once you are harkonnen you loose sight of everything when you were ordos.. but you gain sight of harkonnen and its allies..

and if you put a switch back it'll revert with you loosing sight of harkonnen and its allies back to ordos..

Link to post
Share on other sites

Thanks to FunkyFr3sh I got a patcher working. You can change sides in-game by pressing the numpad keys. It works on normal and high resolution versions. The patcher edits DUNE2000.DAT, no need to run a trainer.

 

It's a proof of concept patcher, because I don't see how you would use this in normal gameplay that much. Adding a specific button to your mod, like AQIB did, so the player can't cheat looks better to me. On the other hand, that might slow gameplay too much. You can use this patched version just to test and experience the other side of the battle. Perhaps it's an idea to switch sides based on time and you need to keep two bases alive. Presuming both bases have no AI (or simple AI) that is interrupting. I don't know, just brainstorming here for mods.

 

Comments and thoughts are welcome.

 

Download:

-------------------------------------------------------------------------------------------------			       IN-GAME SIDE CHANGER - DUNE 2000 -------------------------------------------------------------------------------------------------					     INSTALL-------------------------------------------------------------------------------------------------0)	Make sure your Dune 2000 game is working and version 1.06. 	Make a backup of your Dune 2000 in case something goes wrong.1) 	Extract patcher.exe into the Dune 2000 main folder. 	This is the folder containing DUNE2000.EXE.2) 	Run the patcher and choose 1 to install or 0 to undo the patch.3) 	You are done. Start DUNE2000.EXE. Use numpad keys during gameplay to change side.-------------------------------------------------------------------------------------------------					   QUICK INFO-------------------------------------------------------------------------------------------------* Keep a fresh/vanilla Dune 2000 as backup (zipped) in case the patcher fails. * This patcher can also be used on High Resolution Patched Dune 2000.* Patcher makes a backup of the adjusted file in 'backup' folder. Undo the patch with option 0.  * Get mods and more stuff at http://d2kplus.com/ , like the mission select patch/mod. * Size of patcher is large because it's written in Python.-------------------------------------------------------------------------------------------------					     USAGE-------------------------------------------------------------------------------------------------You can change sides, on the fly, in gameplay by using the numpad keys:	0 = Atreides,	1 = Harkonnen,	2 = Ordos,	3 = Emperor,	4 = Fremen,	5 = Smugglers,	6 = Mercenaries,	7 = Sand(worm).-------------------------------------------------------------------------------------------------				             CREDITS-------------------------------------------------------------------------------------------------Credits go to FunkyFr3sh at forum.dune2k.com for helping locate the (hot)keys. -------------------------------------------------------------------------------------------------				            DISCLAIMER-------------------------------------------------------------------------------------------------This patcher comes with ABSOLUTELY NO WARRANTY!Please report all problems or suggestions at the forums: forum.dune2k.com. Thanks.-------------------------------------------------------------------------------------------------				             AUTHOR-------------------------------------------------------------------------------------------------Made by D2k Sardaukar at forum.dune2k.com.-------------------------------------------------------------------------------------------------
  • Upvote 2
Link to post
Share on other sites

this is a cheating tool..

a mega cheating tool unfortunately..

anyone can use this to switch sides and sell enemy buildings and win etc..

use of this tool for cheating will decrease the fun..

@d2ksardaukar :

well if you feel it slows I'll try to incorporate the button elsewhere..

I still didn't understand FunkyFr3sh's idea of adding shortcuts..

can you explain how I can add a key shortcut manually..??

Link to post
Share on other sites

this is a cheating tool..

a mega cheating tool unfortunately..

anyone can use this to switch sides and sell enemy buildings and win etc..

use of this tool for cheating will decrease the fun..

@d2ksardaukar :

well if you feel it slows I'll try to incorporate the button elsewhere..

I still didn't understand FunkyFr3sh's idea of adding shortcuts..

can you explain how I can add a key shortcut manually..??

There are a lot more ways to cheat in Dune 2000 because of modding tools. It's very easy to get lots of money for example. It's just up to the player if he/she cheats or not.

 

FunkyFr3sh's idea, simply put, is to make a jump in the code section from pressed keys (just below 004A332A) to an empty place in the .DAT file, perform some custom code and return to the jumping location (little further). It's a simple idea, but getting the correct offset and making custom code that does not crash is more difficult. Something like this: http://home.inf.fh-rhein-sieg.de/~ikarim2s/how2injectcode/code_inject.html

  • Upvote 2
Link to post
Share on other sites

There are a lot more ways to cheat in Dune 2000 because of modding tools. It's very easy to get lots of money for example. It's just up to the player if he/she cheats or not.

 

FunkyFr3sh's idea, simply put, is to make a jump in the code section from pressed keys (just below 004A332A) to an empty place in the .DAT file, perform some custom code and return to the jumping location (little further). It's a simple idea, but getting the correct offset and making custom code that does not crash is more difficult. Something like this: http://home.inf.fh-rhein-sieg.de/~ikarim2s/how2injectcode/code_inject.html

Its a useful concept when you want to see whats happening from the AIs prospective in mission design.

  • Upvote 3
Link to post
Share on other sites

let's see what we can do..

I wrote up a quick menu based on your work, and I plan to flesh it out with additional functions. I already discovered why the AI does not rebuild its buildings in certain missions (such as mission 1 in Rise of the Mercenaries), it gets stuck in a loop building and canceling the concrete slab to place the new building on.

  • Upvote 2
Link to post
Share on other sites

Its a useful concept when you want to see whats happening from the AIs prospective in mission design.

Yeah, indeed, I also noticed that changing the team number (ctrl+number on unit) will make the AI unit do something else. It doesn't always accept the change. Quick test gives this, team 1 = base (defence), team 2 = wait, team 3,4 = attack, team>4 unclear. It looks like the AI wants to achieve a certain amount of units in a certain team number so it doesn't always work changing the number.

  • Upvote 2
Link to post
Share on other sites

Yeah, indeed, I also noticed that changing the team number (ctrl+number on unit) will make the AI unit do something else. It doesn't always accept the change. Quick test gives this, team 1 = base (defence), team 2 = wait, team 3,4 = attack, team>4 unclear. It looks like the AI wants to achieve a certain amount of units in a certain team number so it doesn't always work changing the number.

even I noticed..

when I was using three houses at same time..

Patterns changed..

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...