Jump to content

werewolf morph script


Guest Pyro

Recommended Posts

RealSet* is stored as real time, but !GlobalTimer* is checking against game time (which will be much greater than real time). Just change all the calls to RealSetGlobalTimer() to SetGlobalTimer(), and pick an appropriate duration (300 seconds is one game hour). You're going to want to change the second blocks !GlobalTimerNotExpired() to GlobalTimerExpired() (otherwise, it will be true in every single case except when you set it for that small period); note that you want each RESPONSE to also SetGlobalTimer("##RandomShift","GLOBAL",time); and you're going to have to use variables to start tracking when this stuff fires (after ##Shifting expires the first time, the GlobalTimerExpired() check is going to be true until the next time you set the timer, and all those actions are going to keep being executed).

 

You can edit the CREs with DLTCEP or Near Infinity; if you want to add new sounds or use sounds that aren't previously used by other characters in the game, they need to be converted to the correct format and added as strings to dialog.tlk, which is something you can do quite easily with WeiDU.

 

You'll have to search around for instructions if that is the case (there should be tutorials covering the stuff you need to do), but once you get the sounds converted, the code to get them working will be relatively simple (you may even want to continue on and just create a brand new NPC; it's not that much more work than usurping one of the existing ones depending on your needs).

Link to comment

i did this and nothing happened:

 

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

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

 

and i dont know what you mean by: "you're going to have to use variables to start tracking when this stuff fires." what kind of variable?

 

in regards to the soundsets...ya know how when you go to "customize" while in-game for your created character you can go to "sounds" and it will have all the available soundsets for you to choose. is there no way to make it so you can do that for the NPCs, instead of it being grayed out?

Link to comment

Yes, you can set the "Export allowed" flag on the CRE file (if it's an in-progress game and an existing party member, the CRE will actually be part of the GAM file). That will allow you to use the portrait and sound customization options.

 

For your script, something like:

IF
InParty(Myself)
!GlobalTimerNotExpired("RageTakingOver","LOCALS")
Global("HereComeTheWolfAwooo","LOCALS",0)
THEN
RESPONSE #100
SetGlobalTimer("RageTakingOver","LOCALS",100)
RESPONSE #10
SetGlobalTimer("RageTakingOver","LOCALS",10)
SetGlobal("HereComeTheWolfAwooo","LOCALS",1)
Polymorph(BAT_INSIDE)
PlaySound("RAT01")
RESPONSE #15
SetGlobalTimer("RageTakingOver","LOCALS",10)
SetGlobal("HereComeTheWolfAwooo","LOCALS",1)
Polymorph(WOLF_SHADOW)
PlaySound("WOLFF03")
END

IF
GlobalTimerExpired("RageTakingOver","LOCALS")
Global("HereComeTheWolfAwooo","LOCALS",1)
THEN
RESPONSE #100
SetGlobalTimer("RageTakingOver","LOCALS",100)
SetGlobal("HereComeTheWolfAwooo","LOCALS",0)
Polymorph(FIGHTER_MALE_GNOME)
END

Link to comment

ok, that sounds much much easier. how do i set the "Export allowed" flag on the CRE file? what program?

 

i tried your code. i think it works. sometimes when i load the game, he changes immediately into either the bat or wolf. he stays for several seconds, but then once he changes back to normal form, he stays in normal form. other times when i load the game, he is in normal mode, and doesnt change. what is the amount of time that it checks to see if it should change? im not sure exactly how often i want this to take place in game play, but i would like to know what i need to change to adjust it accordingly. thanks

Link to comment

I would use Near Infinity, but either Near Infinity or DLTCEP should work (you'd have to look to somebody else for help with DLTCEP). With Near Infinity, you just have to navigate to the CRE you want (or the GAM file, and select the character you want), and the flags field is right there when you switch to the edit pane (one of the checkboxes will be labeled "Export allowed"). Without knowing who exactly you're doing this to, I can't give any more specific instructions; if it's a BioWare NPC, there will be several versions you'd want to modify (there are different CREs for each of the levels they can join the party at).

 

A little weirdness wouldn't be unexpected since I stuck everything all on the same timer. The times are in seconds (real seconds), with 300 seconds being one hour of game time. So that script I gave you has him morph for ten seconds and then change back for at least 100 seconds, and it will only try to polymorph every 100 seconds. You can set the times to whatever you desire.

Link to comment

alright, using near infinity i went into the CRE files and i found the checkbox labeled "Export allowed." i checked it for all different level versions of the character (im using jan just as a test). compiled and saved the changes. but when i loaded the game, all the options under the customize section was still all grayed out except for "script" (which is always available for NPCs). and the entire "export" tab was completely grayed out in the character records screen. any idea what the problem is?

 

ok, i changed your code a bit to test the timing. i kept the morph time at 10 secs, but i changed the morph back time from 100 secs to 10. i also changed the probability of morphing into a bat and wolf each to 100. so i figured this would make it so that every ten seconds there would be a 50/50 chance he would morph into a bat or a wolf. but...this did not happen. when i first load the game, he morphs immediately into a bat, then morphs back to normal after about 10 secs. but then nothing ever happens again. i waited for a couple minutes and he never changed again. heres the code i used:

IF
InParty(Myself)
!GlobalTimerNotExpired("RageTakingOver","LOCALS")
Global("HereComeTheWolfAwooo","LOCALS",0)
THEN
RESPONSE #100
	SetGlobalTimer("RageTakingOver","LOCALS",10)
RESPONSE #100
	SetGlobalTimer("RageTakingOver","LOCALS",10)
	SetGlobal("HereComeTheWolfAwooo","LOCALS",1)
	Polymorph(BAT_INSIDE)
	PlaySound("RAT01")
RESPONSE #100
	SetGlobalTimer("RageTakingOver","LOCALS",10)
	SetGlobal("HereComeTheWolfAwooo","LOCALS",1)
	Polymorph(WOLF_SHADOW)
	PlaySound("WOLFF03")
END

IF
GlobalTimerExpired("RageTakingOver","LOCALS")
Global("HereComeTheWolfAwooo","LOCALS",1)
THEN
RESPONSE #100
	SetGlobalTimer("RageTakingOver","LOCALS",100)
	SetGlobal("HereComeTheWolfAwooo","LOCALS",0)
	Polymorph(FIGHTER_MALE_GNOME)
END

Link to comment

You have to start a new game or modify Jan in the GAM file for the saved game you're using (his CRE will be embedded in the GAM file).

 

Change the second block's timer to also set for 10 seconds. You probably just didn't wait long enough after he changed back.

 

Note that the first response alters the probability (there's only a 67% chance of changing at all). You could delete the first response to have him always change into something, but it would probably get pretty obnoxious after a while.

Link to comment

ah, that was it. the second block's timer i didnt change, so it was still at 100. i changed it to 10 and now it happens much more frequently than before. ok cool, so now i know what to change to make it happen more or less often as i desire

 

thank you all so so much for all your help. i think im good to go now. if i think of any other neat lil tricks id like to include, ill certainly ask the experts here. :)

Link to comment

Archived

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

×
×
  • Create New...