Jump to content


Photo

Just wondering if this script will work


  • Please log in to reply
52 replies to this topic

#1 Deathsangel

Deathsangel

    Living on Wings of Dreams

  • Modder
  • 3089 posts

Posted 17 December 2004 - 10:57 AM

IF
InParty(Myself)
CurrentXP("3960000")
!HasItem("khosy")
THEN
RESPONSE #100
CreateItem("khosy")
END

Will this work in order to give my NPC, Kido, at 28th level (he is a Jester) his own special holy symbol? Or do I need to change something? It needs to get his own symbol like a Cleric does even though he is not a Cleric.

Still modding the Mod for the Wicked... It is a big project you know... And I got sidetracked (several times) a bit... sorry.
However, as we all know, Evil never really sleeps.


Sentences marking (my) life:

Winds of change... Endure them, and in Enduring grow Stronger
It takes a fool to look for logic in a man's heart
Never question the sanity of the insane
The Harmony of Life is Chaos
Living on Wings of Dreams



(1st march 2009) SHS women over me:
Kat: if there were more guys that looked like you out here, people's offspring wouldnt be so damn ugly
Noctalys: you are adorable :P

~~ I love it, and I am humbled! Yay! ~~


#2 Shed

Shed

    -Shed-

  • Modder
  • 2636 posts

Posted 17 December 2004 - 11:30 AM

This will only work if his XP is exactly 3960000. Perhaps you should use CurrentXPGT? HasItem, and CreateItem need more than one argument, but without them it will probably default to Myself, which is OK :).

#3 Stone Wolf

Stone Wolf
  • Member
  • 1672 posts

Posted 17 December 2004 - 11:54 AM

XPGT(O:Object*,I:XP) should work better, and I'd put in a little local variable to keep the script from triggering more than once. The way it is now, it'll trigger multiple times if the NPC loses the item at any point. Try this:

IF
XPGT(Myself,3960000)
Global("Globalname","LOCALS",0)
THEN
RESPONSE #100
CreateItem("khosy")
SetGlobal("Globalname","LOCALS",1)
END

That should work. I dumped the InParty trigger since I don't think it's really necessary, and I swapped out the hasitem trigger for a local variable to prevent the block from repeating itself.

#4 Deathsangel

Deathsangel

    Living on Wings of Dreams

  • Modder
  • 3089 posts

Posted 18 December 2004 - 08:57 AM

XPGT(O:Object*,I:XP) should work better, and I'd put in a little local variable to keep the script from triggering more than once.  The way it is now, it'll trigger multiple times if the NPC loses the item at any point.  Try this:

IF
XPGT(Myself,3960000)
Global("Globalname","LOCALS",0)
THEN
RESPONSE #100
CreateItem("khosy")
SetGlobal("Globalname","LOCALS",1)
END

That should work.  I dumped the InParty trigger since I don't think it's really necessary, and I swapped out the hasitem trigger for a local variable to prevent the block from repeating itself.

View Post


I wonder if this totally gives me what I really want. I put it below the script as a side note, but apparently not clear enough. I want my NPC to get the item if he levels to level 28. The xp needed for this is 3960000.

Is it perhaps possible to do this:

IF
LevelGT(Myself,27)
Global("Globalname","LOCALS",0)
THEN
RESPONSE #100
CreateItem("khosy")
SetGlobal("Globalname","LOCALS",1)
END

I doubt it cause I never saw 'LevelGT' before as a variable, but you kind of get the idea I hope

Still modding the Mod for the Wicked... It is a big project you know... And I got sidetracked (several times) a bit... sorry.
However, as we all know, Evil never really sleeps.


Sentences marking (my) life:

Winds of change... Endure them, and in Enduring grow Stronger
It takes a fool to look for logic in a man's heart
Never question the sanity of the insane
The Harmony of Life is Chaos
Living on Wings of Dreams



(1st march 2009) SHS women over me:
Kat: if there were more guys that looked like you out here, people's offspring wouldnt be so damn ugly
Noctalys: you are adorable :P

~~ I love it, and I am humbled! Yay! ~~


#5 Stone Wolf

