Author Topic: Is It Possible...  (Read 4628 times)

Offline Arklon

  • Administrator
  • Hero Member
  • *****
  • Posts: 1269
Is It Possible...
« on: January 22, 2006, 09:59:50 PM »
... to transfer structures from one player to another? A couple different uses for this that come to mind:
1) Transfer blight-infected structures to the AI.
2) A game type where you have to capture and hold a base for X number of marks.
« Last Edit: January 22, 2006, 10:00:24 PM by Arklon »

Offline HaXtOr

  • Sr. Member
  • ****
  • Posts: 423
    • http://www.wtfmoogle.com
Is It Possible...
« Reply #1 on: January 22, 2006, 11:31:24 PM »
yes I believe you can. It happens in multiplayer when a player leaves sometimes

Offline Freeza-CII

  • Administrator
  • Hero Member
  • *****
  • Posts: 2308
Is It Possible...
« Reply #2 on: January 22, 2006, 11:36:35 PM »
The only way to transfer a stucture.  Is to have a unbuilt stucture in a Convec and transfer it.  How ever if your eden and you recieve a plymouth spaceport in a convec it will build a Eden space port.

When a player leaves the buildings either blow op or just sit there and rot.  The player can how ever transfer all the vecs they have to some one.

there is no way to transfer a building that is already built.

Offline HaXtOr

  • Sr. Member
  • ****
  • Posts: 423
    • http://www.wtfmoogle.com
Is It Possible...
« Reply #3 on: January 22, 2006, 11:47:04 PM »
Ive had that happen before though. someone on my team quit and all of their buildings and vehicles were mine and i could do as i pleased with them

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
Is It Possible...
« Reply #4 on: January 23, 2006, 03:51:21 AM »
The buildings blow up and the units transfer.

Offline HaXtOr

  • Sr. Member
  • ****
  • Posts: 423
    • http://www.wtfmoogle.com
Is It Possible...
« Reply #5 on: January 23, 2006, 06:55:23 AM »
We are going to have to test this ^_^ 6 player game anyone?

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
Is It Possible...
« Reply #6 on: January 23, 2006, 07:08:38 AM »
I have played OP2 multiplayer for years i think i should know :)

Offline Arklon

  • Administrator
  • Hero Member
  • *****
  • Posts: 1269
Is It Possible...
« Reply #7 on: January 23, 2006, 07:52:20 AM »
I mean a programming function to transfer structures to another player... -_-

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
Is It Possible...
« Reply #8 on: January 23, 2006, 08:07:12 AM »
You could try using Unit.DoTransfer(newPlayerID) to transfer a structure to another player.

Save the Unit variable when you call CreateUnit, or use an enumerator to get a unit variable for the unit you want to transfer.

I haven't tested this, I don't really know if it would even work. However, it's worth a shot. Maybe I'll look into it when I get home.

If that doesn't work, there's another idea I have - changing the Owner ID of the unit by doing a memory patch. (This could have some implications attached. For example, a structure that affects morale might not affect your morale if transferred to you in this manner).

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Is It Possible...
« Reply #9 on: January 23, 2006, 08:26:26 AM »
Quote
I mean a programming function to transfer structures to another player... -_-

Yeah, I was about to say Arky means in a dll, not through the trade function.  :rolleyes:
You could probably use DoTransfer or whatever it's called.
I see hacker beat me to that.  ;)

If you want something more specific (based off of stuff I got from Harky who got stuff from Hacker)...

Give me awhile, I've got to fix some stuff with it.
« Last Edit: January 23, 2006, 08:26:55 AM by Sirbomber »
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline Harky

  • Newbie
  • *
  • Posts: 43
Is It Possible...
« Reply #10 on: January 26, 2006, 05:22:25 AM »
lol.. What "stuff" are you talking aobut exactly ? lol

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
Is It Possible...
« Reply #11 on: January 26, 2006, 12:34:04 PM »
Damn you guys!  you kinda stole my renegades idea! :P

yes, it is possible to transfer any unit from 1 player to another. I have not yet figured a way to have a spider transfer an EMP'ed building, and i don't think i ever will,,, but i was thinking of setting up an event (or trigger) to fire when a specific vehicle is next to an enemy building for x number of ticks, then the building gets transferred.  
The underlying thought: an evac vehicle filled with soldiers take over a building. You could even simulate casualties under the soldiers (be decreasing the number of "colonists" in the evac), so there's a limit to what it can do. Kinda makes you think twice about which buildings you'd wanna capture..

Anyway: i'll be working on this pretty soon, now that we finally have a date for the 1st mission pack release: feb 17th.
« Last Edit: January 26, 2006, 12:43:56 PM by Eddy-B »
Rule #1:  Eddy is always right
Rule #2: If you think he's wrong, see rule #1
--------------------

Outpost : Renegades - Eddy-B.com - Electronics Pit[/siz

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Is It Possible...
« Reply #12 on: January 26, 2006, 01:05:20 PM »
The game often recalculates morale effects, so transfering buildings shouldn't be too much of an issue. There does seem to be player specific unit lists though. When it does this stuff, it might only check the player specific list for buildings. At any rate, it shouldn't be more comlicated than changing the owner id, possibly moving the building between lists (simple linked lists, not too hard to do I'd imagine), and then just to be sure, set a boolean value in the player record to tell it to recalculate all those morale values during the next game cycle.

I believe it recounts buildings when calculating those values. If not, you might need to update a count for that buliding type. I doubt it's necessary though.


Of course, that's all assuming a simple .DoTransfer() doesn't work.

Offline Freeza-CII

  • Administrator
  • Hero Member
  • *****
  • Posts: 2308
Is It Possible...
« Reply #13 on: January 26, 2006, 01:15:12 PM »
But i wonder if you can transfer a building will it say eden/plymouth or will it convert to what ever the owner is.  Some how I plymouth vec fac transfering but staying the same.  And I dont see how it would beable to build the ply units with out the research.

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Is It Possible...
« Reply #14 on: January 26, 2006, 01:19:45 PM »
There is a seperate ownerNum and creatorNum for each unit (including buildings). The graphics are probably based on the creatorNum, so changing the owner shouldn't affect graphics. As for functionality, they're both the same structure factory really. They probably just change graphics based on the colony of the player owning it. That or when it's created, they might just copy the player's colony type into one of the flag bits. I think it might be the later. It's all the same class (and hence the same code) for either though. So a "plymouth" structure factory should behave exactly the same as an "eden" structure factory.
 

Offline thablkpanda

  • Full Member
  • ***
  • Posts: 249
Is It Possible...
« Reply #15 on: January 26, 2006, 01:32:40 PM »
I do know that via the trade function- you can transfer the convec holding a structure kit, right before you set it to build- then it will still build the plymouth version of a spaceport - for example. I'ma go do some ingame testing ASAP, but I think that works...

Chris

Offline TH300

  • Hero Member
  • *****
  • Posts: 1404
    • http://op3game.net
Is It Possible...
« Reply #16 on: January 26, 2006, 02:10:42 PM »
at least when vehicles are transferred, graphics don't change. An Eden Convec transferred to plymouth is still gray. I guess, it'll be the same with buildings.