Author Topic: New Tutorial: Sandbox Mode  (Read 2762 times)

Offline gwyned

  • Newbie
  • *
  • Posts: 17
New Tutorial: Sandbox Mode
« on: February 18, 2004, 03:05:39 PM »
First of all, let me say greetings to all my fellow Outpost2 fans out there.  Like most of you here, I am a huge fan of the game, and continue to play it to this day despite its age and the fact that I have done just about everything there is to do with the game (including beat both Plymouth and Eden campaigns on hard mode <shudder>).  

Using some of the tools I have found by scrounging around (and actively lurking on these forums  :blush: ), I have begun experimenting with level editing using some very basic hacking.  My current project is a new tutorial that allows a free-form game using Eden units.  I have managed to free morale, and scrape together a level that allows a player to fully research, grow, and build.  But, as of yet, I cannot figure out how to edit the level so as to create mines.  While the level already has a common ore mine, it really needs a rare ore mine in order to be a true sandbox mode.  

So, to all my fellow editors/hackers (I'm looking especially at you, op2hacker!), any idea how this could be accomplished.  I assume this will be pretty easy once the full-fledged mission editor is released...but of course I'm impatient, and would rather get this done sooner than that!  :lol: Thanks in advance for your help!

Gwyned

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
New Tutorial: Sandbox Mode
« Reply #1 on: February 18, 2004, 04:42:49 PM »
alright. You have gotten this far which is good. You do know that InitProc contains the level initialization code, right?

As far as freeing Morale, I'm assuming you just went into the Import Name Table (INT) and changed the name from ForceMoraleXXXX to FreeMoraleLevel, right?

To add mines you have to use the call TethysGame::CreateBeacon. (Of course the name is decorated)

Take the existing call to CreateBeacon. Look at what is pushed before the CALL instruction is made.

You have to basically copy that code, change the values that are PUSHed or MOVed/LEAed into registers, put it in a non coding area of the file (ie. the end of the .text section, or the huge unused parts of the .rdata / .data sections: be sure to make them Executable first! - in the Section Headers), then right after the existing CreateBeacon call, JMP to the new CreateBeacon calls, then JMP back.

I am a reverse engineer and know this type of stuff, but I'm not a teacher -- I'm assuming you know how to do this type of stuff)

then, your new beacons should be on the map. Enjoy!

_________

Here is some code and other stuff I've junked together - if you plan on using this, be sure to make sure the CALL instruction is calling the correct address!
Quote
Code Addr  Machine Code           Assembly Instructions
:110010BA 6AFF                    push FFFFFFFF ;unknown
:110010BC BA52000000              mov edx, 00000052 ;X pos
:110010C1 6A01                    push 00000001 ;yield of mine
:110010C3 B951000000              mov ecx, 00000051 ;unknown (crashes OP2)
:110010C8 6A00                    push 00000000 ;type of mine
:110010CA 6A22                    push 00000022 ; Y pos

* Reference To: Outpost2.?CreateBeacon@TethysGame@@SIHW4map_id@@HHHHH@Z, Ord:009Ah
                                  |
:110010CC FF1590510011            Call dword ptr [11005190]

;-END ASM LISTING

Extra data:
Yield of Mine - choices:
00 - 500 Common
01 - 300 Common
02 - 100 Common
03 - 300 Common
04 - 300 Common
05 - 500 Common
06 - 500 Common
07 - 300 Common
08 - 100 Common
09 - 300 Common
0A - 300 Common
0B - 300 Common
0C - 300 Common
0D - 300 Common
0E - 500 Common
0F - 500 Common
10 - 500 Common

Type Of Mine:
00 - Common
01 - Rare
02 - Common
03 - Rare
04 - (assumption) Common
05 - rare
06 - c.
07 - r
08 - c
09 - r
0A - c
0B - r
0C - c
0D - r
0E - c
0F - r
10 - Common
FF - Rare
« Last Edit: February 18, 2004, 04:43:40 PM by op2hacker »

Offline Betaray

  • Administrator
  • Hero Member
  • *****
  • Posts: 2897
New Tutorial: Sandbox Mode
« Reply #2 on: August 04, 2004, 09:26:31 PM »
a sandbox mode, that would be pretty fun

btw hacker, do you think you could mod that sandbox tutorial so that the color is black? man that is the coolest op2 color
« Last Edit: August 04, 2004, 09:30:54 PM by Betaray »
I am the nincompoop, I eat atomic bombs for breakfest, fusion bombs for lunch, and anti-matter bombs for dinner

I just hope they don't explode

Offline Arklon

  • Administrator
  • Hero Member
  • *****
  • Posts: 1269
New Tutorial: Sandbox Mode
« Reply #3 on: September 18, 2004, 03:06:55 PM »
Has anything new been accomplished with this? o_O