Jump to content

make creature temporarily invulnerable?


Recommended Posts

Read point 3. below for the solution I would apply (1. and 2. are only trying to improve your current approach, which I would not use anyway, dialogue action blocks for complex operations are tricky, theoretically they should be equal to script action blocks, but practically they can be interrupted too easily).

 

1. I would use this (for test, may need refinement)

 

IncrementGlobal("CowledWarning","GLOBAL",1)
CreateCreatureObject("COWENF1",Myself,0,0,0)
CreateCreatureObject("COWENF4",Myself,0,0,0)
CreateCreatureObject("COWENF3",Myself,0,0,0)
Wait(2)
ActionOverride("COWENF01",DestroyItem("D#INVULZ"))

Wait(1)
ActionOverride("COWENF2",DestroyItem("D#INVULZ"))

Wait(1)
ActionOverride("COWENF03",DestroyItem("D#INVULZ"))

Wait(1)
ActionOverride("COWENF04",DestroyItem("D#INVULZ"))

Enemy()

 

2. To add this into the existing dialogue is tricky because you cannot append actions but only prepend with ADD_TRANS_ACTION, i.e. adding them with a d-file would give you wrong order of actions. You can use REPLACE_ACTION_TEXT but I agree with Weidu readme when it says "Never use this if you can help it.."

 

I suggest to use this in tp2

COPY_EXISTING ~cowenf2.dlg~ ~override~
DECOMPILE_AND_PATCH BEGIN
REPLACE_TEXTUALLY ~original action text~
~new action text~
END

 

3. I would do all of this completely different.

I would use their override script, i,e, Enforced.bcs

 

EXTEND_TOP ~Enforced.bcs~ ~mymod/Removeitem.baf~

 

Removeitem.baf would be

IF
GlobalGT("CowledWarning","GLOBAL",0)
GlobalLT("CowledWarning","GLOBAL",6)
HasItem("D#INVULZ",Myself)
Delay(6)
THEN
RESPONSE #100
DestroyItem("D#INVULZ")
Continue()
END
Alternatively you could replace the first two triggers after IF with your own global that you set in the dialogue file, you can use use ADD:TRANS_ACTION for this.
Edited by Roxanne
Link to comment

That works wonderfully well Roxanne, wow

 

Thanks! :D AND with good modding practice

 

When you say though not to modify dlg files, can I change the cowled enforcers dialogue or is it too risky? Actual dialogue this time, not action scripts :p

 

edit: I think this will work only the first time they are summoned, am I correct? Afterwards the item will be removed for good

Edited by Daxtreme
Link to comment

That works wonderfully well Roxanne, wow

 

Thanks! :D AND with good modding practice

 

When you say though not to modify dlg files, can I change the cowled enforcers dialogue or is it too risky? Actual dialogue this time, not action scripts :p

 

edit: I think this will work only the first time they are summoned, am I correct? Afterwards the item will be removed for good

1. You misunderstood - I did not say that modding dlg files is risky, it only referred to that particular case of overwriting state actions which easily can create incompatibility. I mod dlg files constantly.

You need to be more specific here, do you want to exchange an existing line or add new states or have variation in responses...

 

2, The whole scenario will work several times, as long as GlobalLT("CowledWarning","GLOBAL",6), because the enforcers are not single NPCs with a continuing life but new spawns every time. If you give them your item in the cre file, they will always have it when they appear. (by the way, did you consider that?).

Link to comment

1. Not sure yet :p Still working on it. Duly noted on the state actions!

 

2. That's exactly what I want, much thanks! :)

 

Random (and last question for this thread): I created a new loot table, in which I have a random item called "RNDGRP02", with a list of random stuff, which I inserted in the random treasure table

COPY_EXISTING ~rndtres.2da~ ~override~
    INSERT_2DA_ROW 2 12 ~RNDGRP02 amul14 amul14 amul14 amul19 amul23 brac01 brac01 brac02 brac02 brac03 brac13~
BUT_ONLY

Now it works all fine, I tested it, items get randomly given, but I never actually, huh, created an item called "RNDGRP02". I gave it to my NPCs in my tp2 like this:

ADD_CRE_ITEM ~RNDGRP02~ #0 #0 #0 ~none~ ~inv~ // Random stuff

It works but, I wonder... will there be a problem eventually if the item "RNDGRP02" doesn't exist? My theory is that the game only checks if an item named "RNDGRP02" is set to the CRE file, and then replaces it with the actual treasure in the table.

 

But will that cause problem down the line eventually? RNDGRP02 simply does not exist in my game (and yet, the random items work!).

 

Maybe it could bug in a non-EE install?

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...