Stone Wolf
  • Member
  • 1672 posts

Posted 18 December 2004 - 09:38 AM

That would work (it's a valid trigger). You could also use:

Level(O:Object*,I:Level*)

The only problem with that is that if the NPC gets more than one level at a time (like if you leave your group killing that Fire Giant spawn in Saradush) it might not trigger. LevelGT is probably the best to use.

#6 Deathsangel

Deathsangel

    Living on Wings of Dreams

  • Modder
  • 3089 posts

Posted 08 January 2005 - 08:21 AM

IF
LevelGT(Myself,27)
Global("gotkhosy","LOCALS",0)
THEN
RESPONSE #100
CreateItem("khosy")
SetGlobal("gotkhosy","LOCALS",1)
END

This is now the code and the only thing that goes wrong

Compiling 1 script ...

[Kido/scripts/getkhosy.baf] PARSE ERROR at line 6 column 19-19
Near Text: )
Not enough arguments to [CreateItem]. Recovering.
Extending game scripts ...
Extending game scripts ...
Copying 1 file ...
Copying 1 file ...
Copying 1 file ...
Copying and patching 1 file ...
Copying and patching 1 file ...
Copying and patching 1 file ...
Copying and patching 1 file ...
Appending game text ...
Appending game text ...
Appending game text ...
Appending game text ...



SUCCESSFULLY INSTALLED [Kido the Jester (Requires Throne of Bhaal)]

Press ENTER to exit.

Does it need to become something like this:

IF
LevelGT(Myself,27)
Global("gotkhosy","LOCALS",0)
THEN
RESPONSE #100
CreateItemOn("DKido","khosy")
SetGlobal("gotkhosy","LOCALS",1)
END

DKido being the deathvariable

Edited by Deathsangel, 08 January 2005 - 08:24 AM.

Still modding the Mod for the Wicked... It is a big project you know... And I got sidetracked (several times) a bit... sorry.
However, as we all know, Evil never really sleeps.


Sentences marking (my) life:

Winds of change... Endure them, and in Enduring grow Stronger
It takes a fool to look for logic in a man's heart
Never question the sanity of the insane
The Harmony of Life is Chaos
Living on Wings of Dreams



(1st march 2009) SHS women over me:
Kat: if there were more guys that looked like you out here, people's offspring wouldnt be so damn ugly
Noctalys: you are adorable :P

~~ I love it, and I am humbled! Yay! ~~


#7 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 08 January 2005 - 08:24 AM

IESDP.

CreateItem(S:ResRef*,I:Usage1*,I:Usage2*,I:Usage3*)

I.e. CreateItem("khosy",0,0,0)

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


#8 Deathsangel

Deathsangel

    Living on Wings of Dreams

  • Modder
  • 3089 posts

Posted 08 January 2005 - 09:58 AM

What do the usages stand for?

I am looking at the item page of IESDP, but I do not see it there

Edited by Deathsangel, 08 January 2005 - 10:03 AM.

Still modding the Mod for the Wicked... It is a big project you know... And I got sidetracked (several times) a bit... sorry.
However, as we all know, Evil never really sleeps.


Sentences marking (my) life:

Winds of change... Endure them, and in Enduring grow Stronger
It takes a fool to look for logic in a man's heart
Never question the sanity of the insane
The Harmony of Life is Chaos
Living on Wings of Dreams



(1st march 2009) SHS women over me:
Kat: if there were more guys that looked like you out here, people's offspring wouldnt be so damn ugly
Noctalys: you are adorable :P

~~ I love it, and I am humbled! Yay! ~~


#9 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 08 January 2005 - 10:01 AM

Usage1 is stack-number of items. The others are irrelevant.

So, if you'd want to create 40 arrows, you'd script: CreateItem("arow01",40,0,0).

http://iesdp.gibberlings3.net

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 Deathsangel

Deathsangel

    Living on Wings of Dreams

  • Modder
  • 3089 posts

Posted 08 January 2005 - 10:07 AM

Jeez, you are quick changed my former post as I found IESDP in another topic of you. But thanks I'll make the changes right away

