Jump to content


Photo

Change - Soundset (scripting question!)


  • Please log in to reply
62 replies to this topic

#1 Vae Victus

Vae Victus
  • Member
  • 34 posts

Posted 23 August 2004 - 02:11 PM

Hey,

I am making a shapeshift spell, what's basicly a demon form (Tana'ri).
And I have included the change portrait variable to change portraits when you shapeshift, now my question was, that I want to do the same to the soundset (PC Voice). I want to change the soundset when I am shapeshifting into the demon.
But I couldn't find any change variables to soundset's. So is there such a variable, that is perhaps not included in the Near Infinity Resource Editor? If so, is there a way to script it myself?

thanks in advance

#2 Seifer

Seifer

    The best Anti-Paladin weapon is a tin opener...!

  • Member
  • 4505 posts

Posted 23 August 2004 - 03:39 PM

Depends what you are changing it to. Have you any sort of voice set recorded or do you plan on ingame sounds?

how come you always look so damn cool in every photo I see you in?!?


Speaking of modding, I listened to IER 3 yesterday, so you can have another quote for your signature: how come you sound so damn cool, as well as look it? It's unfair. Seriously.


Still a cyberjock, still hacking the matrix, still unsure of what that means.

TeamBG member - http://www.teambg.eu

#3 Vae Victus

Vae Victus
  • Member
  • 34 posts

Posted 24 August 2004 - 03:34 AM

I am planning to use my own created soundset (Demon_).

Thanks already for your help.

#4 Kismet

Kismet

    Mild Thang

  • Member
  • 348 posts

Posted 24 August 2004 - 04:11 AM

SetPlayerSound(O:Object*,I:STRREF*,I:SlotNum*SNDSLOT) would probably work. I think this is what JC used in Anomen's flirt pack to give him his CN soundset right after he fails his test rather than waiting until TOB. You might want to check that for examples.

Also, the various talk fixers for NPC mods use that command too to make sure the soundset is correct for save games after you uninstall/reinstall mods.

Edited by Kismet, 24 August 2004 - 04:13 AM.


#5 Vae Victus

Vae Victus
  • Member
  • 34 posts

Posted 24 August 2004 - 05:39 AM

First of all thanks for the help,

second where does it say which soundset it has to use?
and a follow up question, where do I have to place this script? within the spell script?

Thanks already

#6 Vae Victus

Vae Victus
  • Member
  • 34 posts

Posted 24 August 2004 - 10:03 AM

I don't want to be impatient, but I really would like to know an answer to my question!

So anyone, any help is apreciated... :help:

#7 Kwiat_W

Kwiat_W
  • Modder
  • 290 posts

Posted 24 August 2004 - 11:09 AM

I would suggest an invisible cre with that script and using "LastSummonerOf(Myself)" as "Object". In place of "I:STRREF*" you put something like that:
~Sorry for being so impatient.~ [TANARI1]
where [TANARI1] is the nawe of your .wav file and ~Sorry for being so impatient.~ is what your character will say. You cen find names of sound slots (I:SlotNum*SNDSLOT) in IESDP or by looking at cre files in NearInfinity or DLTCEP.
So your script would look like this:
IF
Tue()
THEN
RESPONSE #100
SetPlayerSound(LastSummonerOf(Myself),~Sorry for being so impatient.~ [TANARI1],INITIAL_MEETING)
SetPlayerSound(LastSummonerOf(Myself),~Blah, blah.~ [TANARI2],SELECT_COMMON1)

...

DestroySelf()
END

Edited by Kwiat_W, 24 August 2004 - 11:17 AM.

icon11.gif W_GUI - a GUI replacement for Baldur's Gate 2/TUTU/BGT/CA
icon11.gif W_PackMule - Your own pack mule for Baldur's Gate 2/Tutu/BGT/CA, BGEE and BG2:EE

icon11.gif Psionics Unleashed - play as a Psion, mod for Baldur's Gate 2/Tutu/BGT/CA

 


