Jump to content

Photo

make creature temporarily invulnerable?


18 replies to this topic

#16 Roxanne

Roxanne

    Modder

  • Modders
  • 2041 posts
  • Gender:Female
  • Location:Auckland, NZ

Posted 04 March 2018 - 09:51 AM

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, 04 March 2018 - 10:00 AM.

The Sandrah Saga!

another piece of *buggy, cheesy, unbalanced junk*

 

 

 


#17 Daxtreme

Daxtreme
  • Members
  • 119 posts
  • Gender:Not Telling
  • Location:Quebec

Posted 04 March 2018 - 10:49 AM

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, 04 March 2018 - 10:50 AM.


#18 Roxanne

Roxanne

    Modder

  • Modders
  • 2041 posts
  • Gender:Female
  • Location:Auckland, NZ

Posted 04 March 2018 - 10:59 AM

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


The Sandrah Saga!

another piece of *buggy, cheesy, unbalanced junk*

 

 

 


#19 Daxtreme

Daxtreme
  • Members
  • 119 posts
  • Gender:Not Telling
  • Location:Quebec

Posted 04 March 2018 - 11:14 AM

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? 





Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users