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

Forum Info
Forum Members: 18,581
Total Threads: 8,669
Posts: 94,547

Administrators:
DeeZire, Redemption

There are currently 37 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 09-16-2003, 02:06 PM   #1 (permalink)
Senior Member
 
Join Date: May 2003
Location: Eindhoven, Netherlands
Posts: 2,278
Send a message via ICQ to CodeCat Send a message via MSN to CodeCat
Default Toggle-able upgrades

I want to do this: you have a building (power drain=-15) with a radar upgrade button, but initially its inactive. You click the button and the radar is activated, but the power drain also increases to -19. Then you click another button and radar is disabled again, and drain drops back to -15. So you can choose whether you want radar or not, but you can save the power if you choose not to have it.

I have three suggestions on how to do this (but don't know if either of them are possible, so that's what I'm asking):

- 2 buttons, one of them just creates an upgrade object (which provides radar and drains power) and then the other one destroys it. Creating the object is easy, but how do I destroy it with the other button?

- 1 button, which uses the overcharge logic. You click it and the building goes into overcharge mode, which drains power (via ExtraPower = -4). But how do I get this to grant the radar upgrade at the same time?

- 2 buttons, one of them activates an upgrade, which drains power though use of a powerplantupgrade. It also triggers the radar upgrade. But how do I use the other button to remove the upgrade from the building?

Anyone know if any of these are possible, and how?
CodeCat is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-16-2003, 02:19 PM   #2 (permalink)
Senior Member
 
Join Date: Mar 2003
Location: UK
Posts: 676
Send a message via MSN to DJRowley
Default Re: Toggle-able upgrades

Quote:
Originally Posted by ImmoMan
- 2 buttons, one of them just creates an upgrade object (which provides radar and drains power) and then the other one destroys it. Creating the object is easy, but how do I destroy it with the other button?
You could make it so the upgrade object has an armour type only damageable by one damage type. The other button creates an object with a lifetime of 10 or something which fires a weapon with that damage type using FireWeaponWhenDead. You would also have to add the same FireWeaponWhenDead behaviour to the building to kill theobject when the building dies. Alternatively, if you use the drone code you could set it so it dies when the building dies anyway. You should use the ConflictsWith thing so that the 2nd upgrade can only be built when the first one is. Hope this helps. I thought of it a couple of days ago for something but i can't remmber what is was now........
DJRowley is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-16-2003, 02:39 PM   #3 (permalink)
Senior Member
 
Join Date: May 2003
Location: Eindhoven, Netherlands
Posts: 2,278
Send a message via ICQ to CodeCat Send a message via MSN to CodeCat
Default

So here's my code:

Code:
; code for the building
  Behavior = ObjectCreationUpgrade ModuleTag_06
    UpgradeObject = OCL_RadarObject
    TriggeredBy   = Upgrade_AmericaActivateRadar
  End
  
  Behavior = ObjectCreationUpgrade ModuleTag_07
    UpgradeObject = OCL_RadarDisableObject
    TriggeredBy   = Upgrade_AmericaDeactivateRadar
  End

; object in system.ini that creates radar
Object RadarObject

  ; ***DESIGN parameters ***
  EditorSorting       = SYSTEM
  KindOf              = NO_COLLIDE IMMOBILE INERT

  EnergyProduction    = -4
  
  ; *** ENGINEERING Parameters ***
  Body            = ActiveBody ModuleTag_01
    MaxHealth     = 1
    InitialHealth = 1
  End
  
  ArmorSet
    Conditions = none
    Armor = RadarObjectArmor
  End
  
  Behavior = GrantUpgradeCreate ModuleTag_02
    UpgradeToGrant     = Upgrade_AmericaRadar
  End
  Behavior        = RadarUpgrade ModuleTag_03
    TriggeredBy   = Upgrade_AmericaRadar
  End

End

; other object that destroys radar
Object RadarDisableObject

  ; ***DESIGN parameters ***
  EditorSorting       = SYSTEM
  KindOf              = NO_COLLIDE IMMOBILE INERT

  ; *** ENGINEERING Parameters ***
  Body            = ActiveBody ModuleTag_01
    MaxHealth     = 1
    InitialHealth = 1
  End
  
  ArmorSet
    Conditions = none
    Armor = InvulnerableAllArmor
  End
  
  Behavior = LifetimeUpdate ModuleTag_02
    MinLifetime = 1
    MaxLifetime = 1
  End
  
  Behavior = FireWeaponWhenDeadBehavior ModuleTag_03
    DeathWeapon   = RadarDisablingWeapon
    StartsActive  = Yes
  End

End
So would this work? I already noticed that the "disable radar" button will always be available, even if radar is already disabled. Any solutions for this?
CodeCat is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-16-2003, 03:30 PM   #4 (permalink)
Senior Member
 
Join Date: Mar 2003
Location: UK
Posts: 676
Send a message via MSN to DJRowley
Default

Something like that, try it You could set it so that the disable radar button requires the radar upgrade to work.
DJRowley is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-16-2003, 03:37 PM   #5 (permalink)
Senior Member
 
Join Date: May 2003
Location: Eindhoven, Netherlands
Posts: 2,278
Send a message via ICQ to CodeCat Send a message via MSN to CodeCat
Default

Quote:
Originally Posted by DJRowley
You could set it so that the disable radar button requires the radar upgrade to work.
That's what I figured. But upgrades can't have prerequisites...
CodeCat is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-16-2003, 10:01 PM   #6 (permalink)
Senior Member
 
Join Date: Feb 2003
Location: USA
Posts: 853
Send a message via AIM to mastermind2003 Send a message via MSN to mastermind2003
Default

I suppose you could use the scripts to only make the button visible, or use a commandset switch.
mastermind2003 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
Selling Units from SD / Toggle Power ChronoDildo Red Alert 2 & Yuri's Revenge Editing 3 03-05-2005 04:25 AM
Need Help - Upgrades + Buildings requiring upgrades to build Azad0r LOTR: Battle For Middle Earth I & II Editing 5 01-02-2005 04:37 AM
Power Toggle SW needleman Red Alert 2 & Yuri's Revenge Editing 28 02-05-2004 06:53 PM
Need help with Upgrades Razyd Generals & Zero Hour Editing 4 01-20-2004 01:04 PM
upgrades help damo1 Generals & Zero Hour Editing 6 07-15-2003 11:46 AM


All times are GMT -4. The time now is 12:32 PM.


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