• Announcements

    • Voice Powered Vehicle

      Logging in   05/10/2017

      If you had an account and can't log in as of 5/9/17, this may be because of a change in logins with new forum software. You can log in using your publicly displayed name (not your username) or your email address and the password you used before.   If you have problems with this, please ask any of the mods or admins. 
Sign in to follow this  
Followers 0
Callie

Issue with cr_level call

4 posts in this topic

I've run into an odd obstacle: importing a creature and increasing its level using the cr_level call prevents it from using spells. The creature does have a custom script, but it's unable to use spells even when set to the basicnpc script. I know the custom script works because I tested it on a normal good witch (the imported creature). Once I remove the cr_level call, the creature uses spells normally (regardless of the creature script used). What's wrong?

 

Here's the creature's definition in the scenario file:

 

begindefinecreature 241;
import = 82; //Good Witch
cr_name = "Tamara";
cr_level = 30;
cr_icon_adjust = 16;
cr_default_script = "tamara";
cr_hp_bonus = 500;

SurraAgob likes this

Share this post


Link to post
Share on other sites

Try manually setting the spellcasting skill:

cr_what_stat_adjust 0 = 11;

cr_amount_stat_adjust 0 = 11;

This may or may not work.

Share this post


Link to post
Share on other sites

That didn't work. Thanks though.

 

Does the AI consider 11 mage low for a level 30 creature? If I do set the level to 30, the creature will solely use melee attacks that only hit about 35 hp.

Share this post


Link to post
Share on other sites

I tried reproducing the error using the code you posted, but the creature was always able to use mage spells. As far as I can tell, there shouldn't be any reason why yours can't. Just changing the level doesn't affect the creature's mage spell skill. The Good Witch creature you imported has its default strategy set to 1, so it should try to use ranged abilities like mage spells whenever possible. The mage spell skill being high or low compared to the level of the creature should be irrelevant.

I can't fathom why cr_level should be causing this problem. You could try removing it from the data script and instead putting in a set_level call in the INIT_STATE of the creature script. It should look something like below.

beginstate INIT_STATE;
set_level(ME,30);
break;

Hopefully that will work.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0