Jump to content

make creature temporarily invulnerable?


Recommended Posts

Hey guys, short question:

 

Is there a state flag, oppcode, or anything that I could use to set a cre's status to, like, "invulnerable" for like 2 seconds, then it goes away?

 

Thanks!

Edited by Daxtreme
Link to comment

Invulnerability is not a single state, it is a stacking of effects like set AC, resistance against this and that + immunity from one thing or other.At least I have never seen it as state or flag or opcode.

Edited by Roxanne
Link to comment

Would it be possible to give an item to a creature that essentially makes it invulnerable (demilich ring + whatever's missing), then taking it away 2 seconds later?

 

Or taking away a creature's item in-game might cause problems?

Link to comment

Would it be possible to give an item to a creature that essentially makes it invulnerable (demilich ring + whatever's missing), then taking it away 2 seconds later?

 

Or taking away a creature's item in-game might cause problems?

You can try that.

Here is a ring (Maybe you have SoD yourself?)

BDTROLL2.zip

Link to comment

Unfortunately I don't have SOD installed, although I do own it.

 

I'm finishing this playthrough before refreshing my mods and installing EET, and all the things.

 

Is that item SOD dependent?

 

 

minhp1 provides invulnerability and is in pretty much every game.

The item I posted should work in any game just have no adequate name + description..

MinHP1 prevents a creature from dying as there will always be 1hp left. The creature will nevertheless take all kinds of damage, i.e. it is vulnerable. It will depend on the intention whether this is sufficient..

Link to comment

Yes I need it to be totally invulnerable to all damage and status effects, death effects, everything

 

I will try out this ring thanks Roxanne!

Well, then just copy the item and then just add effects to that item that make it damage invulnerable:

COPY_EXISTING ~minhp1.itm~ ~override/customitemname.itm~ 
LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode=65 target=1 timing= duration= parameter2=12 //spell damage
LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode=120 target=1 timing= duration= parameter1=1 parameter2=9 END //melee damage 1
LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode=120 target=1 timing= duration= parameter1=2 parameter2=9 END //melee damage 2
LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode=120 target=1 timing= duration= parameter1=3 parameter2=9 END
LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode=120 target=1 timing= duration= parameter1=4 parameter2=9 END
LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode=120 target=1 timing= duration= parameter1=5 parameter2=9 END
LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode=120 target=1 timing= duration= parameter1=6 parameter2=9 END
LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode=120 target=1 timing= duration= parameter1=7 parameter2=9 END
LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode=120 target=1 timing= duration= parameter1=8 parameter2=9 END
LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode=120 target=1 timing= duration= parameter1=9 parameter2=9 END
LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode=120 target=1 timing= duration= parameter1=10 parameter2=9 END
LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode=120 target=1 timing= duration= parameter1=11 parameter2=9 END
BUT_ONLY

I forgot what the timers for the while equipped in that is, and target (self, should be 1), but that should be most of it anyways.

Edited by Jarno Mikkola
Link to comment

Do you know if there are any bugs with removing an item midgame from a character?

There is no problem

Action

DestroyItem("bdtroll2") or DestroyItem("minhp1")

In a script will do that without problem if in the script of the creature that has the item.

If done from another creature, you can either use ActionOverride("creaturewithitem",DestroyItem("bdtroll2")) or first take the item from the cre and then destroy it.

Link to comment

So the item works very well Roxanne and Jarno, thanks a lot! I added the effects found on the Demilich.itm to make the cre really invulnerable to status effects as well :)

 

But now that leads to another problem, divided in 2 things:

 

1. ActionOverride

 

As I said in my message, I want to remove the item. Here's the thing: ActionOverride works Roxanne, thanks for that I tested it... but not for the creature I want to use it on!

 

Here's my script. I edited "cowenf2.dlg" to remove the item after they hail you, and spawn their friend. The final action script looks like this:

 

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

I added the "wait" and the rest.

 

Now that should work, but it doesn't :(

 

I replaced "cowenf2" with Player1 and it successfully removed the same item from my main character.

 

Why isn't it working with the cowled enforcers? :(

 

Now here's the interesting part: in NearInfinity, "cowenf2" works fine but "cowenf1", 3, and 4 don't work at all. NI returns an error, says they aren't valid "actors". I looked into their cre file and their "script name" is actually "cowenf01" , 02, and so on. When I input their script name the errors disappear. However, it still doesn't work. Item doesn't get removed.

 

My theory is that ActionOverrides seems to require as first argument an actor, which... is different from a cre file somehow?

 

Anyone knows what's going on here?

 

2. second problem: How to edit the action part of a dialog?

 

My second problem is basically that I don't know how to edit the "action" part of a dialog file. I read the weidu doc on dialog and action but it's too confusing for me. Is it even editable from my "setup-x.tp2" file?

 

Like, for testing purposes, how would I append "cowenf2.dlg" to add the lines I added above without the need to overwrite the whole file? (for good modding practice :D)

 

Thanks in advance guys, believe me I tried a lot of things and searched the forum, etc. The things I ask here is really if I just can't find a solution

 

edit: sorry for double post, I waited around 24 hours between the 2!

Edited by Daxtreme
Link to comment

ActionOverride works on a creature's script name (or death variable) which is different than their file name. If you look in an editor at cowenf1.cre, you'll see that the script name is cowenf01, and that cowenf3 and cowenf4 also use scripts names with leading zeroes. IOW, change to this:

ActionOverride("COWENF01",DestroyItem("D#INVULZ"))
ActionOverride("COWENF2",DestroyItem("D#INVULZ"))
ActionOverride("COWENF03",DestroyItem("D#INVULZ"))
ActionOverride("COWENF04",DestroyItem("D#INVULZ"))
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...