Is it possible to record name of enemy to a variable?

Feel free to discuss anything related to the creation of new KotC 2 adventures using the toolset.

Is it possible to record name of enemy to a variable?

Postby luciffer » Mon Sep 04, 2023 6:08 am

I want to create an arena mod where I can repeatedly challenge monsters. Currently, one issue I'm facing is that I have to set up end of fight scripts (heal, set position, etc) separately for each group of enemies, which is quite time-consuming. Is there a way to save the names of enemys or the enemy groups defeated in a variable?Thanks!
luciffer
Goblin (CR 1/3)
 
Posts: 2
Joined: Mon Sep 04, 2023 3:41 am

Is it possible to record name of enemy to a variable?

Advert
 

Re: Is it possible to record name of enemy to a variable?

Postby Dorateen » Mon Sep 04, 2023 6:28 pm

Could you use the Create Variable script command as part of your end of fight script? You could call the variable the name of a group of enemies and set the value to 1. Then you should be able to reference that variable later.

Not sure if that would do what you are looking to achieve.
User avatar
Dorateen
Planetar (CR 16)
Knights of the Chalice
Knights of the Chalice 2
Kickstarter Knight
 
Posts: 103
Joined: Fri Aug 21, 2009 2:31 am

Re: Is it possible to record name of enemy to a variable?

Postby luciffer » Tue Sep 05, 2023 2:25 am

Dorateen wrote:Could you use the Create Variable script command as part of your end of fight script? You could call the variable the name of a group of enemies and set the value to 1. Then you should be able to reference that variable later.

Not sure if that would do what you are looking to achieve.


It seems that I didn't explain myself clearly enough.

Let's say I have a map named "arena", there are one npc and two invisible enemy groups named "e1" and "e2" on the map. Avatar can talk to npc and by choice make "e1" or "e2" visible then fight them. Both group leaders of "e1" and "e2" have an end of fight script which heal (script#111) and hide (script#71) corresponding group. So Avatar could fight them again after talking to npc.

This module works fine now, but it's quite non-expandable. I don't want to set 20 different end of figth scripts for 20 enemy groups.

So what I want is a reusable end of fight script to add dead enemy groups or individual enemy to a variable. But it seems that a script capable of implementing this functionality does not exist yet.
luciffer
Goblin (CR 1/3)
 
Posts: 2
Joined: Mon Sep 04, 2023 3:41 am

Re: Is it possible to record name of enemy to a variable?

Postby Dorateen » Tue Sep 05, 2023 2:03 pm

What if you made one script that healed all the enemies on a map, and set all the enemies on a map to hidden.

You could put this one script on every enemy group. So after the player defeats group e1, they will be hidden and healed. The other groups are already hidden and at full hit points so it should not matter that the script affects them, too. Would that work?
User avatar
Dorateen
Planetar (CR 16)
Knights of the Chalice
Knights of the Chalice 2
Kickstarter Knight
 
Posts: 103
Joined: Fri Aug 21, 2009 2:31 am

Re: Is it possible to record name of enemy to a variable?

Postby BlueSalamander » Thu Sep 14, 2023 11:05 pm

Why does it have to be in the end-of-fight script, though?

Seems to me you could set the variable NameOfChosenEnemy within the dialogue script, right after the player selects the group he's going to be fighting.

Have a great time! Best regards 8-)
'Say there is a chunk of meat. Pirates will have a banquet and eat it! But heroes will share it with other people. I want all the meat!!' - Luffy in One Piece
User avatar
BlueSalamander
Master Conjuror
 
Posts: 1906
Joined: Sun May 18, 2008 6:20 pm


Return to KotC 2 Forum for Adventure-Module Creation

Who is online

Users browsing this forum: No registered users and 1 guest