Jump to content


Photo

Adding revivables heroes in custom maps RotWK

revive revivables heroes custom maps rotwk

  • Please log in to reply
8 replies to this topic

#1 DrHouse93

DrHouse93
  • Members
  • 18 posts
  • Location:Rome
  • Projects:RotWK Maps (Both Edain and 2.02 versions)

Posted 10 February 2015 - 03:55 PM

Hi all^^

 

Sorry for the post-spam during these days, but I've almost finished my first scripted map and there are just a few things still to be fixed. This time my question is this (maybe a stupid one):

 

How can I add on my map predefined heroes, that player can revive if they die? I tried spawning a delayed-carryover unit, but that doesn't worked. And making him spawn like an ordinary unit didn't worked as well: I was able to use him, but once built the faction buildings, I could've recruit him AGAIN from level 1 (and when the starting hero dies he disappears, rather than being added to the revivables heroes)

 

P.S. I've also made a script to add that hero to the list of revivables, but it didn't work anyway



#2 Irenë Hawnetyne

Irenë Hawnetyne

    -

  • Hosted
  • 3,073 posts

Posted 10 February 2015 - 10:37 PM

Been a while since I've done anything like this, but if I remember correctly I'm pretty sure adding revivable slots for heroes in the fortress CommandSets would be at least a start.

Short of that, perhaps look at what RotWK's campaign maps use to spawn the Witch-king.


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

 

Auxiliary Skarn, 2333rd Cohort


#3 DrHouse93

DrHouse93
  • Members
  • 18 posts
  • Location:Rome
  • Projects:RotWK Maps (Both Edain and 2.02 versions)

Posted 12 February 2015 - 01:39 AM

Ok, I've successfully managed to make my dear Faramir to spawn into my Ithilien map, looking at the scripts for the Angmar Mission and altering them. However, regarding the scripts in the map.ini, that is harder, since I looked into various types of scripts and from what I saw, there are a lot of revivables options (FakeHeroReviveSlot1,2,3 or GenericReviveSlot1,2,3, each displayed in different orders which, from what I realized, defines the type of hero that can be recruited/revived). The problem is that the Faramir I'm using is a map feature, and not the standard one, so even if I put the right order of ReviveSlots, the game always makes me create standard Faramir. So can anyone explain to me the ReviveSlots mess? I mean, why are they so freaking complicated?



#4 -SilverBane-

-SilverBane-

    Inactive Noob

  • Project Team
  • 474 posts
  • Location:Bucharest
  • Projects:Life
  •  Mapper & Coder

Posted 13 February 2015 - 06:14 PM

u need this from playertemplate ini

 

 

BuildableHeroesMP            = CreateAHero GondorBoromir RohanTheoden RohanEowyn GondorFaramir RohanEomer GondorAragornMP GondorGandalf ; ;

 

and add there any other hero (and/or replace existing ones, or remove them) , it will do


2qm3dd5.jpg


#5 DrHouse93

DrHouse93
  • Members
  • 18 posts
  • Location:Rome
  • Projects:RotWK Maps (Both Edain and 2.02 versions)

Posted 14 February 2015 - 02:10 AM

Ok, thank you all for your help, but I still have some issues...So, this is what I did:

 

