Outpost Universe Forums

Projects & Development => Outpost 2 Programming & Development => Topic started by: Arklon on January 22, 2006, 09:59:50 PM

Title: Is It Possible...
Post by: Arklon 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.
Title: Is It Possible...
Post by: HaXtOr on January 22, 2006, 11:31:24 PM
yes I believe you can. It happens in multiplayer when a player leaves sometimes
Title: Is It Possible...
Post by: Freeza-CII 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.
Title: Is It Possible...
Post by: HaXtOr 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
Title: Is It Possible...
Post by: Leviathan on January 23, 2006, 03:51:21 AM
The buildings blow up and the units transfer.
Title: Is It Possible...
Post by: HaXtOr on January 23, 2006, 06:55:23 AM
We are going to have to test this ^_^ 6 player game anyone?
Title: Is It Possible...
Post by: Leviathan on January 23, 2006, 07:08:38 AM
I have played OP2 multiplayer for years i think i should know :)
Title: Is It Possible...
Post by: Arklon on January 23, 2006, 07:52:20 AM
I mean a programming function to transfer structures to another player... -_-
Title: Is It Possible...
Post by: BlackBox 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).
Title: Is It Possible...
Post by: Sirbomber 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.
Title: Is It Possible...
Post by: Harky on January 26, 2006, 05:22:25 AM
lol.. What "stuff" are you talking aobut exactly ? lol
Title: Is It Possible...
Post by: Eddy-B 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.
Title: Is It Possible...
Post by: Hooman 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.
Title: Is It Possible...
Post by: Freeza-CII 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.
Title: Is It Possible...
Post by: Hooman 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.
 
Title: Is It Possible...
Post by: thablkpanda 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
Title: Is It Possible...
Post by: TH300 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.