Jump to content


Photo

Adding Royal guard to gimli


  • Please log in to reply
17 replies to this topic

#1 Ap0C552

Ap0C552
  • Members
  • 84 posts

Posted 15 December 2009 - 12:18 AM

Here is my problem of the day. :p

I am trying to add Royal guard power to Gimli. All I am getting is a inactive button.

I know the object DwarvenGimli is correct as opposed to RohanGimli

CommandSet NewDwarvenGimliCommandSet
	1	= Command_ToggleStance
	2	= Command_SpecialAbilityGimliLeadership;;
	3	  = Command_GimliAxeThrow
	4	  = Command_RohanGimliLeap
	5	  = Command_SpecialAbilitySlayer
	6	  = Command_SpecialAbilityDainSummonRoyalGuard
	12	 = Command_CaptureBuilding
	13	 = Command_AttackMove
	14	 = Command_Stop
End
		   


Object DwarvenGimli

CommandSet = NewDwarvenGimliCommandSet


AddModule

Behavior = UnpauseSpecialPowerUpgrade ModuleTag_DainSummonEnabler
		SpecialPowerTemplate = SpecialAbilityDainSummonRoyalGuard
				TriggeredBy = Upgrade_DainRoyalGuard

		
	End

	Behavior = OCLSpecialPower ModuleTag_OCLSpecialPower
		SpecialPowerTemplate	= SpecialAbilityDainSummonRoyalGuard
		OCL						= OCL_SpawnDwarvenEgg
		CreateLocation			= CREATE_AT_LOCATION
		StartsPaused			= Yes
	;SetModelCondition		= ModelConditionState:USER_1
	;SetModelConditionTime	= 8.1
	End
	
	
	Behavior = AISpecialPowerUpdate RoyalGuardAI
		CommandButtonName = Command_SpecialAbilityDainSummonRoyalGuard
		SpecialPowerAIType = AI_SPECIAL_POWER_TARGETAOE_SUMMON
		SpecialPowerRadius = 30.0
	End



End

End




ExperienceLevel	GimliLevel10
	TargetNames						=	RohanGimli DwarvenGimli
	RequiredExperience				=	GIMLI_LVL10_EXP_NEEDED  
	ExperienceAward					=	GIMLI_LVL10_EXP_AWARD	
	  AttributeModifiers				=	HeroLevelUpDamage9
	Rank							=	10
	LevelUpFx						=	FX:GandalfLevelUp1FX
   ;LevelUpOCL						=	OCL_GandalfLevelUp1OCL
	Upgrades						=	Upgrade_DainRoyalGuard
	SelectionDecal
		Texture						=	decal_hero_good

		Style						=	SHADOW_ALPHA_DECAL
		OpacityMin					=	50%	
		OpacityMax					=	100%
		MinRadius					=	40;16
		MaxRadius					=	200;16
		MaxSelectedUnits			=	40;1
	End	
   
End


#2 Crusard

Crusard

    Local n00b

  • Project Team
  • 483 posts
  • Location:Buenos Aires, Argentina
  • Projects:Crusard's Tower Defense
  •  Poor feedback kills mapper.

Posted 15 December 2009 - 01:10 AM

The order of things is very important in map.ini :o
You need to set ExperienceLevels before you place their respective objects (Place the ExperienceLevels before the Object DwarvenGimli)

Also, AddModule should be used separatedly for every behaviour:
Object DwarvenGimli
 
 CommandSet = NewDwarvenGimliCommandSet
 
 AddModule
 Behavior = UnpauseSpecialPowerUpgrade ModuleTag_DainSummonEnabler
		 SpecialPowerTemplate = SpecialAbilityDainSummonRoyalGuard
				 TriggeredBy = Upgrade_DainRoyalGuard
	 End
 End

AddModule
	 Behavior = OCLSpecialPower ModuleTag_OCLSpecialPower
		 SpecialPowerTemplate	= SpecialAbilityDainSummonRoyalGuard
		 OCL						= OCL_SpawnDwarvenEgg
		 CreateLocation			= CREATE_AT_LOCATION
		 StartsPaused			= Yes
	 End
 END	

