Jump to content

werewolf morph script


Guest Pyro

Recommended Posts

i want to make a werwolf character for BG2. i dont want him to actually BE a werewolf (like have the abilities and whatnot), i just want him to APPEAR to be a werewolf. but only during combat. during normal game play i want him to look like just a normal character.

 

to explain: i want to know if there is a way to make a script for a character in BG2 such that the character appears as a normal human during non-combat gameplay, but once combat begins, the outer skin 'explodes' away and reveilles the werewolf form. then once combat ends, he reverts back to his human appearance. but i only want the appearance to change. the weapons, armor and special abilities and such of the character should remain the same. i only want the appearance to change

 

so...is such a script possible? and if so, could someone make it for me?

 

ps - i wasnt planning on making the werewolf the character i generate. i was planning on changing one of the NPCs i add to my party during the game and giving him the script. is this possible? thanks a ton!

Link to comment

You could use one global variable to track whether you should be human form or werewolf form. Then by using the prequisites of being in combat and having the global being the value of human or werewolf you can have the script polymorph you into whichever you want to be.

 

I've looked into this for my own kit, but these blocks are not what I was looking for. Now it comes in handy, hehe. These blocks are not full-proof because I'm typing it from memory, however, it is something you can begin with.

 

IF
 OnCreation()
 Kit(Myself,Yourkit) // or use a tracking for your npc
THEN
 RESPONSE #100
 SetGlobal("form","LOCALS",1)
END

 

Then

IF
 Global("form","LOCALS",1) // which would be the value for the human form.
 !CombatCounter(0) // in combat
 Kit(Myself,Yourkit) // or use a tracking for your npc
THEN
 RESPONSE #100
ActionOverride(Myself,Polymorph(WEREWOLF)) //or is it WERE_WOLF?
SetGlobal("form","LOCALS",2) // which would be the value for the wolf form
END

 

and follow up with

 

IF
 Global("form","LOCALS",2) // which would be the value for the wolf form.
 CombatCounter(0) // finished fighting
 Kit(Myself,Yourkit) // or use a tracking for your npc
THEN
 RESPONSE #100
ActionOverride(Myself,Polymorph(FIGHTER_MALE_HUMAN)) //or whichever you are.
SetGlobal("form","LOCALS",1) // which would be the value for the human form
// around here you can also play with "DisplayStringHead" to display a bit of text above your character once combat stops (but that can get annoying after a while)
END

 

I put the oncreation there because sometimes going from 0 to 1 and back to 0 does not always work in my tests. Hence you see me using 1 and 2 for the globals and initialising the global upon game loading.

 

Keeping weapons and stuff should work out okay. I don't remember if your WEREWOLF in the script above also inherits his paws, but in that case you can make your own creature file and polymorph into that one, just make certain that it has no weapon applied to any of his slots.

 

Werewolf abilities are probably not loaded though, so you would have to use the same script to add those abilities by using:

 

ActionOverride(Myself, ApplySpellRES("XXXXXXX",Myself))

 

being a spell that gives an innate (so you create another spell that gives you the innates or abilities).

 

Then when the back to human script kicks in, you can punt in a similar actionoverride applyspellres, but then one that removes those abilities again.

That takes a bit of tinkering and is not easy to describe here, sorry.

 

 

Another possibility is to use the above examples and instead of polymorph you use ApplySpellRES and pick the werewolf innate that shapeshifters get. In that case your weapon will be paws, but again, creating your own shapeshifting creature can fix that. You will also inherit the stats (str,dex,con,int,wis,cha) of the werewolf though.

 

I hope someone else can help you further with this, since I'm also not well-versed with modding, but I hope this helped.

Link to comment

Or, similarly, try something like this:

 

IF
Global("MyNPCIsWerewolf","GLOBAL",0)
CombatCounterGT(0)
RealGlobalTimerExpired("##WerewolfTimer","GLOBAL")
THEN
RESPONSE #100
 ApplySpellRES("##TWere",Myself) //ToWerewolf. Allows for special abilities, ect
 SetGlobal("MyNPCIsWerewolf","GLOBAL",1)
 RealSetGlobalTimer("##WerewolfTimer","GLOBAL",60) //60 seconds/1 turn
END

 

This code needs to have ##Twere.spl with a duration of at least 60 to work, and up to <duration> seconds after this character is out of combat, the werewolf form should automagically disappear.

 

Untested however, and I'm sure someone will be here soon enough to nitpick it. :thumbsup:

 

 

Icen

Link to comment

