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

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline acidbrain  
#1 Posted : Monday, August 20, 2018 3:09:49 PM(UTC)
acidbrain
General
Joined: 12/30/2011(UTC)
Posts: 982

Thanks: 95 times
Was thanked: 574 time(s) in 364 post(s)
Hey fellaz,

So i am working on a big skirmish map and im testing all kinds of ideas, i got this idea for a supply source that can be dropped by a plane, there already is the crate drop but that was not what i was looking for, i wanted it to be more like a supplydock.
So after a bit of tweaking and tinkering i came up with this stuff, made only with map.ini.
Tell me what you guys think and i will post the code if you like.
Vid has no sound for some reason but it is just a quick showcase of an idea...


Cheers and have fun

Edited by user Monday, August 20, 2018 3:10:38 PM(UTC)  | Reason: Secret

Panem et kirkinses
thanks 3 users thanked acidbrain for this useful post.
UTD^Force on 8/20/2018(UTC), SkyMix_RMT on 8/20/2018(UTC), Unknown Editor on 8/21/2018(UTC)
Sponsor
Offline UTD^Force  
#2 Posted : Monday, August 20, 2018 5:18:28 PM(UTC)
UTD^Force
Colonel
C&C Labs Staff: Labs Staff MemberMaps Staff: Maps Staff Member
Joined: 8/13/2013(UTC)
Posts: 817
Jordan
Location: Middle east

Thanks: 430 times
Was thanked: 184 time(s) in 168 post(s)
That is so cool! I'll try to do it myself before you post the code.

EDIT: I suggest adding the code to the ini code snippets too, it might inspire even more ideas.

Edited by user Monday, August 20, 2018 5:19:35 PM(UTC)  | Reason: Not specified

Proud Muslim

UTD^Force

Moderator and former map reviewer
CnC Labs
thanks 1 user thanked UTD^Force for this useful post.
acidbrain on 8/21/2018(UTC)
Offline SkyMix_RMT  
#3 Posted : Monday, August 20, 2018 6:50:45 PM(UTC)
SkyMix_RMT
Major
Joined: 2/21/2015(UTC)
Posts: 386
Portugal

Thanks: 80 times
Was thanked: 132 time(s) in 96 post(s)
holy shjt I never thought something like that was even possible with just a map.ini can't wait to see the code.
Check out:

My Music (Techno/House/Experimental)

My Website (GeneralsCentral)

My Youtube Channel (Inactive)

World Builder Community Discord
thanks 1 user thanked SkyMix_RMT for this useful post.
acidbrain on 8/21/2018(UTC)
Offline Unknown Editor  
#4 Posted : Tuesday, August 21, 2018 1:17:29 AM(UTC)
Unknown Editor
Major
Joined: 3/22/2017(UTC)
Posts: 278
Location: Some where on Earth

Thanks: 123 times
Was thanked: 69 time(s) in 59 post(s)
WoW , This was awesome , Then my idea was and well still is a SupplyWareHouse which regenerates Supplies by a Plane every 4 mins .
Asking is Not a Problem , Problem is Not to Know Something .

Operation : Dark Angel
Static : Launch Delayed
Reason : Uncool Terrain - Old Logic in use - Lack of Performance
Status : Applying new Terrain - Applying new Logic - Increasing Performance by 300%
thanks 1 user thanked Unknown Editor for this useful post.
acidbrain on 8/21/2018(UTC)
Offline acidbrain  
#5 Posted : Tuesday, August 21, 2018 7:02:53 AM(UTC)
acidbrain
General
Joined: 12/30/2011(UTC)
Posts: 982

Thanks: 95 times
Was thanked: 574 time(s) in 364 post(s)
It all started with 2 things:
1. A question about the OCLUpdate module.
So i thought this...A supplydropzone object has a OCLUpdate module which sends a cargoplane to
the model to drop some crates every 120000 msec(2 minutes), what if i make an object that lives
for 1 msec with a OCLUpdate module 'MinDelay' and 'MaxDelay' set to 1 msec also, does the ocl
get triggered and sends the plane?..Well it does!!!