AddModule
	 Behavior = AISpecialPowerUpdate RoyalGuardAI
		 CommandButtonName = Command_SpecialAbilityDainSummonRoyalGuard
		 SpecialPowerAIType = AI_SPECIAL_POWER_TARGETAOE_SUMMON
		 SpecialPowerRadius = 30.0
	 End
 End
 
 End; Ends Gimli Object

Posted Image


#3 Ap0C552

Ap0C552
  • Members
  • 84 posts

Posted 15 December 2009 - 01:21 AM

Thanks for the help. I never knew order mattered.

Unfortunately it is still not working. It is looking like this now.

CommandSet NewDwarvenGimliCommandSet
	1	= Command_ToggleStance
	2	= Command_SpecialAbilityGimliLeadership;;
	3	  = Command_GimliAxeThrow
	4	  = Command_RohanGimliLeap
	5	  = Command_SpecialAbilitySlayer
	6	  = Command_SpecialAbilityDainSummonRoyalGuard
	12	 = Command_CaptureBuilding
	13	 = Command_AttackMove
	14	 = Command_Stop
End
		   

ExperienceLevel	GimliLevel10
	TargetNames						=	RohanGimli DwarvenGimli
	RequiredExperience				=	GIMLI_LVL10_EXP_NEEDED  
	ExperienceAward					=	GIMLI_LVL10_EXP_AWARD	
	  AttributeModifiers				=	HeroLevelUpDamage9
	Rank							=	10
	LevelUpFx						=	FX:GandalfLevelUp1FX
   ;LevelUpOCL						=	OCL_GandalfLevelUp1OCL
	Upgrades						=	Upgrade_DainRoyalGuard
	SelectionDecal
		Texture						=	decal_hero_good

		Style						=	SHADOW_ALPHA_DECAL
		OpacityMin					=	50%	
		OpacityMax					=	100%
		MinRadius					=	40;16
		MaxRadius					=	200;16
		MaxSelectedUnits			=	40;1
	End	
   
End


Object DwarvenGimli

CommandSet = NewDwarvenGimliCommandSet

AddModule
Behavior = UnpauseSpecialPowerUpgrade ModuleTag_DainSummonEnabler
		 SpecialPowerTemplate = SpecialAbilityDainSummonRoyalGuard
				 TriggeredBy = Upgrade_DainRoyalGuard
	 End
End

AddModule
	 Behavior = OCLSpecialPower ModuleTag_OCLSpecialPower
		 SpecialPowerTemplate	= SpecialAbilityDainSummonRoyalGuard
		 OCL						= OCL_SpawnDwarvenEgg
		 CreateLocation			= CREATE_AT_LOCATION
		 StartsPaused			= Yes
	 End
END	

AddModule
	 Behavior = AISpecialPowerUpdate RoyalGuardAI
		 CommandButtonName = Command_SpecialAbilityDainSummonRoyalGuard
		 SpecialPowerAIType = AI_SPECIAL_POWER_TARGETAOE_SUMMON
		 SpecialPowerRadius = 30.0
	 End
End

End


#4 Crusard

Crusard

    Local n00b

  • Project Team
  • 483 posts
  • Location:Buenos Aires, Argentina
  • Projects:Crusard's Tower Defense
  •  Poor feedback kills mapper.

Posted 15 December 2009 - 04:40 AM

Ugh, I think I know what the problem is.
Right now your gimli just isn't getting the Upgrade_DainRoyalGuard because ExperienceLevels with more than one targetname (in this case RohanGimli and DwarvenGimli)seem to be bugged in map.ini.

It happened to me before, when I was trying to change the experiencelevel of a firedrake (has targetnames for fortress firedrake, summoned firedrake, etc).

Workaround: Even though map.ini can be tricky, you can always fall back on scripting :p
Make a script that, once gimli is Lv10, he gets the upgrade Upgrade_DainRoyalGuard.


Posted Image


#5 Ap0C552

Ap0C552
  • Members
  • 84 posts

Posted 15 December 2009 - 05:03 AM

Ok that worked. Would have never thought of that.

Thanks again :p

#6 Ap0C552

Ap0C552
  • Members
  • 84 posts

Posted 16 December 2009 - 01:20 AM

I am going to tack on a related question.

I want to add a similar power to legolas but with ents.


I was wondering if it would be possible to just add the command_specialpowerentallies to Legolas command set, and then through scripts set power entallies to enabled when lego reaches rank 10.