- Put a custom Faramir in the map (it's "GondorFaramir_forFaramirMap")
- Created a script in the worldbuilder (after having looked into the ones of the Grey Havens Evil Mission and Angmar Mission), stating this:

*** IF ***
Is there a delayed-carryover unit of type "GondorFaramir_forFaramirMap" still waiting to spawn
*** THEN ***
Find the first delayed-carryover unit of type "GondorFaramir_forFaramirMap" belonging to "PlyrCivilian" and reference it as "Faramir"
*** ELSE ***
Spawn unit "Faramir" of type "GondorFaramir_forFaramirMap" on Team "PlyrCivilian/Player_3_Inherit" at type "GondorFaramir_forFaramirMap"

Then, I edited the map.ini file, as you suggested, into this:

PlayerTemplate FactionMen

  BuildableHeroesMP = CreateAHeroDummy GondorBeregond GondorFaramir_forFaramirMap GondorBoromir_mod GondorGandalf_mod GondorImrahil GasthausPalando GasthausAlatar GondorAragorn_mod RohanPippin_mod ;;;GondorAragornEntwicklung1

End

CommandSet GondorForbiddenPoolForGoodIthilienNEW
    1	 = Command_FakeRingHeroReviveSlot
    2    = Command_FakeCreateAHeroReviveSlot
    3    = Command_FakeHeroReviveSlot1
    4    = Command_GenericReviveSlot2
    5    = Command_FakeHeroReviveSlot3
    6    = Command_FakeHeroReviveSlot4
    7    = Command_FakeHeroReviveSlot5
    8    = Command_FakeHeroReviveSlot6
    9    = Command_FakeHeroReviveSlot7
    10   = Command_FakeHeroReviveSlot8
    11   = Command_FakeHeroReviveSlot9

    12	 = Command_ConstructIthilienSchwertkämpferHorde_forFaramirMap
    13   = Command_ConstructGondorRangerHorde_forFaramirMap
    14   = Command_ConstructIthilienSpeerträgerHorde_forFaramirMap
    15   = Command_PurchaseTechnologyGondorForgedBlades_forFaramirMap
    16   = Command_PurchaseTechnologyGondorFireArrows_forFaramirMap
    17   = Command_PurchaseTechnologyGondorBasicTraining
End

And this is what I got:

 

I start the mission with the Custom Faramir. However, at the same time, another version of him is recruitable at the Forbidden Pool, while the other one is still alive. Once died, they're also both revivables, but just one of them at a time. What the hell did I got wrong, this time? This thing is driving me crazy



#6 Echo

Echo

    T3A:Online

  • T3A Staff
  • 1,069 posts
  • Location:Germany
  • Projects:Lot3A
  •  ~~
  • Division:BFME
  • Job:T3A Moderator
  • Donated

Posted 14 February 2015 - 04:08 AM

Mhmm... just a guess, edit the respawn template for the new Faramir unit per code, so it says.

    Behavior = RespawnUpdate ModuleTag_RespawnUpdate
        DeathAnim                = DYING                ;Model condition to play when killed-to-respawn
        DeathFX                = FX_FaramirDieToRespawn    ;FXList to play when killed-to-respawn
        DeathAnimationTime        = 5000                ;How long DeathAnim will take.
        InitialSpawnFX            = FX_FaramirInitialSpawn
        RespawnAnim                = LEVELED                ;Animation to play when respawning.
        RespawnFX                = FX_FaramirRespawn        ;FXList to play when respawning.
        RespawnAnimationTime        = 2000                ;Time it takes for respawn to play.
        AutoRespawnAtObjectFilter    = NONE +CASTLE_KEEP // << whatever the object's name is you want to make him respawn from. Could also be the ForbiddenPools name. Not sure if it actually works at all. 
        ButtonImage                = HIFaramir_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:600        Time:90000        Health:100%        ;DEFAULT VALUES
        RespawnEntry =    Level:2                Cost:700        Time:90000        ;For other levels, only override what is different.
        RespawnEntry =    Level:3                Cost:800        Time:90000        
        RespawnEntry =    Level:4                Cost:900        Time:90000        
        RespawnEntry =    Level:5                Cost:1000        Time:120000        
        RespawnEntry =    Level:6                Cost:1100        Time:120000        
        RespawnEntry =    Level:7                Cost:1200        Time:120000        
        RespawnEntry =    Level:8                Cost:1300        Time:120000        
        RespawnEntry =    Level:9                Cost:1400        Time:120000        
        RespawnEntry =    Level:10            Cost:1500        Time:120000        
    End

Say this instead:

BuildableHeroesMP = None

If you want the other heroes too, add them all, with the exception of any reference to a Faramir object:

BuildableHeroesMP = CreateAHeroDummy GondorBeregond GondorBoromir_mod GondorGandalf_mod GondorImrahil GasthausPalando GasthausAlatar GondorAragorn_mod RohanPippin_mod

If that doesn't work, try adding "CASTLE_KEEP" as KindOf to the ForbiddenPool.


Edited by Echo, 14 February 2015 - 04:12 AM.

26285.png


#7 DrHouse93

DrHouse93
  • Members
  • 18 posts
  • Location:Rome
  • Projects:RotWK Maps (Both Edain and 2.02 versions)

Posted 15 February 2015 - 07:32 PM

I did what you suggested, but the same problem remains: I start the mission with Custom Faramir, and at the same time he's recruitable at the Forbidden Pool. Then once died I can revive him from the Forbidden Pool, but only if I recruited the other version previously. Therefore, once this is dead, I can revive him, too, from the Forbidden Pool, but I have to revive the Starting Faramir first. And removing from the BuildableHeroes any reference to Faramir completely disables both the recruitment and the revival options



#8 Echo

Echo

    T3A:Online

  • T3A Staff
  • 1,069 posts
  • Location:Germany
  • Projects:Lot3A
  •  ~~
  • Division:BFME
  • Job:T3A Moderator
  • Donated

Posted 15 February 2015 - 09:33 PM

What exactly is the purpose of those "FakeHeroReviveSlotX"s? And is the command set of the Forbidden pool still accurate?

 

I would remove Faramir from the PlayerTemplate and add "CASTLE_KEEP" to the KindOf of the forbidden pool.


26285.png


#9 DrHouse93

DrHouse93
  • Members
  • 18 posts
  • Location:Rome
  • Projects:RotWK Maps (Both Edain and 2.02 versions)

Posted 16 February 2015 - 10:54 AM

To be honest, I really don't know. I just know that the order of the script must be that one, otherwise I get a different hero to be recruited/revived in place of Faramir. The code script regarding Faramir isn't in the playertemplate, it's in the map.ini (I used a ReplaceModule) and I also tried to add CASTLE_KEEP to the ForbiddenPool, with two outcomes:

 

- KindOf = CASTLE_KEEP -> It makes the Forbidden Pool unselectable

- KindOf = +CASTLE_KEEP -> The Forbidden Pool is selectable, but nothing changes

 

I'm gonna try if it works by adding "NONE +CASTLE_KEEP", but otherwise I don't know what else to do

 

EDIT: Nothing, the same problem always happens. In addition, if I completely remove the KindOf block, the Forbidden Pool becomes unselectable. By the way, I don't think the problem is in the map.ini, but rather in the worldbuilder scripts


Edited by DrHouse93, 16 February 2015 - 12:44 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users