Jump to content


Photo

Child Object explanation and assistance.


  • Please log in to reply
6 replies to this topic

#1 ZenBKage

ZenBKage

    Ini Coder/BFME2 Arcade Edition Creater

  • Hosted
  • 427 posts

Posted 10 April 2006 - 06:42 AM

i started a topic on wanting to make the balrog a normal unit you can build from another building. the building i was assigning to it is the Mordor Tavern (how an evil demon comes from there is beyond me:P).

i know i have to create a button in commandbutton for the balrog and also edit the line in the mordor tavern to build. below is the unit info which 2playergames has helped with me so far. ( this is to make the thread easier since the other one confuzzled me) hehe.

ChildObject MordorBalrog_thebalrog
BuildCost = 10000
BuildTime = 90.0
End

now, the name of the ini file for the balrog is called 'thebalrog'. is this the name the commandbutton and the commandset look for ie: the name u have to put into those 2 sections for it to work?
- Freedom is Choice -

#2 Sûlherokhh

Sûlherokhh

    Sagacious Engineer

  • Project Team
  • 3,754 posts
  • Location:Central Germany
  • Projects:S.E.E., Sage A.I., Code Advisor
  •  'Axe'er of the Gordic Knot

Posted 10 April 2006 - 08:11 AM

i started a topic on wanting to make the balrog a normal unit you can build from another building. the building i was assigning to it is the Mordor Tavern (how an evil demon comes from there is beyond me:P).

i know i have to create a button in commandbutton for the balrog and also edit the line in the mordor tavern to build. below is the unit info which 2playergames has helped with me so far. ( this is to make the thread easier since the other one confuzzled me) hehe.

ChildObject MordorBalrog_thebalrog
BuildCost = 10000
BuildTime = 90.0
End

now, the name of the ini file for the balrog is called 'thebalrog'. is this the name the commandbutton and the commandset look for ie: the name u have to put into those 2 sections for it to work?


To let it work, insert the object name of the unit being built. That is either the 'Object' or one of its 'ChildObject's, depending on what traits the unit should preferably have.

A 'ChildObject' is simply another object, that inherits all the traits of the 'Parent' object, and adds/replaces some more. Usually (as in the case of the elven fortress eagle/summoned eagle) the childobject simply gains an additional timer, so the unit disappeas later, or something like that.

So to build the Balrog, use the object name 'MordorBalrog', but you will have to remove the entry

Behavior = LifetimeUpdate ModuleTag_LifetimeUpdate
		MinLifetime		= BALROG_LIFETIME
		MaxLifetime		= BALROG_LIFETIME
		DeathType		= FADED
	End

or it will fade away after a while.

bannerreal01mittelit3.jpg
Axed Head and A.I. Coder for S.E.E. and ... stuff

".. coding is basically boring. What's fun is finding out how things work, take them apart and then put them together in ways that were not intended nor even conceived."


#3 ZenBKage

ZenBKage

    Ini Coder/BFME2 Arcade Edition Creater

  • Hosted
  • 427 posts

Posted 10 April 2006 - 08:27 AM

ok im kinda slow at this so bear with me. in commandbutton do i create this:

CommandButton Command_ConstructMordorBalrog
Command = UNIT_BUILD
Object = MordorBalrog
Options = CANCELABLE
TextLabel = CONTROLBAR:ConstructMordorMountainTroll
ButtonImage = BMTrollCages_MountainTroll
ButtonBorderType = BUILD
DescriptLabel = CONTROLBAR:ToolTipBuildMordorMountainTroll
Radial = Yes
InPalantir = Yes
ShowProductionCount = Yes
; UnitSpecificSound = GondorArcherVoiceBuy
End

and for the tavern to build it in commandset is it this:

