logo   login
right
Home Forums Downloads Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Forum Info
Forum Members: 18,575
Total Threads: 8,656
Posts: 94,426

Administrators:
DeeZire, Redemption

There are currently 65 users online.
Partner Links

Free Credit Repair

Learn the Ticket Broker Secrets
Advertisements


Generals & Zero Hour Editing Discuss any modding related issues to do with Generals and Zero Hour here.

Reply
 
LinkBack Thread Tools
Old 01-27-2007, 05:15 PM   #1 (permalink)
Senior Member
 
Join Date: Aug 2004
Location: St. Petersburg, FL
Posts: 272
Default Tech Factory

I am trying to code a building to switch Commandsets, or the whole building itself, depending upon which faction controls it. I have tried ObjectReplace with different buildings for each side, but it doesnt work. Is there a way to make this work (I have Six sides in my mod)
Yuki Kiba Dakatsu is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 01-28-2007, 12:42 AM   #2 (permalink)
Senior Member
 
CommieDog's Avatar
 
Join Date: Oct 2004
Location: Alaska (Hell Frozen Over)
Posts: 370
Default

If you have room to add six new upgrades, you could give one to each side (via GrantUpgradeCreate on a starting object) and have that upgrade trigger a specific CommandSetUpgrade module on your new tech building.
CommieDog is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-22-2007, 11:32 PM   #3 (permalink)
Member
 
Join Date: Feb 2006
Location: Kidderminster
Posts: 57
Default

That's exactly what I did

Here's some example code...

Replace [Faction] with the relevant name for each of your 6 Factions.

In PlayerTemplate, for each Faction...
Code:
  StartingUnit1 = [Faction]StartingObject
In its own INI file under the Object directory...
Code:
Object [Faction]StartingObject

  KindOf            = INERT
  EditorSorting     = SYSTEM

  Body = InactiveBody Body
  End

  Behavior = LifetimeUpdate Lifetime
    MinLifetime     = 1
    MaxLifetime     = 1
  End

  Behavior = GrantUpgradeCreate Upgrade
    UpgradeToGrant = [Faction]StartingObject
  End

End
In the Object that requires the CommandSet switch...
Code:
  Behavior = CommandSetUpgrade [Faction]
    CommandSet      = [CommandSet]
    TriggeredBy     = [Faction]StartingObject
  End
Finally, the Upgrades...
Code:
Upgrade [Faction]StartingObject
  Type               = PLAYER
End
HTH,
M_M
Mere_Mortal is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 01-07-2008, 11:20 PM   #4 (permalink)
Senior Member
 
Join Date: Jan 2008
Posts: 277
Default

Quote:
Originally Posted by Yuki Kiba Dakatsu View Post
I am trying to code a building to switch Commandsets, or the whole building itself, depending upon which faction controls it. I have tried ObjectReplace with different buildings for each side, but it doesnt work. Is there a way to make this work (I have Six sides in my mod)
Here is another way:

Give the building a suicide weapon and a button to fire it.

When the player captures the building, he fires the suicide weapon and the buildings kills itself.

When it dies, it's InstantDeathBehavior module has OCL = OCL_NewBuildingCreatingObject which creates with disposition ON_GROUND_ALIGNED a new object, lets call it NewBuildingCreatingObject.

NewBuildingCreatingObject in turn, will delete itself after a short time, via DeletionUpdate, and it has the same model as the building that died so it looks to the player as if it is the same building and the player does not see it die.

Before NewBuildingCreatingObject deletes itself, it has an OCLUpdate module that calls an OCL based on the owning player's faction. For an example see Object TechReinforcementPad in TechBuildings.ini whose OCLUpdate module has different FactionOCLs.

Depending on what faction owns the object, a different OCL is used. This OCL in turn creates a new object with the same model as the original object that was suicided so the player still does not see any difference and it looks as if it is the same building. However, the different objects have different command sets. Et voila!

Last edited by beng; 01-07-2008 at 11:23 PM.
beng is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 01-22-2008, 10:45 PM   #5 (permalink)
Senior Member
 
Join Date: Jan 2008
Posts: 277
Default

That would be good for games where time is not important, because it takes time to build up the tech trees of the different factions. It would be good to get a mixture of base defences for better a turtling strategy, eg SupW EMP patriots + china gattling cannons should take care of vehicles + infantry and aircraft.

Actually to add dozer buttons to a command center it is not necessary to make a mod, just use a script to do it for the map, and make sure you only use unused slots in the command set.
beng is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tech War Fortress, a new tech building SW & ROTR The_Hunter Generals & Zero Hour Editing 6 11-03-2005 10:30 PM
I need help with my war factory. MadHQ Red Alert 2 & Yuri's Revenge Editing 10 01-05-2004 01:09 PM
War factory Ola Generals & Zero Hour Editing 8 07-24-2003 08:59 PM
War factory Ola Red Alert 2 & Yuri's Revenge Editing 15 05-20-2003 01:27 AM
Hovercraft from a war factory? OpticPast Red Alert 2 & Yuri's Revenge Editing 6 01-27-2003 06:22 AM


All times are GMT -4. The time now is 12:03 AM.


Design By: Miner Skinz.com
Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.