Still modding the Mod for the Wicked... It is a big project you know... And I got sidetracked (several times) a bit... sorry.
However, as we all know, Evil never really sleeps.


Sentences marking (my) life:

Winds of change... Endure them, and in Enduring grow Stronger
It takes a fool to look for logic in a man's heart
Never question the sanity of the insane
The Harmony of Life is Chaos
Living on Wings of Dreams



(1st march 2009) SHS women over me:
Kat: if there were more guys that looked like you out here, people's offspring wouldnt be so damn ugly
Noctalys: you are adorable :P

~~ I love it, and I am humbled! Yay! ~~


#11 Deathsangel

Deathsangel

    Living on Wings of Dreams

  • Modder
  • 3089 posts

Posted 08 January 2005 - 10:25 AM

IF
LevelGT(Myself,27)
Global("gotkhosy","LOCALS",0)
THEN
RESPONSE #100
CreateItem("khosy",1,0,0)
SetGlobal("gotkhosy","LOCALS",1)
END

Current code. Installation goes great, but if I let Kido go over level 28 he doesn't get his item. This is the piece of the .tp2 that has this script in it to be installed.

COMPILE ~Kido/d/KidoJ25.d~

COMPILE ~Kido/scripts/kido.baf~

COMPILE ~Kido/scripts/getkhosy.baf~

EXTEND_BOTTOM ~Ar0510.bcs~ ~Kido/scripts/Ar0510.baf~

EXTEND_TOP ~Ar6200.bcs~ ~Kido/scripts/Kidobio.baf~

COPY ~Kido\audio~ ~override~

My first idea was to put ~override~ behinde kido.baf & getkhosy.baf as that might make them work, but that goes horribly wrong with 4 mistakes in the installation. If I can see it right problems with stores. I can't post it as it to high up, before it dissappers of the screen and you can't stop the install and you can't scroll now can you?

What is wrong with the script or the installation by the .tp2

Still modding the Mod for the Wicked... It is a big project you know... And I got sidetracked (several times) a bit... sorry.
However, as we all know, Evil never really sleeps.


Sentences marking (my) life:

Winds of change... Endure them, and in Enduring grow Stronger
It takes a fool to look for logic in a man's heart
Never question the sanity of the insane
The Harmony of Life is Chaos
Living on Wings of Dreams



(1st march 2009) SHS women over me:
Kat: if there were more guys that looked like you out here, people's offspring wouldnt be so damn ugly
Noctalys: you are adorable :P

~~ I love it, and I am humbled! Yay! ~~


#12 Rastor

Rastor

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

  • Member
  • 2001 posts

Posted 08 January 2005 - 10:42 AM

EXTEND_BOTTOM ~Ar0510.bcs~ ~Kido/scripts/Ar0510.baf~

Does it work if you use EXTEND_TOP instead?
Home of Kitanya, Improved Asylum, more...

Posted Image

#13 Deathsangel

Deathsangel

    Living on Wings of Dreams

  • Modder
  • 3089 posts

Posted 08 January 2005 - 10:55 AM

That is another script, which has nothing to do with the item. And that script(Ar0510.baf) is his spawnscript, so to speak, and that most certainly works

I'm talking about getkhosy.baf

Just looked and I can CLUA the item and it works then, but that is it.

I also leveled up Viconia, but I saw that you then get a sentence in which it is said you get a holy symbol + you see a visual effect. Can anyone tell me the name of the file in which this is scripted. Cause it is actaully what I really want for Kido, even though he is a Jester.

Edited by Deathsangel, 08 January 2005 - 11:05 AM.

Still modding the Mod for the Wicked... It is a big project you know... And I got sidetracked (several times) a bit... sorry.
However, as we all know, Evil never really sleeps.


Sentences marking (my) life:

Winds of change... Endure them, and in Enduring grow Stronger
It takes a fool to look for logic in a man's heart
Never question the sanity of the insane
The Harmony of Life is Chaos
Living on Wings of Dreams



(1st march 2009) SHS women over me:
Kat: if there were more guys that looked like you out here, people's offspring wouldnt be so damn ugly
Noctalys: you are adorable :P

~~ I love it, and I am humbled! Yay! ~~


