Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline Annihilationzh  
#1 Posted : Saturday, December 28, 2013 12:56:24 PM(UTC)
Annihilationzh
General
Joined: 8/2/2008(UTC)
Posts: 1,779
United Kingdom

Thanks: 26 times
Was thanked: 475 time(s) in 331 post(s)
Please post feedback if you tried this. I have a tendency to forget some things.

This is the default code you need to use bike logic. Bike logic gives you a lot of freedom and allows you to push the limits of the game. This allows you to freely switch a unit's locomotor, weapon, model and/or status with a button. It does not work on units that reload at an airfield.

This goes in the code of the unit that you wish to be able to switch weapons/locomotors:
Code:
  WeaponSet
    Conditions = WEAPON_RIDER1
    Weapon     = PRIMARY Default_Weapon
  End
  WeaponSet
    Conditions = WEAPON_RIDER1 PLAYER_UPGRADE
    Weapon     = PRIMARY Mega_Default_Weapon
  End
  WeaponSet
    Conditions = WEAPON_RIDER2
    Weapon     = PRIMARY Alternate_Weapon
  End

  Behavior = RiderChangeContain ModuleTag_Switch
    Rider1               = DefaultRider1 RIDER1 WEAPON_RIDER1 STATUS_RIDER1 DefaultRider1CommandSet SET_NORMAL
    Rider2               = AlternateRider2 RIDER2 WEAPON_RIDER2 STATUS_RIDER2 AlternateRider2CommandSet SET_NORMAL
    Slots                = 1
    InitialPayload       = DefaultRider1 1
    ScatterNearbyOnExit  = No
    HealthRegen%PerSec   = 0
    DamagePercentToUnits = 100%
    BurnedDeathToUnits   = No
    AllowInsideKindOf    = PORTABLE_STRUCTURE
    ForbidInsideKindOf   = INFANTRY
    ExitDelay            = 1
    NumberOfExitPaths    = 1
    GoAggressiveOnExit   = Yes
  End

  Behavior           = OCLSpecialPower ModuleTag_Napalm
    SpecialPowerTemplate = SpecialAbilityDefaultRider1
    OCL                  = OCL_DefaultRider1
  End
  Behavior           = OCLSpecialPower ModuleTag_Nuke
    SpecialPowerTemplate = SpecialAbilityAlternateRider2
    OCL                  = OCL_AlternateRider2
  End


This is the unit code for the fake Riders:

Code:
;----------------------------------------------------------------------------------------
Object DefaultRider1
  EditorSorting       = SYSTEM
  TransportSlotCount  = 1
  ExperienceValue     = 1 1 1 1
  ExperienceRequired  = 0 100 200 400
  IsTrainable    = Yes
  KindOf = PORTABLE_STRUCTURE INERT
  Body = ActiveBody ModuleTag_1
    MaxHealth       = 1.0
    InitialHealth   = 1.0
  End
  Behavior = AIUpdateInterface ModuleTag_2
  End
  Behavior = DestroyDie ModuleTag_3
    DeathTypes = ALL
  End
  Behavior = LifetimeUpdate ModuleTag_4
    MinLifetime = 1
    MaxLifetime = 1
  End
  Behavior = PhysicsBehavior ModuleTag_5
    Mass          = 1.0
    AllowBouncing = No
  End
End

;----------------------------------------------------------------------------------------
Object AlternateRider2
  EditorSorting       = SYSTEM
  TransportSlotCount  = 1
  ExperienceValue     = 1 1 1 1
  ExperienceRequired  = 0 100 200 400
  IsTrainable    = Yes
  KindOf = PORTABLE_STRUCTURE INERT
  Body = ActiveBody ModuleTag_1
    MaxHealth       = 1.0
    InitialHealth   = 1.0
  End
  Behavior = AIUpdateInterface ModuleTag_2
  End
  Behavior = DestroyDie ModuleTag_3
    DeathTypes = ALL
  End
  Behavior = LifetimeUpdate ModuleTag_4
    MinLifetime = 1
    MaxLifetime = 1
  End
  Behavior = PhysicsBehavior ModuleTag_5
    Mass          = 1.0
    AllowBouncing = No
  End
End


SpecialPower.ini

Code:
;-----------------------------------------------------------------------------
SpecialPower SpecialAbilityDefaultRider1
  Enum            = SPECIAL_DETONATE_DIRTY_NUKE
  ReloadTime      = 0
  PublicTimer     = No
  ShortcutPower   = No
End
SpecialPower SpecialAbilityAlternateRider2
  Enum            = SPECIAL_DETONATE_DIRTY_NUKE
  ReloadTime      = 0
  PublicTimer     = No
  ShortcutPower   = No
End


CommandSet.ini

Code:
;----------------------------------------------------------------------------------------
CommandSet DefaultRider1CommandSet
  1 = Command_AlternateRider2
End

CommandSet AlternateRider2CommandSet
  1 = Command_DefaultRider1
End


CommandButton.ini

Code:
;-----------------------------------------------------
CommandButton Command_DefaultRider1
  Command       = SPECIAL_POWER
  SpecialPower  = SpecialAbilityDefaultRider1
  Options       = OK_FOR_MULTI_SELECT NOT_QUEUEABLE
;  ButtonImage   = ADD_ME
  ButtonBorderType = ACTION
;  TextLabel     = CONTROLBAR:ADD_ME
End

CommandButton Command_AlternateRider2
  Command       = SPECIAL_POWER
  SpecialPower  = SpecialAbilityAlternateRider2
  Options       = OK_FOR_MULTI_SELECT NOT_QUEUEABLE
;  ButtonImage   = ADD_ME
  ButtonBorderType = ACTION
;  TextLabel     = CONTROLBAR:ADD_ME
End


ObjectCreationList.ini

Code:
;-----------------------------------------------------
ObjectCreationList OCL_DefaultRider1
  CreateObject
    ObjectNames = DefaultRider1
    Count       = 1
    ContainInsideSourceObject = Yes
  End
End

ObjectCreationList OCL_AlternateRider2
  CreateObject
    ObjectNames = AlternateRider2
    Count       = 1
    ContainInsideSourceObject = Yes
  End
End
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
thanks 6 users thanked Annihilationzh for this useful post.
Rrtaya_tsamsiyu on 12/28/2013(UTC), CommieDog on 12/28/2013(UTC), UTD^Force on 8/19/2014(UTC), Gameanater on 12/23/2015(UTC), elliesy on 4/17/2017(UTC), R.I.P on 7/4/2017(UTC)
Sponsor
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.