It never worked for me when I did something like this, along with setting power to available with scripts. The button simply did not show up. Will special power buttons never show up in a unti commandset? Will I just have to create a whole new special power using royal guard as a template?

CommandSet NewLegolasCommandSet

 1	= Command_ToggleStance
	2	  = Command_LegolasHawkStrike
	3	  = Command_SpecialAbilityTrainArchers;;
	4	  = Command_LegolasKnifeFightingMode;;
	5	  = Command_SpecialAbilityArrowStorm
	6	  = Command_SpellBookEntAllies
	12	 = Command_CaptureBuilding
	13	 = Command_AttackMove
	14	 = Command_Stop
End


Object ElvenLegolas

CommandSet = NewLegolasCommandSet

End

Edited by Ap0C552, 16 December 2009 - 01:23 AM.


#7 Ap0C552

Ap0C552
  • Members
  • 84 posts

Posted 16 December 2009 - 08:26 PM

Ok so I still can not figure out a good way to get Legolas to spawn ents.

My biggest problem, first and foremost is that I can not get anything to show up in Legolas commandset. I could get other powers, such as GimliSlayer to show up in Legolas commandset, but not the ent power.

I tried two routes.

One to just put the entallies spellbook power commandbutton in Lego's commandset, and then set power available through scripts as so...

CommandButton Command_SpellBookEntAllies
	Command				= SPECIAL_POWER
	SpecialPower		= SpellBookEntAllies
	ButtonImage			= SBGood_EntAllies
	Options				= NEED_TARGET_POS CONTEXTMODE_COMMAND
	TextLabel			= CONTROLBAR:SummonEntAllies
	ButtonBorderType	= ACTION
	DescriptLabel		= CONTROLBAR:TooltipSummonEntAllies
	RadiusCursorType	= EntAlliesRadiusCursor
	CursorName		  = AttackObj
	InvalidCursorName   = GenericInvalid
	InPalantir = Yes
End

CommandSet NewLegolasCommandSet

 1	= Command_ToggleStance
	2	  = Command_LegolasHawkStrike
	3	  = Command_SpecialAbilityTrainArchers;;
	4	  = Command_LegolasKnifeFightingMode;;
	5	  = Command_SpecialAbilityArrowStorm
	6	  = Command_SpellBookEntAllies
	12	 = Command_CaptureBuilding
	13	 = Command_AttackMove
	14	 = Command_Stop
End

Object RohanLegolas;tried with both object rohan and elven legolas

CommandSet = NewLegolasCommandSet

End


Then I tried creating my own ent special power as so....


ExperienceLevel	LegolasLevel10
	TargetNames						=	RohanLegolas ElvenLegolas
	RequiredExperience				=	LEGOLAS_LVL10_EXP_NEEDED  
	ExperienceAward					=	LEGOLAS_LVL10_EXP_AWARD	
	  AttributeModifiers				=	HeroLevelUpDamage9
	Rank							=	10
	LevelUpFx						=	FX:GandalfLevelUp1FX
	Upgrades						=	Upgrade_LegolasArrowWind Upgrade_LegoEnt
   ;LevelUpOCL						=	OCL_GandalfLevelUp1OCL
	SelectionDecal
		Texture						=	decal_hero_good
		Style						=	SHADOW_ALPHA_DECAL
		OpacityMin					=	50%	

		OpacityMax					=	100%
		MinRadius					=	40;16
		MaxRadius					=	200;16
		MaxSelectedUnits			=	40;1
	End	
END	

CommandButton Command_SpecialAbilityLegoEnt
Command = SPECIAL_POWER
SpecialPower = SpecialAbilityLegoEnt
TextLabel = CONTROLBAR:SummonBalrog
ButtonImage = HSBalrogScream
Options = NEED_TARGET_POS CONTEXTMODE_COMMAND
RadiusCursorType = SummonOathBreakersRadiusCursor
CursorName = Bombard
InvalidCursorName = GenericInvalid
ButtonBorderType = ACTION
DescriptLabel = CONTROLBAR:TooltipSummonBalrog
InPalantir	 = Yes
End


Upgrade Upgrade_LegoEnt
Type				= OBJECT
End


