Jump to content

script to change npc name while in combat


Guest Pyro

Recommended Posts

i have no idea what to do with WeiDU. i took a look at it and its just a bunch of .exe files that open into an msdos window. it means nothing to me. nearinfinity i actually understand. plus, once i get these scripts right, i can export the .bcs files and save them for the future. then all i have to do is paste them into the override folder, replace the existing ones, and im all set. im not looking to get into moding. i just want to make these couple small tweaks

Link to comment
i have no idea what to do with WeiDU. i took a look at it and its just a bunch of .exe files that open into an msdos window. it means nothing to me. nearinfinity i actually understand. plus, once i get these scripts right, i can export the .bcs files and save them for the future. then all i have to do is paste them into the override folder, replace the existing ones, and im all set. im not looking to get into moding. i just want to make these couple small tweaks

It's not possible to do what you want by simply copying .bcs files into the override. It is possible (and easy) to make a WeiDU installer for your mod that will do everything you want in a single step.

 

Everything you need to do to create your WeiDU mod is spelled out in post #12. The 11 or so lines of text that you need are already there, you just need to adjust the filenames and put your files in the right folders.

Link to comment

yeah i saw in post 12 it says how to do the werewolf thing. but i was able to get it to work the way i want using NI. so now all i want to do is be able to change the names of other npcs. i dont want any fancy script or anything, i just want to change their names to something else

 

i dont understand how to do this in WeiDU, im not even sure what file youre saying i shoudl rename to "setup-werewolf_fun.exe". sorry guys, im not trying to be stubborn, i just dont understand. it seems like there should be some way to make a new string ref set to the name i want, add that someplace to part of the game files (like the dialog.tlk file or something) so that new string is selectable in shadowkeeper when you go to change the names

 

sorry for my noobness... :)

Link to comment
i dont understand how to do this in WeiDU, im not even sure what file youre saying i shoudl rename to "setup-werewolf_fun.exe".

WeiDU.exe is a program used to install mods. Trying to run it by itself won't do you much good. However, if you rename this program to setup-modname.exe, it will look for a corresponding setup-modname.tp2 file to take mod installation instructions from. If you have any mods from G3 or elsewhere, they will have a copy of this program. You can make a duplicate of their setup-modname.exe and rename it to match your .tp2 file, and running it will install your mod. If you don't have any other mods, you can always get the latest copy of WeiDU.exe from the WeiDU.org website, and rename that file.

 

On another note, if you can describe more precisely what you want to do, it will help us to help you. I looked up your other thread just now to get a better idea, and I'm still a little iffy. It sounds like you want to add a new NPC to the game without adding any custom dialogue, yes? If you can explain in detail what your ideal changes would look like, that will help us provide better recommendations and code that you don't have to tweak as much to get working.

Link to comment

the old post was along similar lines but i didnt want to bother making new npcs. i just wanted to add minor scripts to change existing npcs

 

as for changing the names of existing npcs, i figured out what to do. i just added new strings for all the names i wanted to dialog.tlk like you showed me using NI and then added this script to the corresponding npc's bcs:

