View Single Post
Old 05-31-2004, 05:28 PM   #1 (permalink)
EvilViking
Senior Member
 
Join Date: Jul 2003
Location: USA
Posts: 442
Send a message via MSN to EvilViking
Default PCTeen1's Unit Paradrop Tutorial Released!

Yes, after much nagging, I finally got it done! Please excuse any spelling errors, I'm still forced to use the family computer (which I own 80% of the parts!), so I had to work on it off & on today. If you don't know what it's for, it shows you how to make units paradrop in when built, like the Nod Airsrtip in Renegade. Here's a picture:

http://www.membres.lycos.fr/actofwar/dozerdrop.jpg

Get it here: http://www.planetcnc.com/actofwar/downloads.htm

If any of you want to mirror it, just let me know. Deezire, feel free to add it to the tutorial area. Oh, one last thing, right now, it's only hosted on Gamespy.

Have fun!

EDIT: The file is broken, so here ya go!

Paradropping a unit
By PCTeen1Team Leader of the Zero Hour TC "An Act of War"

[img]lhttp://www.planetcnc.com/actofwar/nbanner.gif[/imgl]

Please excuse any spelling errors!
This tutorial explains how to get units dropped in by paradrops, like the Nod Airstrip in C&C Renegade. For this tutorial, I will be using the “Dozer Drop”, featured in An Act of War.

http://www.membres.lycos.fr/actofwar/dozerdrop.jpg

Let’s get started. You will need the following INI files:

CommandButton.ini, Commandset.ini, ObjectCreationList.ini, SpecialPower.ini, Spawns.ini (included), Science.ini, whatever INI file the unit that transports your tank in is in. (AAOWUnits.ini in this case)


IMPORTANT: Download Spawns.ini here: http://www.membres.lycos.fr/actofwar/Spawns.ini

We start off in SpecialPower.ini. We need to create a superweapon that will bring in the drop, much like the US’s Crate Drop:
Quote:
;-----------------------------------------------------------------------------
SpecialPower SuperweaponDozerDrop
Enum = SPECIAL_CRATE_DROP
ReloadTime = 1 ; in milliseconds  This does not matter, but set it at 1 just to be sure
RequiredScience = SCIENCE_DozerDrop
PublicTimer = Yes
ViewObjectDuration = 30000
ViewObjectRange = 250
RadiusCursorRadius = 100
ShortcutPower = Yes ;Capable of being fired by the side-bar shortcut.
End
Now, we need the science for it. From Science.ini:

Quote:
Science SCIENCE_DozerDrop
PrerequisiteSciences = None
SciencePurchasePointCost = 0 ; note that this means "not purchasable", NOT "free"!
IsGrantable = Yes
DisplayName = SCIENCE:TempName
Description = SCIENCE:TempDescription
End
So, we’ve got our main superweapon, and it’s science. Now, we need to make the OCL that does most of the work! This is from ObjectCreationList.ini:

Quote:
; -----------------------------------------------------------------------------
ObjectCreationList SUPERWEAPON_DozerDrop
DeliverPayload
Transport = AmericaJetC5Galaxy  This is what drops your dozer.
StartAtPreferredHeight = Yes
StartAtMaxSpeed = Yes
MaxAttempts = 4  How many times the transport plane will try to drop your unit. I recommend 4-5, because every once in a while, you lose one to a circling transport.
DropOffset = X:0 Y:0 Z:-5
DropDelay = 1 ;500 ; time in between each item dropped (if more than one)
PutInContainer = LargeParachute  Because the unit needs a large parachute, after all, it’s a bulldozer!
Payload = AmericaVehicleDozer 1  What unit is being dropped off
DeliveryDistance = -45
DeliveryDecalRadius = 100
This is what you normally see for a superweapon. I’m trying to get it to go away, as it paints a red circle around the building that the unit is being built from:
DeliveryDecal
Texture = EXTargeterAlpha
Style = SHADOW_ALPHA_DECAL
OpacityMin = 25%
OpacityMax = 50%
OpacityThrobTime = 500
Color = R:255 G:0 B:0 A:255
OnlyVisibleToOwningPlayer = Yes
End
End
End
Now, we have to add the superweapon to the transport. This is from AAOWUnits.ini, you can add this tag to any aircraft belonging to the same side as the unit you’re dropping:

Quote:
;------------------------------------------------------------------------------
Object AmericaJetC5Galaxy

***Unit code taken out to save space***

Behavior = OCLSpecialPower ModuleTag_14  Make sure this number is unique in the unit’s code
SpecialPowerTemplate = SuperweaponDozerDrop  the superweapon we did first
OCL = SUPERWEAPON_DozerDrop  the OCL from ObjectCreationList.ini
CreateLocation = USE_OWNER_OBJECT
ScriptedSpecialPowerOnly = Yes  can only be called in by the CommandBar
End