CommandSet NewLegolasCommandSet

 1	= Command_ToggleStance
	2	  = Command_LegolasHawkStrike
	3	  = Command_SpecialAbilityTrainArchers;;
	4	  = Command_LegolasKnifeFightingMode;;
	5	  = Command_SpecialAbilityArrowStorm
	6	  = Command_SpecialAbilityLegoEnt
	12	 = Command_CaptureBuilding
	13	 = Command_AttackMove
	14	 = Command_Stop
End

SpecialPower SpecialAbilityLegoEnt
	Enum							= SPECIAL_SPELL_BOOK_BALROG_ALLY
	ReloadTime						= 180000	;	in milliseconds
	RadiusCursorRadius				= 100.0
	InitiateAtLocationSound			= DainSummonRoyalGuardMS
	Flags							= NO_FORBIDDEN_OBJECTS LIMIT_DISTANCE
	ForbiddenObjectFilter			= NO_SUMMON_NEAR_OBJECT_FILTER
	ForbiddenObjectRange			= 100
	MaxCastRange					= 150
End

Object RohanLegolas


AddModule
Behavior = UnpauseSpecialPowerUpgrade ModuleTag_DainSummonEnabler
		 SpecialPowerTemplate = SpecialAbilityLegoEnt
				 TriggeredBy = Upgrade_LegoEnt
	 End
End

AddModule
	 Behavior = OCLSpecialPower ModuleTag_OCLSpecialPower
		 SpecialPowerTemplate	= SpecialAbilityLegoEnt
		 OCL						= OCL_SpawnEnt
		 CreateLocation			= CREATE_AT_LOCATION
		 StartsPaused			= Yes
	 End
END	

AddModule
	 Behavior = AISpecialPowerUpdate RoyalGuardAI
		 CommandButtonName = Command_SpecialAbilityDainSummonRoyalGuard
		 SpecialPowerAIType = AI_SPECIAL_POWER_TARGETAOE_SUMMON
		 SpecialPowerRadius = 30.0
	 End
End

End





ObjectCreationList OCL_SpawnEnt
	CreateObject
		ObjectNames = RohanGenericEnt
		IgnoreCommandPointLimit = Yes
		Disposition = LIKE_EXISTING
	End
End



The problem is that in both cases, the button does not show up.

#8 Crusard

Crusard

    Local n00b

  • Project Team
  • 483 posts
  • Location:Buenos Aires, Argentina
  • Projects:Crusard's Tower Defense
  •  Poor feedback kills mapper.

Posted 16 December 2009 - 11:05 PM

It won't show up in the palantir (round thing that has all the commandbuttons) because the original command is for a Spellbook Power:

Default commandbutton:
CommandButton Command_SpellBookEntAllies
 Command				= SPELL_BOOK
 SpecialPower		= SpellBookEntAllies
 ButtonImage			= SBGood_EntAllies
 Options				= NEED_TARGET_POS; Huh, you can't have this flag and a radius cursor: CONTEXTMODE_COMMAND
 TextLabel			= CONTROLBAR:SummonEntAllies
 ButtonBorderType	= ACTION
 DescriptLabel		= CONTROLBAR:TooltipSummonEntAllies
 RadiusCursorType	= EntAlliesRadiusCursor
 CursorName		  = AttackObj
 InvalidCursorName   = GenericInvalid
End

You'll need to add:
InPalantir			= Yes
... to that commandbutton ^_^

Edited by Crusard, 16 December 2009 - 11:06 PM.

Posted Image


#9 Ap0C552

Ap0C552
  • Members
  • 84 posts

Posted 16 December 2009 - 11:19 PM

I already did that with no results unfortunately.

CommandButton Command_SpellBookEntAllies
	Command				= SPECIAL_POWER; tried SPELL_BOOK here as well
	SpecialPower		= SpellBookEntAllies
	ButtonImage			= SBGood_EntAllies
	Options				= NEED_TARGET_POS CONTEXTMODE_COMMAND
	TextLabel			= CONTROLBAR:SummonEntAllies
	ButtonBorderType	= ACTION
	DescriptLabel		= CONTROLBAR:TooltipSummonEntAllies
	RadiusCursorType	= EntAlliesRadiusCursor
	CursorName		  = AttackObj
	InvalidCursorName   = GenericInvalid
	InPalantir = Yes
End

