Jump to content

werewolf morph script


Guest Pyro

Recommended Posts

What you want isn't easily possible (you could create your own BAM and make a custom animation, but it'd be a lot of work).

 

Like I posted earlier, these are all sequences of an animation file that the engine handles specially for chunky death; the "explosion" is not an animation that you can play.

Link to comment

well thats a bummer...

 

theres something else id like to do for another character that im seeking help on. id like to have one of my characters randomly morph into a bat or a shadow wolf. most of the time, i want him to be his normal appearance, but every now and then, id like him to turn into a bat for...i dont know, say 10 secs or so. same with the wolf. i figured youd use trigger 0x4023 True() so that it will always happen, then have three separate polymorph probabilities. one for the normal appearance of the character (which would be high probability since i want him to look normal most of the time, say 90% of the time or something), then one for the bat, then one for the wolf. each with decreasingly less probability of at any given time, the character looking like the specified creature.

here are the codes for the bat and wolf

 

0xC000 BAT_INSIDE
0x7B06 WOLF_SHADOW

 

i tried to do this myself, but i couldnt figure out how to get the code right. when i tested it, the character never morphed, so...idk. what would also be cool is to have a sound play when he morphs. for the bat, sound "RAT01" would work. and for the wolf "WOLFF03"

 

so...if someone could help me with the coding to make this work, that would be very much appreciated. thank you all for all your help :)

Link to comment

How about a timer to stop it being so regular?

 

IF
 RealGlobalTimerExpired("##RandomShift","GLOBAL")
THEN
RESPONSE #90 //highest chance to fire. Does nothing.
 RealSetGlobalTimer("##RandomShift","GLOBAL",1200) //once every 20 mins real time, replace as necessary
 Continue()
RESPONSE #10 
 RealSetGlobalTimer("##Shifting","GLOBAL",10) //So we can later turn off the shift
 Polymorph(BAT_INSIDE) //should polymorph into a bat
 PlaySound("RAT01")
RESPONSE #10
 RealSetGlobalTimer("##Shifting","GLOBAL",10)
 Polymorph(WOLF_SHADOW)
 PlaySound("WOLFF03")
END

IF
RealGlobalTimerExpired("##Shifting","GLOBAL")
THEN
RESPONSE #100
 Polymorph(FIGHTER_MALE_HUMAN) //replace as necessary
 RealSetGlobalTimer("##RandomShift","GLOBAL",1200)
END

 

I might have missed something horrible there, but I don't think so. Ah well.

 

 

Icen

Link to comment

i dont think it works. i changed the timer to go off every 30 secs instead of 20 mins and reversed the probability so that there was 90% chance he would change and only 10% he would remain the same. i ran the game, waited and watched for a couple minutes and he never changed. any ideas?

Link to comment

in addition, i also noticed that in game you cannot change the soundsets for NPCs (by going to customize). and i dont see any way to do this with shadowkeeper either. how do you set NPCs to have custom soundsets in BG2?

Link to comment

Sorry for the late reply. Vacations and whatnot...

It's good to hear you got the werewolf script to work.

 

I did some more searching and spotted the fighters in the windspearhills that change into a werewolf to see how they get the chunks. They simply do it with:

 

ActionOverride("aewere1",ForceSpell(Myself,WEREWOLF_CHANGE))

 

However, this will not work for you because what this spell does is kill the original creature (the fighter) and summon a new creature (the werewolf).

 

I think that chunks only play at an actual death or you have to do the whole animation sequence (which seems very difficult to me).

It is possible to show the werewolf changing animation though, which is the SPPOLYMP animation (see SPIN107. copy it to SPIN199 and remove everything except the SPPOLYMP effect). You can put that in a spell and in the same block as the polymorph (where you tried to put the animate bit). Then perhaps use the following and see if you like the animation.

 

ActionOverride("Korgan", ApplySpellRES("SPIN199","Korgan"))

 

I could not find a whole chunks effect so it must be made up from different tiny animations.

 

 

As for the bat and wolf thing, try to do it without the timer.

Simply use True() and put RESPONSE to #100 for the bat part and remove the wolf part for now. If that works, at least you know that the animation change works. Repeat for the wolf if the bat part worked, otherwise there is no point in tweaking the timer part if the animation part does not work.

Link to comment

im not really following what im supposed to do for the animation youre talking about. i found the SPPOLYMP animation as a BAM. i also found the SPIN107 BAM but that was just an icon. how do you change coding on a BAM? i thought it was just an image/animation file, not coded like a script

 

in regards to the bat/wolf polymorph...

i used this code and it worked:

IF
True()
THEN
RESPONSE #90
	Polymorph(FIGHTER_MALE_GNOME)
RESPONSE #10
	Polymorph(BAT_INSIDE)
	PlaySound("RAT01")
RESPONSE #05
	Polymorph(WOLF_SHADOW)
	PlaySound("WOLFF03")
END

 

the only problem is, he only transforms into the bat/wolf for an instant, then he goes back to the gnome form. is there a way to add a duration? like for each polymorph stage to remain in that stage for 20 secs or so before polymorphing into another form?

 

however, this will all be for naught if i cant use a custom soundset for these NPCs. i cant seem to find a way to change their soundset from their default soundset to a custom one. in DLTCEP, when you go to "edit creature" and select a NPC, there is a "Soundset" tab with a dropdown box that has all his dialogs, and i do see an "import soundset" button but it opens a window for ".tbg" and ".iap" files. so idk what those are

 

this is my main concern now. all the werewolf/polymorph stuff will be useless if i cant apply custom sounds for these NPCs. so how do i go about doing this? thank you!

Link to comment

I see where you are going wrong with the BAMs.

 

