Jump to content

How to temporary change GENERAL status


Recommended Posts

Doesn't look like it. It's not built for temporary action; you can change and then change back, but that's it.

For example, if you wanted to give duergar an "Enlarge Person" spell that turned them into Giant Humanoids for the duration, you'd have to do the type change twice - once immediately to the GIANTHUMANOID type and once with a delay to the HUMANOID type.

Link to comment
21 hours ago, jmerry said:

Doesn't look like it. It's not built for temporary action; you can change and then change back, but that's it.

For example, if you wanted to give duergar an "Enlarge Person" spell that turned them into Giant Humanoids for the duration, you'd have to do the type change twice - once immediately to the GIANTHUMANOID type and once with a delay to the HUMANOID type.

I was afraid so. Thank you. I'm working on fake death spell that could be applied on party members and I wanted to also set general to DEAD when it is working. But code that I have now is quite ugly and on the top of that not working (I'm storing general value in local variable and restore it based on that).

I want to make raise dead spell to work on characters under my fake death spell. So I could patch raise dead related spells to allow cast also on not dead. I guess reason for adding this general = DEAD requirement is to not apply #rdremov on alive characters. But anyway it is applied with opcode 326 so I could move DEAD check to #rdremov application and remove it from other places (raise dead opcode itself seems to not have problem when casting on alive).

There is also DEAD check in power word kill and similar spells, I don;t get what it is doing.

Link to comment
On 5/31/2023 at 5:35 PM, kjeron said:

It prevents the related visual effects from occurring if the spell fails to kill them.

Ah, I see. I was confused because there is also protection from whole resource when HP > 60. But I guess this is additional protection when target HP is lower then 60, but have additional protection against kill opcode itself. Thanks.

 

After all I think I would try to change general to DEAD and restore it later. I found why my code was not working, seems General(.., 0) trigger return true for every general value. Here is how I made it if someone need to do similar thing. This solution is possible because I need to track only few target that I know beforehand (Player1..6):

  • I store general value of creature in local variable:
    • I read general.ids and for every entry I make eff file that sets local variable to ids value (omitting 0 and 3 [DEAD])
    • In my fake death spell I apply every eff with proper general check (so I apply eff 1 only if general = 1 etc)
    • At the end I change  general to DEAD with op72
  • Revert is a bit more complicated because I haven't found way to apply eff based on local variable so restore needs to be in global script:
    • I create cutscene bcs with blocks "if local variable is x change general to x" for every general.ids entry. One file for every player.
    • Then for every player extend global script with block "if general is DEAD and {it is time to revert} and local variable is not 3 (to prevent eventual looping) then start proper cutscene (without entering cutscene mode)".  
Edited by marchitek
Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...