CommandSet MordorTavernCommandSetLevel1
1 = Command_ConstructMordorCorsairsOfUmbarHorde
2 = Command_ConstructMordorBalrog
3 = Command_PurchaseTechnologyMordorHeavyArmor
4 = Command_PurchaseTechnologyMordorForgedBlades
5 = Command_PurchaseTechnologyMordorFireArrows
6 = Command_UpgradeMordorTavernLevel2
7 = Command_Sell
End

the ini file is called 'thebalrog' and placed in the zmymod folder.

this is an individual unit, NOT just being able to build the spawning balrog. im doing this as a test so i can use any unit to make buildable from any building if i wish. the balrog is just fun:) so yeah it has to be its own unit which im guessing is a Child Object.
- Freedom is Choice -

#4 Bart

Bart

  • Network Admins
  • 8,524 posts
  • Location:The Netherlands
  • Division:Revora
  • Job:Network Leader

Posted 10 April 2006 - 08:42 AM

CommandButton Command_ConstructMordorBalrog
Command = UNIT_BUILD
Object = MordorBalrog
Options = CANCELABLE
TextLabel = CONTROLBAR:ConstructMordorMountainTroll
ButtonImage = BMTrollCages_MountainTroll
ButtonBorderType = BUILD
DescriptLabel = CONTROLBAR:ToolTipBuildMordorMountainTroll
Radial = Yes
InPalantir = Yes
ShowProductionCount = Yes
; UnitSpecificSound = GondorArcherVoiceBuy
End


in that code you must use MordorBalrog_Buildable in the Object line, or it will build the balrog that disappears after a while
bartvh | Join me, make your signature small!
Einstein: "We can’t solve problems by using the same kind of thinking we used when we created them."

#5 ZenBKage

ZenBKage

    Ini Coder/BFME2 Arcade Edition Creater

  • Hosted
  • 427 posts

Posted 10 April 2006 - 09:01 AM

ok i still get an error. i'll post what ive changed on ur advice and see whats next to fix.

commandbutton:
CommandButton Command_ConstructMordorBalrog
Command = UNIT_BUILD
Object = MordorBalrog_Buildable
Options = CANCELABLE
TextLabel = CONTROLBAR:ConstructMordorMountainTroll
ButtonImage = BMTrollCages_MountainTroll
ButtonBorderType = BUILD
DescriptLabel = CONTROLBAR:ToolTipBuildMordorMountainTroll
Radial = Yes
InPalantir = Yes
ShowProductionCount = Yes
; UnitSpecificSound = GondorArcherVoiceBuy
End

commandset:
CommandSet MordorTavernCommandSetLevel1
1 = Command_ConstructMordorCorsairsOfUmbarHorde
2 = Command_ConstructMordorBalrog
3 = Command_PurchaseTechnologyMordorHeavyArmor
4 = Command_PurchaseTechnologyMordorForgedBlades
5 = Command_PurchaseTechnologyMordorFireArrows
6 = Command_UpgradeMordorTavernLevel2
7 = Command_Sell
End

and the error:
Posted Image
- Freedom is Choice -

#6 King of Universe

King of Universe

    It is in our most dire needs, that we do our greatest deeds...

  • Hosted
  • 878 posts
  • Location:Norway
  • Projects:Hero Mod

Posted 10 April 2006 - 10:11 AM

The object has to be correct. You called your ChildObject MordorBalrog_thebalrog but in the commandbutton, you're trying to get the game to build MordorBalrog_Buildable

Posted Image


Frodo: I wish the Ring had never come to me... I wish none of this had happened...
Gandalf: So do all who live to see such times, but that is not for them to decide. All you have to decide, is what to do with the time that is given to you...

Click me

#7 ZenBKage

ZenBKage

    Ini Coder/BFME2 Arcade Edition Creater

  • Hosted
  • 427 posts

Posted 10 April 2006 - 11:40 AM

as an update it worked. i made sure all the text was correct, a couple weren't and it worked:) thanks so much guys for helping me with this issue:) i very much appreciate it.
- Freedom is Choice -




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users