2. Finding an unused supplydock model.
When i was searching the interwebs for unused c&c content i found a site that talked about a
unused techbuilding, a radio station, i went looking for the models and then i saw model
'ZBPile' in the zh w3d big file, i instantly linked that ocl update module and this model, i thought
...What if you spawn an object that lives for 1 msec, triggeres an ocl which sends a cargoplane
which drops different kind of crates but as on of the first crates you throw a special crate,
a crate which dies at height 10.0 and spawns the 'ZBPile' model with ocl and fades the model in
slowly while the smoke from the dying at 0.01 height other crates mask the spawn a little...

Here is some more detail about the 'ZBPile' model and the mechanics of a supplydock...
If you check the code of the supplydock you will find the following 2 modules:
Code:

  Draw = W3DSupplyDraw ModuleTag_02
    ExtraPublicBone = SUP

    ConditionState = NONE
      Model = ZBSupplyDK_B
    End

    SupplyBonePrefix = SUP
  End

and

  Behavior = SupplyWarehouseDockUpdate ModuleTag_06
    AllowsPassthrough       = No
    NumberApproachPositions = -1
    StartingBoxes           = 400
  End


These 2 modules are connected, the 'ZBSupplyDK_B' model contains all the seperate boxes that make up the supplies on the supplydock, the name of the seperate objects is SUP01 to SUP whatever, with the 'StartingBoxes = 400' you specify what graphically full is, so how many SUP objects are visible, 400 is default amount $30000, i set it to 250 which gives a $18750 supplydock...
The 'ZBPile' model is a model just like the 'ZBSupplyDK_B' model, it contains seperate objects called SUP.
I really dont understand why they implemented only 1 type of supplydock while this model was also there, lack of time due to a money horny EA i guess...

Here you have the idea, now the fun part, some code, i used rebel ambush logic to spawn the object that triggers the cargoplane...
Code:

;Nice unused special power with a button that has a 'SCTempDefaultCommand' image, rather blank than wrong image, text tooltips do the job good enough...
SpecialPower SuperweaponTerrorCell
  Enum               = SPECIAL_TERROR_CELL
  ReloadTime         = 0  ;No reload time for testing purposes
  SharedSyncedTimer  = No
  PublicTimer        = No
  InitiateSound      = TerrorCellActivated
  ViewObjectDuration = 30000
  ViewObjectRange    = 250
  RadiusCursorRadius = 30
  ShortcutPower      = No
End

; ---

CommandButton Command_TerrorCell
  Command           = SPECIAL_POWER
  SpecialPower      = SuperweaponTerrorCell
  Options           = NEED_TARGET_POS CONTEXTMODE_COMMAND
  TextLabel         = CONTROLBAR:DropSupplySource  ;in map.str
  Science           = None
  ButtonImage       = SCTempDefaultCommand
  ButtonBorderType  = ACTION
  DescriptLabel     = CONTROLBAR:TooltipDropSupplySource  ;in map.str
  RadiusCursorType  = AMBUSH
  InvalidCursorName = GenericInvalid
End

; ---
;Create new commandset for outhouse
CommandSet OutHouseCommandSet
  1 = Command_TerrorCell
End

; ---
;Used this crapper to stash the button
Object OutHouse
  CommandSet = OutHouseCommandSet
  KindOf     = -CAN_SEE_THROUGH_STRUCTURE -CLEARED_BY_BUILD +STRUCTURE +SELECTABLE

  AddModule
    ;Add production update
    Behavior = ProductionUpdate Module_Add01
      ; <No Data>
    End

    ;When we push the button a vendingmachine is created
    Behavior = OCLSpecialPower Module_Add02
      SpecialPowerTemplate = SuperweaponTerrorCell
      OCL                  = OCL_SupplySourceTrigger
      CreateLocation       = CREATE_AT_LOCATION
    End
  End
End

; ---
;This object is spawned when you use SuperWeapon TerrorCell on location
ObjectCreationList OCL_SupplySourceTrigger
  CreateObject
    ObjectNames   = AsianVendingMachine
    Count         = 1
    FadeIn        = No
    DiesOnBadLand = Yes
  End
End