Edited by Ap0C552, 16 December 2009 - 11:24 PM.


#10 Crusard

Crusard

    Local n00b

  • Project Team
  • 483 posts
  • Location:Buenos Aires, Argentina
  • Projects:Crusard's Tower Defense
  •  Poor feedback kills mapper.

Posted 17 December 2009 - 04:47 AM

CommandButton Command_SpecialAbilityLegoEnt

Um... I have another map.ini limitation for you (I hope the mod coders don't read this topic or I'll be ashamed :p)
You can't create your own commandbuttons, you are restricted to using the ones that already exist, otherwise they will not have any image (just a black space). They are still useable though, just "invisible".

You can use the default commandbutton with changed settings (Command_SpellBookEntAllies, the one you posted above) but this way you make it unavailable to use as a spellbook power :S

Edited by Crusard, 17 December 2009 - 04:54 AM.

Posted Image


#11 Ap0C552

Ap0C552
  • Members
  • 84 posts

Posted 18 December 2009 - 01:19 AM

Spellbook is disabled in this map anyways, so no worries there.

I can still not get the default entallies commandbutton to show up. Any thoughts?

#12 Crusard

Crusard

    Local n00b

  • Project Team
  • 483 posts
  • Location:Buenos Aires, Argentina
  • Projects:Crusard's Tower Defense
  •  Poor feedback kills mapper.

Posted 18 December 2009 - 02:13 AM

1) By any chance are you using ElvenLegolas (not RohanLegolas) on your map?

if not...

2) Did you forget to add CommandSet = NewLegolasCommandSet to your legolas object?

if still not working...

3) Check the order of things. The game reads from top to bottom. If something from above (example: a commandset) sees a commandbutton that is not defined until later, it will ignore it. This goes for everything that is defined.

Posted Image


#13 Ap0C552

Ap0C552
  • Members
  • 84 posts

Posted 18 December 2009 - 02:40 AM

I have tried from the ground up with both Rohan and Elven legolas and all kinds of combinations.

I have tried different orders, but I will go do an extra check.

#14 Crusard

Crusard

    Local n00b

  • Project Team
  • 483 posts
  • Location:Buenos Aires, Argentina
  • Projects:Crusard's Tower Defense
  •  Poor feedback kills mapper.

Posted 18 December 2009 - 02:43 AM

I made a small test map to get your code working (and it does)
The only difference is the change of order (so all things are read properly) and I used the Arrow wind upgrade (which is given on level 10 to default legolas). There was no need to create a new upgrade.

SpecialPower SpecialAbilityLegoEnt
	Enum							= SPECIAL_SPELL_BOOK_BALROG_ALLY
	ReloadTime						= 180000   ;	in milliseconds
	RadiusCursorRadius				= 100.0
	InitiateAtLocationSound			= DainSummonRoyalGuardMS
	Flags							= NO_FORBIDDEN_OBJECTS LIMIT_DISTANCE
	ForbiddenObjectFilter			= NO_SUMMON_NEAR_OBJECT_FILTER
	ForbiddenObjectRange			= 100
	MaxCastRange					= 150
End



CommandButton Command_SpellBookEntAllies
	Command				= SPECIAL_POWER; tried SPELL_BOOK here as well
	SpecialPower		= SpecialAbilityLegoEnt
	ButtonImage			= SBGood_EntAllies
	Options				= NEED_TARGET_POS CONTEXTMODE_COMMAND
	TextLabel			= CONTROLBAR:SummonEntAllies
	ButtonBorderType	= ACTION
	DescriptLabel		= CONTROLBAR:TooltipSummonEntAllies
	RadiusCursorType	= EntAlliesRadiusCursor
	CursorName		  = AttackObj
	InvalidCursorName   = GenericInvalid
	InPalantir = Yes
End



CommandSet NewLegolasCommandSet

1	= Command_ToggleStance
	2	  = Command_LegolasHawkStrike
	3	  = Command_SpecialAbilityTrainArchers;;
	6	  = Command_LegolasKnifeFightingMode;;
	5	  = Command_SpecialAbilityArrowStorm
	4	  = Command_SpellBookEntAllies
	12	 = Command_CaptureBuilding
	13	 = Command_AttackMove
	14	 = Command_Stop
End