IF
True()
THEN
RESPONSE #100
	SetName(#####)
END

 

easy fix. thank you sooo much for all the help. if i run into anything else i will surely be back!

Link to comment

back again

 

but this problem is with the script devsin gave me in my other post here: http://forums.gibberlings3.net/index.php?showtopic=18905

 

this is the script he gave me:

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 #5
	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(THIEF_MALE_HUMAN)
END

 

the character with this script, when i have him walk, his walking is interrupted and he just stops all movement before reaching his destination. its very hard to get him to do anything because any action i have him do is interrupted. i assume this is because the script is constantly running a check for whether or not it should to polymorph my character into a bat or wolf. is there a way to make this script still perform the check but not interrupt the character's movement? thanks

Link to comment
Guest Pyro

disregard my post above this one. i would delete it but i cant.

 

i decided i want to make my werewolf character be a werewolf all through the night. so i compiled this script to do so. it works...more or less, but the sound keeps replaying over and over. and the characters actions keep getting interrupted. i tell him to move, and he takes a couple steps and then stops. in night time though, he does change to a werewolf and in the day, he is in normal form. here is the code i used, can someone tell me what went wrong? thanks

 

IF
TimeOfDay(DUSK)
THEN
RESPONSE #100
	ApplySpellRES("SPCL666a","Minsc") // No such index
	SetName(74102) // El Hombre Lobo
	ActionOverride("Minsc",Polymorph(WEREWOLF))
	PlaySound("TRANS")
END

IF
TimeOfDay(NIGHT)
THEN
RESPONSE #100
	ApplySpellRES("SPCL666a","Minsc") // No such index
	SetName(74102) // El Hombre Lobo
	ActionOverride("Minsc",Polymorph(WEREWOLF))
	PlaySound("TRANS")
END

Link to comment
Guest Pyro

ok, i understand that there needs to be a variable check in there to prevent it from happening over and over. but im not sure what it should look like. i read the link you gave but it didnt give much direction on how to actually do it. this is what i came up with but it still fires continuously:

 

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


IF
Global("night","LOCALS",1)
TimeOfDay(DUSK)
THEN
RESPONSE #100
	ApplySpellRES("SPCL666a","Minsc") // No such index
	SetName(74102) // El Hombre Lobo
	ActionOverride("Minsc",Polymorph(WEREWOLF))
	PlaySound("TRANS")
END

IF
Global("night","LOCALS",1)
TimeOfDay(NIGHT)
THEN
RESPONSE #100
	ApplySpellRES("SPCL666a","Minsc") // No such index
	SetName(74102) // El Hombre Lobo
	ActionOverride("Minsc",Polymorph(WEREWOLF))
	PlaySound("TRANS")
END

Link to comment
Guest Pyro

in addition to my above post about making my character be a werewolf all throughout the night, i have also decided i would like my other character that changes into a bat and wolf on occasion to only morph when not in combat. its annoying when i have him fighting someone but then stops attacking since he has morphed, and then again when he morphs back. so how do i make it so that he will only morph while not in combat? heres the code im using:

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(JON_IRENICUS)
END

 

thanks!

Link to comment
ok, i understand that there needs to be a variable check in there to prevent it from happening over and over. but im not sure what it should look like.
It's quite simple, because you just define a variable and check it so it doesn't loop. So:
IF
 OR(2)
TimeOfDay(DUSK)
TimeOfDay(NIGHT)
 Global("myvar","GLOBAL",0)
THEN
 RESPONSE #100
ApplySpellRES("somthing","someone")
SetGlobal("myvar","GLOBAL",1)
END

IF
 OR(2)
TimeOfDay(MORNING)
TimeOfDay(DAY)
 Global("myvar","GLOBAL",1)
THEN
 RESPONSE #100
ApplySpellRES("somother","someone")
SetGlobal("myvar","GLOBAL",0)
END

so how do i make it so that he will only morph while not in combat?
Usually done by using CombatCounter(0) or !ActuallyInCombat() as a trigger (in the IF section).
Link to comment
Guest Pyro

hmm, i tried what you said Miloch but when it becomes night, he changes into the werewolf, but then changes back to normal right after. any idea why? here is the code i used:

 

IF
OR(2)
	TimeOfDay(DUSK)
	TimeOfDay(NIGHT)
Global("myvar","GLOBAL",0)
THEN
RESPONSE #100
	ApplySpellRES("SPCL666a","Minsc") // No such index
	SetName(74102) // El Hombre Lobo
	ActionOverride("Minsc",Polymorph(WEREWOLF))
	PlaySound("TRANS")
	SetGlobal("myvar","GLOBAL",1)
END

IF
OR(2)
	TimeOfDay(MORNING)
	TimeOfDay(DAY)
Global("myvar","GLOBAL",1)
THEN
RESPONSE #100
	ApplySpellRES("SPCL666b","Minsc") // No such index
	SetName(74103) // Waldemar Daninsky
	ActionOverride("Minsc",Polymorph(FIGHTER_MALE_HUMAN))
	SetGlobal("myvar","GLOBAL",0)
END

Link to comment

You may need to put a SetGlobalTimer() action in with a !GlobalTimerExpired() trigger, so there's a long enough delay for the game to recognise it's NIGHT or whatever, and won't change it back again immediately. Really, the best way to write scripts like this is look in the IESDP (Actions and Triggers sections) for commands that might suit your purpose, then use Near Infinity to text search the game's scripts for those commands. Then you'll have examples that you know should pretty much work, and I think there's several for lycanthropy.

Link to comment

Archived

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

×
×
  • Create New...