; ---
;Lets use a vending machine to trigger the cargo plane
Object AsianVendingMachine
  ;We dont want you to look like a vending machine so we remove your model
  RemoveModule ModuleTag_01  ;Remove W3DModelDraw module

  ;We want you to die without anyone noticing it so we remove your death fx
  RemoveModule ModuleTag_10  ;Remove FXListDie module

  AddModule
    ;In my short life i trigger an ocl which 
    ;sends an airplane to drop some crates
    Behavior = OCLUpdate Module_Add01 
      OCL          = OCL_SendCargoPlane
      MinDelay     = 1
      MaxDelay     = 1
      CreateAtEdge = Yes
    End

    ;Set object lifetime to 1 msec, we only need object for ocl trigger
    ;Ocl update is set to 1 msec so every msec a plane is send if we dont kill
    ;this object in 1 msec
    Behavior = LifetimeUpdate Module_Add02
      MinLifetime = 1
      MaxLifetime = 1
    End
  End
End

; ---

;OCL that spawns the cargoplane which drops the crates
ObjectCreationList OCL_SendCargoPlane
  DeliverPayload
    Transport              = AmericaJetCargoPlane
    StartAtPreferredHeight = Yes
    StartAtMaxSpeed        = Yes
    MaxAttempts            = 1
    DropOffset             = X:0 Y:0 Z:-5
    DropDelay              = 310
    PutInContainer         = AmericaParachute
    Payload                = Sprinkler 1  ;Spawns supplysource on death
    Payload                = Crate 2
    Payload                = Crate02 2
    Payload                = ShippingCrate 2     
    Payload                = Crate 3
    Payload                = StackedBoxes 2
    Payload                = Crate02 3
    ParachuteDirectly      = Yes ;Bunch up on target
    DeliveryDistance       = 330
  End
End

; --- Normal crates ---
Object Crate
  KindOf = -IMMOBILE -CLEARED_BY_BUILD +PARACHUTABLE +CRATE

  AddModule
    Behavior = PhysicsBehavior Module_Add01
      Mass = 75.0
    End

    Behavior = HeightDieUpdate Module_Add01
      TargetHeight = 0.01
      TargetHeightIncludesStructures = No
    End
  End
End

; ---

Object Crate02
  KindOf = -IMMOBILE -CLEARED_BY_BUILD +PARACHUTABLE +CRATE
  TransportSlotCount = 1

  AddModule
    Behavior = PhysicsBehavior Module_Add01
      Mass = 75.0
    End

    Behavior = HeightDieUpdate Module_Add01
      TargetHeight = 0.01
      TargetHeightIncludesStructures = No
    End
  End
End

; ---

Object StackedBoxes
  KindOf = -IMMOBILE -CLEARED_BY_BUILD +PARACHUTABLE +CRATE
  TransportSlotCount = 1

  AddModule
    Behavior = PhysicsBehavior Module_Add01
      Mass = 75.0
    End

    ;I die at 0.01 height
    Behavior = HeightDieUpdate Module_Add01
      TargetHeight = 0.01
      TargetHeightIncludesStructures = No
    End
  End
End

; --- Special crate ---
;I am a sprinkler disguised as crate,
;i get dropped from a plane with a parachute and die at 10.0 height,
;when i die i spawn a supplysource which will fade in in 6 seconds
Object Sprinkler
  ;We don't want you to be a sprinkler anymore
  ;we want you to be a crate because we are sick
  ;of getting wet all the time.
  ReplaceModule ModuleTag_01
    Draw = W3DModelDraw ModuleTag_01_Override
      DefaultConditionState
        Model = PMCrat02
      End
    End
  End

  ;I am not immobile anymore and i cant get cleared by build anymore
  ;because well, uhm i kinda come falling from the sky now so i am 
  ;parachutable now like a crate, try placing a building on that!, i dare ya...
  KindOf = -IMMOBILE -CLEARED_BY_BUILD +PARACHUTABLE +CRATE

  ;I take 1 slot in a transport
  TransportSlotCount = 1

  AddModule
    ;I die at height 10.0
    Behavior = HeightDieUpdate Module_Add01
      TargetHeight = 10.0
      TargetHeightIncludesStructures = No
    End

    ;I spawn a supplysource on death
    Behavior = SlowDeathBehavior Module_Add02
      DeathTypes = ALL
      OCL = INITIAL  OCL_SpawnSupplySource
    End

    ;My object gets destroyed when i die
    Behavior = DestroyDie Module_Add03
      ; <No Data>
    End
  End