#14 Rastor

Rastor

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

  • Member
  • 2001 posts

Posted 08 January 2005 - 11:31 AM

That is another script, which has nothing to do with the item. And that script(Ar0510.baf) is his spawnscript, so to speak, and that most certainly works

I'm talking about getkhosy.baf

Just looked and I can CLUA the item and it works then, but that is it.

I also leveled up Viconia, but I saw that you then get a sentence in which it is said you get a holy symbol + you see a visual effect. Can anyone tell me the name of the file in which this is scripted. Cause it is actaully what I really want for Kido, even though he is a Jester.

View Post


Where is getkhosy.bcs assigned? Is there a file anywhere that calls it?
Home of Kitanya, Improved Asylum, more...

Posted Image

#15 Deathsangel

Deathsangel

    Living on Wings of Dreams

  • Modder
  • 3089 posts

Posted 08 January 2005 - 11:53 AM

It is nowhere called, but neither is kido.baf who triggers an interjections. Where should these to be called at?

Any idea how I can make it look like an Cleric level up by the way?

Still modding the Mod for the Wicked... It is a big project you know... And I got sidetracked (several times) a bit... sorry.
However, as we all know, Evil never really sleeps.


Sentences marking (my) life:

Winds of change... Endure them, and in Enduring grow Stronger
It takes a fool to look for logic in a man's heart
Never question the sanity of the insane
The Harmony of Life is Chaos
Living on Wings of Dreams



(1st march 2009) SHS women over me:
Kat: if there were more guys that looked like you out here, people's offspring wouldnt be so damn ugly
Noctalys: you are adorable :P

~~ I love it, and I am humbled! Yay! ~~


#16 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 08 January 2005 - 12:16 PM

The .baf's should not be assigned anywhere, since they're just uncomplied versions of bcs'. .bcs-versions, though, need to be assigned to a creature, to an area or appended to baldur.bcs, in order to get them to work.

So, you'll need to assign the kido.bcs to the override script of Kido.cre, and I'd add the block from getkhosy.baf to the top of Kido.baf.

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


#17 Deathsangel

Deathsangel

    Living on Wings of Dreams

  • Modder
  • 3089 posts

Posted 08 January 2005 - 12:47 PM

The .baf's should not be assigned anywhere, since they're just uncomplied versions of bcs'. .bcs-versions, though, need to be assigned to a creature, to an area or appended to baldur.bcs, in order to get them to work.

So, you'll need to assign the kido.bcs to the override script of Kido.cre, and I'd add the block from getkhosy.baf to the top of Kido.baf.

View Post


Kido.baf is assigned to Kido.cre file. This is the present override script

IF
LevelGT(Myself,27)
Global("gotkhosy","LOCALS",0)
THEN
RESPONSE #100
CreateItem("khosy",1,0,0)
SetGlobal("gotkhosy","LOCALS",1)
END

IF
InParty(Myself)
See("Qualye")
Global("KidoQuayle","LOCALS",0)
THEN
RESPONSE #100
StartDialogueNoSet("Quayle")
SetGlobal("KidoQuayle","LOCALS",1)
END

I changed the last part which originally comes from you SConrad. However in game the interjection does not run.

This is the KidoJ file that is linked to it:

CHAIN
IF ~See("Quayle") Global("KidoQuayle","LOCALS",0) InParty("Aerie") See("Aerie")~
THEN KIDOJ quayle1
 ~Oh jeez, you... you're Quayle! You... you are one of the smartest illusionists one can meet! I mean, I have heard of you in many a tale. You are perhaps not a bard, but an illusionist comes close to a bard, and... and you can also summon the powers of the divine! I, too, once gave some thought to becoming a Cleric, but I already had such a good voice and had attuned myself so much with it, that I couldn't bring myself to do it.~ DO ~SetGlobal("KidoQuayle","LOCALS",1)~
 == QUAYLE ~I am glad that someone appreciates my intellect, but I have changed quite a bit thanks to my dear Aerie.~
 == KIDOJ ~You can't be serious! Have you changed, because of her? She is nothing more than a sniffling, whining little child.~