thanks for the help. but i prolly should have said this in the first post. i know nothing about making scripts or what to do with them once i have them. so i dont know the first thing of what to do with those codes you gave lol. i pretty much need to have the scripts already made and done, then be told what to do with them. is it something i set to the character in the game or is this all stuff thats needs to be done using editors?

Link to comment

Ah, I see. It took me quite some time to get used to the coding that is required if you want to implement something fun into a mod. Most of the time it is not something straightforward and in this case you cannot escape the part that you have to look into writing code yourself.

 

I'm certain that you have already taken a look at the tutorial modding forum on G3. If not, please do.

Look for NPC creation tutorials and you will undoubtedly find a few that contain information on how to install them and how to write scripts to get everything to work.

 

If you cannot find them, this categorised thread can help you further (off-site, but it links back to numerous G3 threads actually).

http://www.shsforums.net/index.php?showtopic=36781

 

 

I also suggest to look at scripting tutorials such as this one (it helped me lots):

http://www.pocketplane.net/tutorials/simscript.html

 

And there are also some examples here (but this is not what you need at the moment)

http://www.weidu.org/WeiDU/README-WeiDU.html

 

Of course you should not forget the most important source where you can have a peek at the normal game contents:

http://iesdp.gibberlings3.net/

 

I think that only leaves me to mention DLTCEP, NearInfinity and InfinityExplorer as the tools that you would probably need for building the files for your mods, or for browsing the game files to check other in-game scripts (personally I don't even use NearInfinity when I use the other two tools combined).

I also find it helpful to look into the installation files of other mods to see how I can speed up my own work, or how best to implement certain approaches in scripts.

Link to comment

do i have to create my own npc? i was originally planning on just taking someone already in the game, once i get them to join my party, and somehow giving them a script that makes them turn into a werewolf during combat, and revert back in noncombat. i dont care to make my own dialogue, or create a custom script for romances or where they appear in the game, or whatever else.

 

is there a way to use an editor to simply add such a script to an already existing character? like: ok, i have the script. now open whatever editor, open the game file, select a npc in my party, change/replace/add the werewolf script, save the changes, and thats it. can it be done that way? thanks for the help

Link to comment

All "NPC" party members have a script that you can just add your stuff to. Near Infinity will allow you to edit scripts in a fairly friendly manner (you'd still need some familiarity with the scripting language, though).

 

Note that CombatCounterGT() will never really return anything sensible (sorry, Ice), and CombatCounter() is notoriously unreliable (it has a tendency to "stick" at some nonzero value; this is the same as the combat songs sometimes lasting well after combat ends).

 

The problem with the "exploding" out of the skin is that the method normal werewolves use it actually kill the initial human creature (and spawn in a new guy at the same location). So you'd have to fake it with spell effects, but there's not an easy way to get the exploding body chunks that I can think of.

Link to comment
The problem with the "exploding" out of the skin is that the method normal werewolves use it actually kill the initial human creature (and spawn in a new guy at the same location). So you'd have to fake it with spell effects, but there's not an easy way to get the exploding body chunks that I can think of.
ah i see...yes that is a problem. hmm, i may just have to use the spell morph effect to occur at the start of combat and forget about the exploding body chunks. thast a bummer. if anyone can think of a way to do the chunks, please let me know.

 

i still dont know how to go about making a script to make the npc turn into a werewolf though. and remember, i dont want the special abilities or the weapon (paws) to take place, i just want the appearance of a werewolf upon combat. so how do i go about doing that?

Link to comment

Granted, you do not need to make a custom NPC, but you need to at least see the basics of how scripts are written if you want to make this work out. You also need to figure out what the variable and the script is of the NPC that you want to mod.

Suppose you want it done for Viconia, then the easiest way is probably to extend the viconia.bcs script with blocks similar to those described above.

 

With NearInifinity you can just place the following block in viconia.bcs (put them at the top).

 

IF
 OnCreation()
THEN
 RESPONSE #100
 SetGlobal("form","LOCALS",1)
END

IF
 Global("form","LOCALS",1)
 !CombatCounter(0)
THEN
 RESPONSE #100
ActionOverride(Myself,Polymorph(WEREWOLF))
SetGlobal("form","LOCALS",2)
END

IF
 Global("form","LOCALS",2)
 CombatCounter(0)
THEN
 RESPONSE #100
ActionOverride(Myself,Polymorph(CLERIC_FEMALE_ELF_LOW))
SetGlobal("form","LOCALS",1)
END

 

Then edit the file "animate.ids" and add the following lines:

0x7E00 WEREWOLF
0x7E01 WEREWOLF_GREATER

 

It may require a bit of testing and tweaking (probably a few typos here and there), but that may just work out correctly (except for the point that combatcounter is unreliable as devsin noted).

 

 

The chunks is a bit tricky. You indeed need to cast a spell on your character, which can be done by adding the following line to the script.

 

ActionOverride(Myself, ApplySpellRES("YYYY",Myself))

 

Where YYYY is the spell that contains the chunks animation. You will probably have to make this file yourself (call it YYYY.spl)

 

The effect needs to be "Play 3D Effect [215]" with SPPOLYMP for a duration of 3 seconds and/or POLYBACK for a duration of 3 seconds. It depends if you want both animations or just one.

 

Check out the spells from the druid shapeshifting (like SPCL611). They will show the chunks animation as well as give you the option to add innate abilities. Just make certain to remove those abilities again when you shift back or you end up with too many of them (cast a second spell to remove them).

 

 

 

I would rather do it with Weidu however and write a nice baf file with the blocks and a nice tp2 file containing:

 

APPEND ANIMATE.IDS "0x7E00 WEREWOLF"		 UNLESS "^0x7E00[\t]"
APPEND ANIMATE.IDS "0x7E01 WEREWOLF_GREATER" UNLESS "^0x7E01[ \t]"
BUT_ONLY_IF_IT_CHANGES

COPY	~yourlocation/YYYY.spl~	~override/YYYY.spl~

EXTEND_TOP ~XXXX.BCS~ ~yourlocation/XXXX.baf~

 

 

Where XXXX.BCS is the script of the NPC you wish to change and XXXX.baf is the one which contains the blocks you would like to add.

Link to comment

wont the polymorph effect actually turn the character into a werewolf though? including all special abilities, paws weapon, and whatnot. i just want the appearance of a werewolf with all the normal characters abilities/weapons still intact

Link to comment

The chunks, in this case, are the chunky death sprites, not the polymorph animation (I think he wanted the character to "explode" into the werewolf form, as per normal werewolves/wolfweres). I think the chunk behavior is done in hardcode (chunks has multiple single-chunk animations that the engine clusters and blasts); I don't know of a way to replicate it.

 

Never ActionOverride() yourself. This can bork your action queue and lead to lost actions (probably not in this case since the lists are so short).

 

wont the polymorph effect actually turn the character into a werewolf though? including all special abilities, paws weapon, and whatnot. i just want the appearance of a werewolf with all the normal characters abilities/weapons still intact
Polymorph() simply changes the character animation; it is applied instantly.
Link to comment
The chunks, in this case, are the chunky death sprites, not the polymorph animation (I think he wanted the character to "explode" into the werewolf form, as per normal werewolves/wolfweres). I think the chunk behavior is done in hardcode (chunks has multiple single-chunk animations that the engine clusters and blasts); I don't know of a way to replicate it.

yes, that is what i want. so theres no way to replicate that?

 

Hmm.... you may be right about the action override bit. In my tests the polymorph is a bit iffy though and it does not always trigger if you don't use the override.

so what does this mean? lol

Link to comment

well lroumen, your code for changing into a werewolf for combat, then back again after combat works perfectly. :) only had to figure out one minor change: where it said "ActionOverride(Myself,Polymorph(WEREWOLF))" i had to change 'myself' to the NPC name within quotes. i ended up using korgan since he joins immediately after dialog, so all i had to do was CLUA him in, talk to him, and he was in my party. then summon a monster and he morphed into a werewolf right before my eyes!

 

now...the chunks i still dont know what i am doing. i tried a few things but didnt get anywhere. in the Animate.IDS file where you told me to add:

0x7E00 WEREWOLF
0x7E01 WEREWOLF_GREATER

i also saw:

0x0100 CHUNKS                       
0x0200 EXPLODING_ARM                
0x0210 EXPLODING_HEAD               
0x0220 EXPLODING_FOOT               
0x0230 EXPLODING_TORSO              
0x0240 EXPLODING_LEG

these are the animations im after arnt they? so isnt there a way to just add in a script for that animation in the .bcs to take place along with the morph into werewolf script? something like:

ActionOverride("Korgan",Polymorph(WEREWOLF))
Animate("Korgan",0x0100 CHUNKS)

im sure it must be more complex than that, i have no idea how to figure out what it would actually be. but wouldnt that work if we knew the code for inserting an animation to take place upon the character at the time of polymorphing?

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...