#8 Vae Victus

Vae Victus
  • Member
  • 34 posts

Posted 24 August 2004 - 12:00 PM

Hey thanks for responding!

So if I am correct this goes into a *.bcs script?

So if I understand this correctly it will be like this:
(using Illid_ (soundset, standard)
(When Shapeshift in Tanar'i / Demon form Demon_ (soundset, changed)):

IF
Tue() //Should this not be True, instead of Tue?
THEN
RESPONSE #100
SetPlayerSound(LastSummonerOf(Myself),~Sorry for being so impatient.~ [Demon_],INITIAL_MEETING)
SetPlayerSound(LastSummonerOf(Myself),~Blah, blah.~ [Illid_],SELECT_COMMON1)

...

DestroySelf()
END

You were also speaking of an invisible creature? Will it not be easier of this is used by the shapeshifted creature so Creature B (DEM)?

Eitherway thanks again.

Edited by Vae Victus, 24 August 2004 - 12:18 PM.


#9 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 24 August 2004 - 12:56 PM

No, no, no.

Look up the creature in NI, and see that all diffrent soundclips have a name, called INITIAL_MEETING, BATTLE_CRY1, etc.

Now look at the code:
SetPlayerSound(LastSummonerOf(Myself),~Sorry for being so impatient.~ [Demon_],INITIAL_MEETING)

The blue is the string.
The red is the wav-file.
The green is the name of that specific sound in the character soundset.

So, the script above will: Set the INITIAL_MEETING-sound to Demon_.wav and the string (the text that will be shown in the feedback-box) will be "Sorry for being so impatient."

This code:
SetPlayerSound(LastSummonerOf(Myself),~Blah, blah.~ [Illid_],SELECT_COMMON1)
will: Set the SELECT_COMMON1-sound to Illid_.wav and the string will be "Blah, blah.".

You do not have to specify the soundclip or the string you're overwriting, only which sound in the character soundset.

Confusing? Eh, maybe so, until I can find a better word for what INITIAL_MEETING, BATTLE_CRY1, etc. really is.

Also, in the beginning:

Tue() //Should this not be True, instead of Tue?

Yes, he means true, but you shouldn't use that. Use a global or local variable instead.

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#10 Vae Victus

Vae Victus
  • Member
  • 34 posts

Posted 24 August 2004 - 01:11 PM

So the wav file can also be directed as the one from BECOMING_LEADER:

SetPlayerSound(LastSummonerOf(Myself),~Sorry for being so impatient.~ [Demon_b],INITIAL_MEETING)

SetPlayerSound(LastSummonerOf(Myself),~Blah, blah.~ [Illid_b],SELECT_COMMON1)

Because I do not have the wav file Demon_.wav or Illid_.wav (I can make them but if it is not needed, I will let it be.)

Another thing, how do I command the creature / spell to activate this script?

Thanks already for the big help!

Well I did made two new sound files: Illid_.wav and Demon_.wav.
But when I was testing this script in NI I got an error, saying:

Error 1/3 - Line 6

Expected I:STRREF* But found ~Sorry for being so impatient.~[Demon_]

Error 2/3 - Line 7

blah~[Illid_],SELECT_COMMON1 not found in SNDSLOT.IDS

So more help definately appreciated!

Edited by Vae Victus, 24 August 2004 - 01:26 PM.


#11 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 24 August 2004 - 01:25 PM

If you want a specific soundclip (leader.wav) to be played as the BECOMING_LEADER-thingy, with the string "I am the leader now", you code it like this:

SetPlayerSound(LastSummonerOf(Myself),~I am the leader now~ [leader],BECOMING_LEADER)

Nothing else except for the rest of the script.

To activate it, you add this script to the override-script of the creature, and I suggest you have a variable, like Global("voicechange",GLOBAL,1) and then you simply set the dialogue somewhere in a dialogue, for example.

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#12 Vae Victus

Vae Victus
  • Member
  • 34 posts

Posted 24 August 2004 - 01:56 PM

I still get these's errors in Near Infinity when I want to compile the BCS:

Error 1/3 - Line 6

Expected I:STRREF* But found ~Sorry for being so impatient.~[Demon_]

Error 2/3 - Line 7

blah~[Illid_],SELECT_COMMON1 not found in SNDSLOT.IDS

Should I ignore them?

Further I could not find any dialogue (*.BCS file) of the creature, could it be the case that I changed a character into a creature, that that's why I cannot find any *.BCS?

Eitherway I was thinking, is there not a way to include this SetPlayerSound,
within the shapeshift spell file, like it was possible for the set portrait variable?
If so, then in which program could I manualy write such a variable to add it to the spell? Because that would be a hack lot easier then is?

Thanks again for the help and interest.

Edited by Vae Victus, 24 August 2004 - 01:58 PM.


#13 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 24 August 2004 - 02:54 PM

Since I haven't actually done this myself, I've made a mistake in explaining to you. I didn't really know how the exact action worked, but I looked it up.

I would very much suggest you compile a .baf-script to a .bcs-script using WeiDU. I'm sure you can do it some other way, but then you'd have to ask someone else, I always do these things in WeiDU.

With WeiDU:

You'll need a .tra-file with your lines.

The script (sound.baf):
IF
	Global("voicechange","GLOBAL",1)
	Global("NewSounds","LOCALS",0)
THEN
	RESPONSE #100
  SetPlayerSound(Myself,@1,INITIAL_MEETING) //note that you can change INITIAL_MEETING into something else...
  SetPlayerSound(Myself,@2,SELECT_COMMON1) //same here...
  SetGlobal("NewSounds","LOCALS",1)
END

And the .tra-file (sound.tra):
@1 = ~Sorry for being so impatient.~ [Demon_b] //the string and the soundfile. these could be anything.
@2 = ~Blah, blah.~ [Illid_b] //same here


The tp2:
COMPILE ~dir\sound.baf~ 
USING ~dir\sound.tra~
EXTEND_BOTTOM ~anyscript.bcs~ ~override\sound.bcs~ //Use this if you want this script to be a part of another script.

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#14 Vae Victus

Vae Victus
  • Member
  • 34 posts

Posted 24 August 2004 - 04:06 PM

Thanks again for the big help!

I have made these files just as you wrote them down, with only changing the lines:
~Sorry for being so impatient.~ And ~Bla, bla.~

I have saved all the files with the same name: Sound

So I have the following files:

Sound.baf
sound.tra
sound.tp2

Or do I have to rename all the files to the same name as the creature (DEMON.CRE) file has, so "DEMON.<file type>" ?

And when you say Weidu, then If I am correct I have to copy over the newest weidu.exe file and rename it to the same name as the tp2 file, right?

I must be a pain in the arse with all those questions?! :P

Thanks again!

Edited by Vae Victus, 24 August 2004 - 04:09 PM.


#15 Rastor

Rastor

    Yes, I really am a dragon. Yes, I am a jerk. Live with it.

  • Member
  • 2001 posts

Posted 24 August 2004 - 04:22 PM

Or do I have to rename all the files to the same name as the creature (DEMON.CRE) file has, so "DEMON.<file type>" ?


You do not need to do this. As long as the scripts are properly assigned, then the name was does not matter.

And when you say Weidu, then If I am correct I have to copy over the newest weidu.exe file and rename it to the same name as the tp2 file, right?


You don't have to do that, but it's the easiest way.

I must be a pain in the arse with all those questions?!


That's not a question.
Home of Kitanya, Improved Asylum, more...

Posted Image

#16 Vae Victus

Vae Victus
  • Member
  • 34 posts

Posted 24 August 2004 - 04:35 PM


Or do I have to rename all the files to the same name as the creature (DEMON.CRE) file has, so "DEMON.<file type>" ?

You do not need to do this. As long as the scripts are properly assigned, then the name was does not matter.


So how does it work then, because what I understand of this, is that when I shapeshift my avatar into the creature (DEMON.CRE) then the script does its work, giving me the choice to change soundsets.

Do I then have to change the .tp2 file to this?:

COMPILE ~dir\sound.baf~ 
USING ~dir\sound.tra~
EXTEND_BOTTOM ~anyscript.bcs~ ~override\DEMON.bcs~ //Use this if you want this script to be a part of another script.

So that it is activated when the avatar turns into the DEMON.CRE?


I must be a pain in the arse with all those questions?! 



That's not a question.


As Quoted from Eek The Cat:
"Really?!"

Eitherway thanks for the help so far.

Edited by Vae Victus, 24 August 2004 - 04:41 PM.


#17 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 24 August 2004 - 04:46 PM

The full tp2:

BACKUP ~Soundchange\Backup~
AUTHOR ~youremail@youremail.com~
ASK_EVERY_COMPONENT

BEGIN ~Soundchange~

COMPILE ~Soundchange\sound.baf~ 
USING ~Soundchange\sound.tra~
EXTEND_BOTTOM ~demon.bcs~ ~override\sound.bcs~ //Where demon.bcs is the script assigned to the creature.
You place sound.baf and sound.tra in a folder called "Soundchange", and inside there you also place an empty folder called "Backup".

Also, did you create the file demon.cre yourself?

I must be a pain in the arse with all those questions?!

Do you think I would know all this stuff if I'd never asked someone to teach me?

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#18 Vae Victus

Vae Victus
  • Member
  • 34 posts

Posted 24 August 2004 - 05:10 PM

Thanks again!

Also, did you create the file demon.cre yourself?


Yes, I did. I made it out of a character file and converted it to a creature file.

The .TP2 file has to be named the same as the folder "Soundchange", am I right?

Everything else has been done as you said.

Do you think I would know all this stuff if I'd never asked someone to teach me?


Thanks, now I feel less newbie-like!

Edited by Vae Victus, 24 August 2004 - 05:11 PM.


#19 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 24 August 2004 - 05:22 PM

Yes, I did. I made it out of a character file and converted it to a creature file.

Then you might want to add the creature into the tp2.

Do you have a script called demon.bcs assigned to the creature.

Oh, boy, converted character files... I hope you've edited it in NI. Removed player-scripts and unflagging Export Allowed and stuff...

The .TP2 file has to be named the same as the folder "Soundchange", am I right?

No. The weidu-file should be named the same as the tp2, though. As Rastor said, it isn't vital, but recommended.

Do you think I would know all this stuff if I'd never asked someone to teach me?

Thanks, now I feel less newbie-like!

:)

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#20 Vae Victus

Vae Victus
  • Member
  • 34 posts

Posted 24 August 2004 - 05:36 PM

Then you might want to add the creature into the tp2.


Will do!

Do you have a script called demon.bcs assigned to the creature.


No, how do you do that?

Oh, boy, converted character files... I hope you've edited it in NI. Removed player-scripts and unflagging Export Allowed and stuff...


I checked everything, I only wasn't sure about Export Allowed, so I have removed that flag. After the char to cre conversion (Done via Creature Maker), I checked the creature in NI, and changed all of the things, but I am unsure of three things:

Overide script: JP1COUNT.BCS*

Default script: DPLAYER3.BCS*

Dialog: SRCHOOS.DLG

* Are these the .BCS scripts? Which one of them (or both) has to be assigned to the DEMON.BCS?

I have included the DEMON.CRE file, for a closer look if you will.

No. The weidu-file should be named the same as the tp2, though. As Rastor said, it isn't vital, but recommended.


I have changed both files (TP2 & Exe) to Setup-Sound.

Thanks again for your time and help.

Attached Files


Edited by Vae Victus, 24 August 2004 - 05:40 PM.