Behavior = TransportContain ModuleTag_10
Slots = 100 ; hey, it's a BIG transport
ScatterNearbyOnExit = No
OrientLikeContainerOnExit = Yes
KeepContainerVelocityOnExit = Yes
ExitPitchRate = 30
ExitBone = WeaponA01
AllowInsideKindOf = INFANTRY VEHICLE PROJECTILE DOZER PARACHUTABLE  Make sure it can carry vehicles
;gs I added parachutable as a catch all to prevent making new kindofs (like CRATE)
DoorOpenTime = 0 ; this prevents the Contain module from messing with the doors, since we want DeliverPayload to handle 'em
NumberOfExitPaths = 0
DestroyRidersWhoAreNotFreeToExit = Yes ; 'destroy' as opposed to 'kill'
End
Now, here’s the tricky part. We need to create a unit, that when built, is invisible, and is immediately destroyed, spawning the paradrops. Also, remember to change the cost of this unit and the time it takes for it to build, as it’s this that you’re technically paying for, not the unit that is dropped!

This is from Spawns.ini, which was included:

Quote:
;--------------------------- Yes, this is the US Dozer spawner...--------

Object AmericaVehicleDozerSpawner

; *** ART Parameters ***

SelectPortrait = SACDozer_L  Be sure to put the unit that you want to build’s icon here, so it will show up properly on the command bar!
ButtonImage = SACDozer

Draw = W3DModelDraw ModuleTag_01  The unit has no model, so it’s invisible
DefaultConditionState
Model = None
End
End

; ***DESIGN parameters ***
DisplayName = MISSING
Side = America  Be sure to put the right side!
EditorSorting = VEHICLE
TransportSlotCount = 0 ;how many "slots" we take in a transport (0 == not transportable)

ArmorSet
Conditions = None
Armor = TankArmor
DamageFX = TankDamageFX
End
BuildCost = 1000  Put the cost of the unit you want to build here
BuildTime = 3.5 ;in seconds  Put less then you normally would here, as it has to travel from the side of the map too
VisionRange = 125
ShroudClearingRange = 300
Prerequisites
Object = AmericaCommandCenter Be sure to put the right prerequisite on here
End

; *** ENGINEERING Parameters ***
RadarPriority = STRUCTURE
KindOf = VEHICLE IMMOBILE
Body = ActiveBody ModuleTag_02  It’s invincible… or is it?
MaxHealth = 99999.0
InitialHealth = 99999.0
End
Behavior = LifetimeUpdate ModuleTag_03  This is very important, this time must be longer than the time in the OCL Update below!
MinLifetime = 15 ; min lifetime in msec
MaxLifetime = 15 ; max lifetime in msec
End

Behavior = OCLUpdate ModuleTag_04 ;  This spawns the OCL right before the unit dies
OCL = SUPERWEAPON_DozerDrop
MinDelay = 5
MaxDelay = 5
CreateAtEdge = Yes ;  The transport spawns at the edge of the map, instead of right on top of the building!
End

Geometry = BOX
GeometryMajorRadius = 1.0
GeometryMinorRadius = 1.0
GeometryHeight = 1.0
GeometryIsSmall = Yes

End
OK, all that’s left is to make the button that builds the dummy unit. CommandButten.ini:

Quote:
CommandButton Command_ConstructAmericaDozer
Command = UNIT_BUILD
Object = AmericaVehicleDozerSpawner
TextLabel = CONTROLBAR:ConstructAmericaDozer
ButtonImage = SACDozer
ButtonBorderType = BUILD ; Identifier for the User as to what kind of button this is
DescriptLabel = CONTROLBAR:ToolTipUSABuildDozer
End
As you can see, all I did was change what object is spawned to the dummy unit. The name and descriptions will remain the same, letting the player think he’s building the actual unit… tricky, eh?

If you’re doing a different unit, you must, of course, make a new command button entry, and then add it to CommandSet.ini. As for me, though, that’s it! Boot up the game & try it out.

Find any problems? Did I forget something? Was I completely wrong about something? Let me know! PCTeen1ATcncgames.every1.net

Know bugs:
1. Eva says “Unit Lost” every time you build the unit
2. There is a red circle around the building that is building the unit

If you can help with these, please email me!

Extra: Getting the AI to build your new unit

There is one problem with this, the AI will still try to build the actual dozer, not the dummy object! The solution is simple if you know how to edit the AI, simply open up the Teams and change the Dozer team to the dummy object instead of the actual dozers. Now, the AI will use it just fine!




Tutorial, code, and images © 2004 PCTeen1. Please, if you use this in a mod, give credit where credit is due! Thanks!
EvilViking is offline   Reply With Quote