End

; ---
;This ocl spawns the supply source, used a barrel
;because i was a bit thirsty
ObjectCreationList OCL_SpawnSupplySource
  CreateObject
    ObjectNames   = Barrel
    Count         = 1
    FadeIn        = Yes
    FadeTime      = 6000
    DiesOnBadLand = Yes
  End
End

; ---

;Lets make a supplydock from a barrel, just because we can
;There is a nice unused model called 'ZBPile', lets blow the dust of it and use it.
Object Barrel
  ;We dont need your model anymore barrel, but first we drink your content...
  ReplaceModule ModuleTag_01
    Draw = W3DModelDraw ModuleTag_01_Override
      DefaultConditionState
        Model = None
      End
    End
  End

  RemoveModule ModuleTag_02  ;Remove ActiveBody module
  RemoveModule ModuleTag_03  ;Remove SlowDeathBehavior module

  TransportSlotCount = 1
  RadarPriority = STRUCTURE
  KindOf =  +SUPPLY_SOURCE_ON_PREVIEW +NO_COLLIDE +SUPPLY_SOURCE +IGNORED_IN_GUI +UNATTACKABLE +PARACHUTABLE  ;+STRUCTURE?

  AddModule
    ;I am a barrel disguised as supply source and im immortal, yay
    Body = ImmortalBody Module_Add01
      MaxHealth     = 1.0
      InitialHealth = 1.0
    End

    ;Draw and visually manage amount of boxes
    Draw = W3DSupplyDraw Module_Add02
      ExtraPublicBone = SUP
      SupplyBonePrefix = SUP

      ConditionState = NONE
        Model = ZBPile
      End     
    End

    ;Need this to function as supply source
    Behavior = SupplyWarehouseCreate Module_Add03
      ; <No Data>
    End

    Behavior = SupplyWarehouseDockUpdate Module_Add04
      AllowsPassthrough       = Yes  ;It's a drive through baby
      NumberApproachPositions = 9    ;Max in line
      StartingBoxes           = 250  ;Graphical amount of boxes(250 = $18750)
      DeleteWhenEmpty         = Yes  ;Remove object when empty
    End
  End

  Shadow = SHADOW_VOLUME
End


I used several civilian props, you can use any prop you want so pick your own models, it depends on what props you used on your map.

I attached a map so you guys can check it out without having to make stuff yourself.
For some strange reason it doesnt always work when i have the game open in the background, so restart the game before checking out the map i attached, also i have to restart the game sometimes after a start to get it to work, really strange, in my other map it always works.

If someone wants a more detailed explanation about something don't be afraid to ask...
If you see stuff that can be done better please notify so we can make this stuff as good as it can be, i dont know everything, usually i just throw a lot of sjit on a pile and try to get it to work, quite often without knowing what the heck im doing...:P

Unknown Editor wrote:
Then my idea was and well still is a SupplyWareHouse which regenerates Supplies by a Plane every 4 mins .

That is going to be hard if not impossible, you can get it to work however if you have a fixed supplysource with a name, adjust the ocl that spawns the plane and remove the crate that spawns the supply source, make an area around the supplydock of choice and drop the crates on the supplydock, make a listener script that detects if there are crates of type that the cargoplane dropped in the supplydock area and if so update the warehouse value...Ez
When you drop a nameless supply source on a unknown position you have a good challenge on your hand...:P

Cheers and have fun

*Edit* this solution is rather devious but i had to do it like this because i have used up the other special powers and stuff, map.ini for skirmish has it's limitations...
You can make this mechanism much quicker and easier by just using the cratedrop and modify the ocl which drops the crates...

Edited by user Tuesday, August 21, 2018 2:58:46 PM(UTC)  | Reason: Secret

File Attachment(s):
Panem et kirkinses
thanks 3 users thanked acidbrain for this useful post.
SkyMix_RMT on 8/21/2018(UTC), UTD^Force on 8/21/2018(UTC), Unknown Editor on 8/22/2018(UTC)
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.