ExperienceLevel	LegolasLevel10
	TargetNames						=	RohanLegolas ElvenLegolas
	RequiredExperience				=	LEGOLAS_LVL10_EXP_NEEDED  
	ExperienceAward					=	LEGOLAS_LVL10_EXP_AWARD	
	  AttributeModifiers				=	HeroLevelUpDamage9
	Rank							=	10
	LevelUpFx						=	FX:GandalfLevelUp1FX
	Upgrades						=	Upgrade_LegolasArrowWind Upgrade_LegoEnt
  ;LevelUpOCL						=	OCL_GandalfLevelUp1OCL
	SelectionDecal
		Texture						=	decal_hero_good
		Style						=	SHADOW_ALPHA_DECAL
		OpacityMin					=	50%	

		OpacityMax					=	100%
		MinRadius					=	40;16
		MaxRadius					=	200;16
		MaxSelectedUnits			=	40;1
	End	
END   


Object ElvenLegolas

CommandSet = NewLegolasCommandSet

AddModule
Behavior = UnpauseSpecialPowerUpgrade ModuleTag_DainSummonEnabler
		 SpecialPowerTemplate = SpecialAbilityLegoEnt
				 TriggeredBy = Upgrade_LegolasArrowWind; Upgrade_LegoEnt
	 End
End

AddModule
	 Behavior = OCLSpecialPower ModuleTag_OCLSpecialPower
		 SpecialPowerTemplate	= SpecialAbilityLegoEnt
		 OCL						= OCL_SpawnEnt
		 CreateLocation			= CREATE_AT_LOCATION
		 StartsPaused			= Yes
	 End
END	

AddModule
	 Behavior = AISpecialPowerUpdate RoyalGuardAI
		 CommandButtonName = Command_SpecialAbilityDainSummonRoyalGuard
		 SpecialPowerAIType = AI_SPECIAL_POWER_TARGETAOE_SUMMON
		 SpecialPowerRadius = 30.0
	 End
End

End





ObjectCreationList OCL_SpawnEnt
	CreateObject
		ObjectNames = RohanGenericEnt
		IgnoreCommandPointLimit = Yes
		Disposition = LIKE_EXISTING
	End
End

Posted Image


#15 Ap0C552

Ap0C552
  • Members
  • 84 posts

Posted 18 December 2009 - 03:25 AM

Thanks for the help. I guess it was the order I had it in. I could have sworn I tried that order. Oh well.

It seems that it is limited to one ent, even changing the code to

ObjectCreationList OCL_SpawnEnt
	CreateObject
		ObjectNames = RohanEntFir RohanEntBirch
		IgnoreCommandPointLimit = Yes
		Disposition = LIKE_EXISTING
	End
End


#16 Crusard

Crusard

    Local n00b

  • Project Team
  • 483 posts
  • Location:Buenos Aires, Argentina
  • Projects:Crusard's Tower Defense
  •  Poor feedback kills mapper.

Posted 18 December 2009 - 06:06 AM

You mean as in number of ents summoned, or randomly change the model of the ent (fir, birch, etc)?

Posted Image


#17 Ap0C552

Ap0C552
  • Members
  • 84 posts

Posted 18 December 2009 - 06:14 AM

oh ya that was kinda ambiguous.

I mean more than one ent in quantity.

#18 Crusard

Crusard

    Local n00b

  • Project Team
  • 483 posts
  • Location:Buenos Aires, Argentina
  • Projects:Crusard's Tower Defense
  •  Poor feedback kills mapper.

Posted 18 December 2009 - 05:16 PM

This is the original summon ents OCL (summons 3 of them > Count = 3):
ObjectCreationList OCL_SpawnEnts
	CreateObject
		ObjectNames = RohanEntFir_Summoned RohanEntBirch_Summoned
		Count = 3
		FadeIn = Yes
		FadeTime = 8000
		IgnoreCommandPointLimit = Yes
		Disposition = SPAWN_AROUND
		DispositionAngle = 120;SpawnAround uses this as the arc between guys
		DispositionIntensity = 200; and this for distance from center
		UseJustBuiltFlag = Yes
		JustBuiltDuration	= 8000  ; make these units wait it while it's playing its buildup
		StartingBusyTime = 5000
	End
End

Always check ini.big for any examples you need :p

Posted Image





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users