Jump to content


Photo

How to make sauron the balrog and the wolf rebuildable?


  • Please log in to reply
9 replies to this topic

#1 vegetassj2345

vegetassj2345
  • Members
  • 201 posts

Posted 13 November 2012 - 03:22 PM

I made all of them buildable...but i can build them just once...how can i do to make them recreables like all the normal heroes?

#2 acidRain

acidRain

    insane programmer

  • Members
  • 79 posts
  • Location:the place that never but always was
  • Projects:personal mods
  •  coder, occasional skinner, and all-around game-breaker

Posted 13 November 2012 - 09:35 PM

1) They need to NOT have a "lifetime" (meaning, no timer for existence).
2) Their "respawn" section of code needs to be properly edited.
3) I did this once...and I don't remember exactly how. Since I'm not at my computer currently, I can't check it right now. I'll do it when I get home and get back to you with the specific code I used.
WWJBD - What Would Jack Bauer Do?

#3 vegetassj2345

vegetassj2345
  • Members
  • 201 posts

Posted 14 November 2012 - 12:05 PM

OK! Thank you for your answer! i will wait for your next reply so!

#4 Irenë Hawnetyne

Irenë Hawnetyne

    -

  • Hosted
  • 3,073 posts

Posted 14 November 2012 - 07:00 PM

Vegetass, you may wish to read others' topics and tutorials, namely those on T3A, which regard these types of things, and then experiment with your own code to see how it works. I'm not a coder, but even I've learnt a little that way.

"Everyone's a hero when there's nowhere left to run."

 

Auxiliary Skarn, 2333rd Cohort


#5 vegetassj2345

vegetassj2345
  • Members
  • 201 posts

Posted 15 November 2012 - 12:08 PM

Normally i searhc here and in google..but i couldnt find any topic related to my question....so i still wait for the answer of Acidrain. :) Thanks for your suggestion anyway.

Edited by vegetassj2345, 15 November 2012 - 12:08 PM.


#6 Gourbish

Gourbish
  • Members
  • 149 posts
  • Location:France

Posted 15 November 2012 - 05:21 PM

Have a look at Sauron.ini file and another hero file (for instance Saruman).

Saruman has these lines :
Body = RespawnBody ModuleTag_RespawnBody
  CheerRadius    = EMOTION_CHEER_RADIUS
  MaxHealth		  = SARUMAN_HEALTH  ;BALANCE Saruman Health
  PermanentlyKilledByFilter = NONE  ;Who kills me permanently?
	  DodgePercent	    = HERO_DODGE_PERCENT
	 BurningDeathBehavior = Yes
  BurningDeathFX   = FX_InfantryBurningFlame
  CheerRadius    = EMOTION_CHEER_RADIUS
End
Behavior = RespawnUpdate ModuleTag_RespawnUpdate
  DeathAnim    = DYING
  ;DeathAnim    = STUNNED   ;Model condition to play when killed-to-respawn
  DeathFX    = FX_SarumanDieToRespawn ;FXList to play when killed-to-respawn
  DeathAnimationTime  = 5500 ;1133   ;How long DeathAnim will take.
  InitialSpawnFX   = FX_SarumanInitialSpawn
  RespawnAnim    = LEVELED    ;Animation to play when respawning.
  RespawnFX    = FX_SarumanRespawn  ;FXList to play when respawning.
  RespawnAnimationTime  = 2000    ;Time it takes for respawn to play.
  AutoRespawnAtObjectFilter = NONE +CASTLE_KEEP  ;Respawn at this location -- and at it's exit production point if possible.
  ButtonImage    = HISaruman_res
 
  ;RespawnEntries determine the ruleset for how a character can be revived. Some units may automatically respawn, others
  ;may require a specific revive action performed on him. You can specify different values for each level... or use Level:Any
  RespawnRules =   AutoSpawn:No Cost:2250  Time:90000  Health:100%  ;DEFAULT VALUES
End

Sauron has these lines :
Body = ActiveBody ModuleTag_Body
  MaxHealth = SAURON_HEALTH
End

So, Sauron has an ActiveBody which means he has a life and will not respawn.
Saruman has a RespawnBody and a RespawnUpdate which mean that he could respawn.

Finally, you just have to substitute the ActiveBody of Sauron with a RespawnBody and a RespawnUpdate. You'll see that in the RespawnUpdate you'll find the time and cost to rebuild the hero, and the button image used in the fortress.

I think it's all you have to do if I'd forget nothing... :-p

#7 acidRain

acidRain

    insane programmer

  • Members
  • 79 posts
  • Location:the place that never but always was
  • Projects:personal mods
  •  coder, occasional skinner, and all-around game-breaker

Posted 16 November 2012 - 11:30 PM

Gourbish beat me to it. That's exactly what you need. BUT, if you're going to make Sauron respawn, you'd better make sure he doesn't drop the "One Ring" object every time he does.

On second thought, that'd be very interesting to see if you could build multiple ring heroes on a map by killing multiple Saurons and taking the rings they drop...
WWJBD - What Would Jack Bauer Do?

#8 Gourbish

Gourbish
  • Members
  • 149 posts
  • Location:France

Posted 16 November 2012 - 11:52 PM

Gourbish beat me to it.

:p

About the "One Ring" like you say, there will be no problem as there are the object "MordorSauron" plus his childobject "MordorSauron_RingHero" (only this one will spawn the ring on his death).

So using MordorSauron will solve that. But it's true that it would be interesting to try to have more than only one ring to see what the game will do...

#9 vegetassj2345

vegetassj2345
  • Members
  • 201 posts

Posted 21 November 2012 - 06:10 PM

i replace te body string and the behaviour string of the balrog ...(actually...it had more than 1 behaviour......but i replaced just one) with body= RespawnBodyModuleTag_RespawnBody


and behaviour = RespawnUpdateModuleTag_RespawnUpdate just this i didnt touched any other paramenter....but the Balrog doesn't respawn...should i add other things? (for example should i replace all the 3 behaviour of the balrgo with RespawnUpdate etc) i want a simple respawn without sound or any other thing...i want to see again the icon of the balrgo in my fortress after he died...and of course (above all) i want to see the ai rebuild the barlog.

Edited by vegetassj2345, 21 November 2012 - 06:10 PM.


#10 Gourbish

Gourbish
  • Members
  • 149 posts
  • Location:France

Posted 21 November 2012 - 09:09 PM

I looked at the code for the Balrog. To be sure, we agree that you have LOTR-TROTWK addon ?

So in "neutralunits.ini" there is the MordorBalrog' definitions.
1) He has an ActiveBody that you have to remove or comment.
2) Give him a RespawnBody.
3) Give him a RespawnUpdate. It is the RespawnUpdate which determines the sounds or FX played when you will respawn him.
4) Don't remove any other Behavior.

I think that it sould be working. We agree that you already added it as hero for a side.

a) About the side, are they already many heroes in the side the Balrog is ? Because the number of button showed for the heroes in the fortress is limited. Don't remember exactly the number but for example : if you have 10 heroes, the game will only show the first eight. And when you will build one of them, another will appear to be built. So if you first built hero die, he will not be showed because there are already 8 heroes. So you'll need to build 2 more heroes to see the respawn button.

b) Another thing, don't know if it could be important, but you can remove/comment the key "SUMMONED" which is put at the end of le line "KindOf".

c) About the AI we will speak on how to do that after you'll be able to correctly create and respawn him because you'll need to do other things. ;)

d) Is it working well for Sauron and the Wolf (which is like the Balrog, so he will have the same problems/solutions) ?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users