My intention was to copy the spell SPIN107 (SPIN107.spl) to SPIN199 (SPIN199.spl). I should have clearly mentioned that. The reason for this is because SPIN199 does not exist yet. You can also copy it to a different name as long as it starts with 4 letters and 3 numbers (and ends with .spl).

Now in DLTCEP you can open the spell (SPIN199) and look at the effects. Remove them all except the effect which describes SPPOLYMP. You can also keep the POLYBACK effect, but it does not seem to do anything. Save it in the override folder.

Now with the actionoverride code above inserted one line under your polymorph bit, it should play the animation through the spell effect.

 

The thing with the chunks is that there is an effect for it, but it is only one grain of the chunks rather than the full animation of many chunks and arms and legs flying around, so I have no idea how to make that work.

 

 

For the bat/wolf thing you have currently.

I think at first glance, the timer part which icen posted should work okay.

The reason why your current block only shortly morphs your character is because the game checks the block on a regular basis. First you are a gnome, then when the block finally returns 10% you become a bat, then the game reinitialises the script and trips the block again and there is a 90% chance that you will be morphed back into a gnome again.

 

Adding the timer as icen suggested should prevent that.

I don't know why it does not fully function.

Perhaps change RealGlobalTimerExpired into GlobalTimerExpired and RealSetGlobalTimer into SetGlobalTimer.

 

If that does not work, maybe it should be initiated. That can be done by going into the OnCreation() block and add in the response part the line:

 

SetGlobalTimer("##RandomShift","GLOBAL",10)

 

That may do the trick.

 

 

As for the soundset. That part I do not really know. You will have to ask this in the DLTCEP forum.

Link to comment

PolyBack is the "rear" of the animation. It's the part that makes it look 3D (like the fireshields' foreground and background rings). These two are always played together.

 

As I've said, the engine composites the chunks explosion in hardcode.

 

The script fails to function because (Real)GlobalTimerExpired() doesn't return true if the timer has never been set. You'd want to initially set the timer or use !GlobalTimerNotExpired() (GlobalTimerNotExpired() returns true only if the timer exists AND it hasn't expired, so !GlobalTimerNotExpired() returns true if the timer doesn't exist OR it's already expired; existence in this case simply means that the variable (with the correct scope) has been set by some script somewhere in the game (i.e., it exists in the variable hash)). Additionally, you'd want to use variables to track when you switch away from and back to FIGHTER_MALE_whatever to keep from endlessly spamming useless Polymorph(animation_im_already_using) calls that will interrupt the character's current actions.

 

Soundset just requires altering the CRE files beforehand (if you want to start a new game and don't want to change it during the game); you can try SetPlayerSound() if you need to script the change.

Link to comment

Ah, so polyback refers to polygons-back2back or something? I did not know that. Very good to know. I thought that in this case it meant something like polymorph back, hehe.

 

Using ! is indeed more elegant than using an oncreation block. I didn't think of that.

 

This is a learning curve for me too.

Link to comment
Ah, so polyback refers to polygons-back2back or something? I did not know that. Very good to know. I thought that in this case it meant something like polymorph back, hehe.
This effect has no other function beyond playing an animation.

 

POLYBACK is simply an additional VVC which plays another animation (if you look at SPPOLYMP.BAM, you'll notice it has two separate animations). The first is positioned to play in front of the actor (set up in sppolymp.vvc), and the second plays behind (set up in polyback.vvc), creating a pseudo-3D appearance (i.e., the actor sprite will draw on top of the rear animation and be obscured by the front animation).

 

SP is the standard prefix for BioWare's spell animations (ones adapted or stolen from IWD have a trailing I, and their VVCs all start with IC). "Polymp" is just condensed "Polymorph" (i.e., SpPolymp is the polymorph spell animation); PolyBack (which is just a VVC) is just the rear portion (the "back" of the animation).

Link to comment

lroumen, i got the spell effect to work, thanks!

 

 

devSin,

alright, i used this for the bat/wolf polymorph:

 

IF
!GlobalTimerNotExpired("##RandomShift","GLOBAL")
THEN
RESPONSE #90
	RealSetGlobalTimer("##RandomShift","GLOBAL",1200)
	Continue()
RESPONSE #10
	RealSetGlobalTimer("##Shifting","GLOBAL",10)
	Polymorph(BAT_INSIDE)
	PlaySound("RAT01")
RESPONSE #10
	RealSetGlobalTimer("##Shifting","GLOBAL",10)
	Polymorph(WOLF_SHADOW)
	PlaySound("WOLFF03")
END

IF
!GlobalTimerNotExpired("##Shifting","GLOBAL")
THEN
RESPONSE #100
	Polymorph(FIGHTER_MALE_GNOME)
	RealSetGlobalTimer("##RandomShift","GLOBAL",20)
END

 

it worked, but the timer must be off because the polymorphing was still happening constantly. this part:

	RESPONSE #90
	RealSetGlobalTimer("##RandomShift","GLOBAL",1200)

is supposed to make it check to polymorph every 20 mins. but my character was polymorphing back and forth continuously. how do we fix this?

 

also, about the soundset, you said:

Soundset just requires altering the CRE files beforehand (if you want to start a new game and don't want to change it during the game); you can try SetPlayerSound() if you need to script the change.

no, i dont care to change it during the game. i want it to be the same from the get-go. i dont care how i do it, i just want to be able to change the NPC soundset to a specified custom one. what would be the easiest way to do that? you mentioned using SetPlayerSound() as an option, is that the easiest way? how do i do it? remember, im a novice at this, youll have to spell it out for me :) . thanks!

Link to comment

Archived

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

×
×
  • Create New...