=
~How could you bring down one of the best adventurers that ever were?! You... you wingless Avariel!~
 == AERIEJ ~You... you should be ashamed of yourself. It is not nice to remind me of my present state. If it were not for Uncle Quayle, I would not have known what to do.~
 == KIDOJ ~All the better! You probably wouldn't have been here!~
 == QUAYLE ~That is enough! You will not shout at my beloved Aerie, nor will you cause her grief. Get out of my sight at once!~
 == KIDOJ ~Oh, fiddlesticks! He has really turned soft. I hate it when that happens.~
EXIT

CHAIN
IF ~See("Quayle") Global("KidoQuayle","LOCALS",0) !InParty("Aerie")~
THEN KIDOJ quayle1
 ~Oh jeez, you... you're Quayle! You... you are one of the smartest illusionists one can meet! I mean, I have heard of you in many a tale. You are perhaps not a bard, but an illusionist comes close to a bard, and... and you can also summon the powers of the divine! I, too, once gave some thought to becoming a Cleric, but I already had such a good voice and had attuned myself so much with it, that I couldn't bring myself to do it.~ DO ~SetGlobal("KidoQuayle","LOCALS",1)~
 == QUAYLE ~I am glad that someone appreciates my intellect, but I have changed quite a bit thanks to my dear Aerie. I don't do that kind of adventuring stuff anymore.~
 == KIDOJ ~Oh, fiddlesticks!~
EXIT

[edit] I have just looked with the new scripting, but the item still isn't created. Neither, the interjections comes up

Edited by Deathsangel, 08 January 2005 - 01:02 PM.

Still modding the Mod for the Wicked... It is a big project you know... And I got sidetracked (several times) a bit... sorry.
However, as we all know, Evil never really sleeps.


Sentences marking (my) life:

Winds of change... Endure them, and in Enduring grow Stronger
It takes a fool to look for logic in a man's heart
Never question the sanity of the insane
The Harmony of Life is Chaos
Living on Wings of Dreams



(1st march 2009) SHS women over me:
Kat: if there were more guys that looked like you out here, people's offspring wouldnt be so damn ugly
Noctalys: you are adorable :P

~~ I love it, and I am humbled! Yay! ~~


#18 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 08 January 2005 - 02:55 PM

You can not assign a .baf-file as override-script. Only .bcs-files is valid scripts in the game.

Yes, I can see you changed it. Now, remove the SetGlobal you added. The dialogue won't start if you don't. Otherwise, always set globals first in a script.

And you still don't need that many conditions in the dialogue when you already check them with your 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


#19 Deathsangel

Deathsangel

    Living on Wings of Dreams

  • Modder
  • 3089 posts

Posted 09 January 2005 - 04:32 AM

Well my debugger is just testing the scripts and adding that one global does not give problems.

Sorry for the confusion I did assign Kido.bcs script to the cre file. I forgot that I need to have a save from before I picked him up in order to let that script work. Which I find somewhat annoying.

It did not run due to a typo See("Qualye") must be See("Quayle"). Only then another problem remains. Only this is not neccessary to discuss here. My debugsters and I are working on it.

Will remove the conditions

Still modding the Mod for the Wicked... It is a big project you know... And I got sidetracked (several times) a bit... sorry.
However, as we all know, Evil never really sleeps.


Sentences marking (my) life:

Winds of change... Endure them, and in Enduring grow Stronger
It takes a fool to look for logic in a man's heart
Never question the sanity of the insane
The Harmony of Life is Chaos
Living on Wings of Dreams



(1st march 2009) SHS women over me:
Kat: if there were more guys that looked like you out here, people's offspring wouldnt be so damn ugly
Noctalys: you are adorable :P

~~ I love it, and I am humbled! Yay! ~~


#20 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 09 January 2005 - 08:22 AM

Well my debugger is just testing the scripts and adding that one global does not give problems.

Yes, it does give problems.

From the script:

SetGlobal("KidoQuayle","LOCALS",1)

From the dialogue:

IF ~Global("KidoQuayle","LOCALS",0)~

The dialogue won't start if you don't remove the SetGlobal.

Will remove the conditions

Certainly not all of them, I hope.

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