Jump to content


Photo

I wonder if this is possible


  • Please log in to reply
6 replies to this topic

#1 Mayday

Mayday
  • Member
  • 18 posts

Posted 04 January 2005 - 03:03 AM

I've noticed that NPC's tend to have several copies of themselves at different levels.
I wonder, if, to make such a thing easier, would it be possible to take an average of the party's combined XP and assign that to the character? Depending on whether the party was a higher XP than it was before?

I ask because I was thinking of implementing this idea to an NPC (non-player romanceable) I am beginning work on, and I'm just beginning to get a handle on the code.

I wonder if its also possible to have a timer which will allow for various dialogues to be accessed when you speak to an unjoined joinable NPC a certain time after they have been kicked from the party.

I ask this because I was wanting my NPC, if not initially taken, or kicked from party for a certain time, to have adventures of his own to tell, which would thereby make sense of the additional XP he had gained in the interim.

I was thinking sort of a gametime timer, which, every time it reached a certain point, would add onto a variable, which would be the number of, say AdventuresHad, and to prevent repitition, telling a tale would add on to a variable called, say, AdventuresTold.

Of course, if these are doable, and you'd like to use them in your own NPC, feel free. My only demand is being noted in the readme's credits. :)

#2 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 04 January 2005 - 05:41 AM

I've noticed that NPC's tend to have several copies of themselves at different levels.
I wonder, if, to make such a thing easier, would it be possible to take an average of the party's combined XP and assign that to the character? Depending on whether the party was a higher XP than it was before?

You mean script so that the NPC gets the average experience in the party? No, I'm afraid that wouldn't be possible, at least not to make it "easier". There is no simple way of calculating the average experience in the party, and if you want to do so, you're in for a bit of really advanced scripting.

It would be possible to only have one creature-file and script the experience based on the PC's experience raging from one certain value to another, but this has drawbacks, since your NPC wouldn't be leveled up as the Bioware-NPC's are.

What you want to do is to read CamDawg's tutorial on this matter. This is a question that has been discussed before, and you can find the tutorial here.

I was thinking sort of a gametime timer, which, every time it reached a certain point, would add onto a variable, which would be the number of, say AdventuresHad, and to prevent repitition, telling a tale would add on to a variable called, say, AdventuresTold.

Timers are widely used in mods and in the game. It doesn't work exactly like you describe it, but yes, it's fully possible to do what you ask if you tweak it a bit. Multiple mods already do similar things to what you suggest, so I would advise you to look at them for examples.

Of course, if these are doable, and you'd like to use them in your own NPC, feel free. My only demand is being noted in the readme's credits.  :)

Right. Well, considering the fact that none of these ideas are new and has been done before, I'm sure you'll forgive me if I won't add you to the credits-list of my already released mods which, incidentally, use timers and spawns NPC's in a seamless fashion.

Besides, there's always someone who's "first" with an idea. I don't see many readme's looking like "Thanks to [name] for finding out how to do this 2 years ago and thanks to [name] for coming up with this idea", etc.

Edited by SConrad, 04 January 2005 - 05:42 AM.

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


#3 Mayday

Mayday
  • Member
  • 18 posts

Posted 04 January 2005 - 06:51 AM

I've noticed that NPC's tend to have several copies of themselves at different levels.
I wonder, if, to make such a thing easier, would it be possible to take an average of the party's combined XP and assign that to the character? Depending on whether the party was a higher XP than it was before?

You mean script so that the NPC gets the average experience in the party? No, I'm afraid that wouldn't be possible, at least not to make it "easier". There is no simple way of calculating the average experience in the party, and if you want to do so, you're in for a bit of really advanced scripting.

It would be possible to only have one creature-file and script the experience based on the PC's experience raging from one certain value to another, but this has drawbacks, since your NPC wouldn't be leveled up as the Bioware-NPC's are.

What you want to do is to read CamDawg's tutorial on this matter. This is a question that has been discussed before, and you can find the tutorial here.

I was thinking sort of a gametime timer, which, every time it reached a certain point, would add onto a variable, which would be the number of, say AdventuresHad, and to prevent repitition, telling a tale would add on to a variable called, say, AdventuresTold.

Timers are widely used in mods and in the game. It doesn't work exactly like you describe it, but yes, it's fully possible to do what you ask if you tweak it a bit. Multiple mods already do similar things to what you suggest, so I would advise you to look at them for examples.

Of course, if these are doable, and you'd like to use them in your own NPC, feel free. My only demand is being noted in the readme's credits.  :)

Right. Well, considering the fact that none of these ideas are new and has been done before, I'm sure you'll forgive me if I won't add you to the credits-list of my already released mods which, incidentally, use timers and spawns NPC's in a seamless fashion.

Besides, there's always someone who's "first" with an idea. I don't see many readme's looking like "Thanks to [name] for finding out how to do this 2 years ago and thanks to [name] for coming up with this idea", etc.

View Post


Hm, they have? In the context that I describe?
I've never seen them done, but then, I don't have every mod. Or maybe I haven't been looking hard enough, eh? Of course I wouldn't expect any kudos for ideas I wasn't the first with. Really, though, I haven't ever heard of using a timer that starts with rejection from party, or rejection for joining on introduction to simulate the NPC having a life of their own. I'd be very interested in playing any mod that did. I just thought it would alleviate the appearance that the NPC had just been 'waiting by the phone' so to speak.

The problem with Camdawg's way, there, considering what I'd like to do, is that I'd want it to be working even after he'd joined the party and been kicked. And that would simply cause him to be deleted with all his stuff, wouldn't it? I mean, if there were a way around that, it would be fantastic.

I suppose that even if I were to add effects and spells to the creature file... somehow, it would still request the level up, wouldn't it? So that wouldn't be seamless either... I suppose seamlessness could be increased by using Camdawgs method before the party is joined, and the experience up method after he has left the party... maybe.

Hm, there's no way to check party XP? Bum. Ah well, have to learn the constraints of the Engine, I suppose. That way if I decide to do everything bar the actual coding, I'll at least not be requesting anything impossible of the coder, and I'll be able to add notes to show what should happen.

#4 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 04 January 2005 - 07:22 AM

Hm, they have? In the context that I describe?
I've never seen them done, but then, I don't have every mod. Or maybe I haven't been looking hard enough, eh? Of course I wouldn't expect any kudos for ideas I wasn't the first with. Really, though, I haven't ever heard of using a timer that starts with rejection from party, or rejection for joining on introduction to simulate the NPC having a life of their own. I'd be very interested in playing any mod that did. I just thought it would alleviate the appearance that the NPC had just been 'waiting by the phone' so to speak.

There are multiple ways of doing what you speak of. Many mod-NPC's do have life of their own, even though it may not be based upon timers.

Besides, I'm not sure it will give you the effect you seek. There might be problems with continuity and consistency. You say you want the NPC to have tales to tell? In that case, I'd advise you to let the NPC leave that specific are for some time, to reflect the fact that s/he's actually away. Hypothetically, the player could stay in the area where your NPC is during the entire duration of the timer. Will it not look strange if the player has seen the NPC there the whole time, but then s/he suddenly begins speaking of adventures?

And, what if you let the NPC leave, and the player wants to pick up your NPC while s/he's away? Sure, CHARNAME can stick around and wait for the NPC to get back, but it's likely to irritate many players. Are you willing to sacrifice the ease of getting the NPC (at all, in some cases) to join for him having a bit of life?

Not to mention the extra work. Most players download a NPC to have him/her in the party.

There are more factors in this issue. What I've taken up is just a few examples.

The problem with Camdawg's way, there, considering what I'd like to do, is that I'd want it to be working even after he'd joined the party and been kicked. And that would simply cause him to be deleted with all his stuff, wouldn't it? I mean, if there were a way around that, it would be fantastic.

Naturally you can work around it. Set a few variables, and that's it.

I suppose that even if I were to add effects and spells to the creature file... somehow, it would still request the level up, wouldn't it? So that wouldn't be seamless either... I suppose seamlessness could be increased by using Camdawgs method before the party is joined, and the experience up method after he has left the party... maybe.

Eh, I don't really understand that. If you do it right, the game will not "request the level up". You can level up the character ingame, and then export him. Piece of cake. Or, you can modify the level and experience in NI or DLTCEP. Piece of cake.

Hm, there's no way to check party XP? Bum. Ah well, have to learn the constraints of the Engine, I suppose. That way if I decide to do everything bar the actual coding, I'll at least not be requesting anything impossible of the coder, and I'll be able to add notes to show what should happen.

Of course you can check the XP.

XP(O:Object*,I:XP)

Which means that you can have this in a script:

IF
XP(Player1,X)
THEN RESPONSE #100
DoStuff()
END

The problem is that this is only for player 1, i.e. the PC.

Oh, did I mention that if you go this way, it will only be valid when the experience is exactly X. If you want to have one script-block for every number between 0 and 2950000 (or 8000000 for ToB), it's up to you, but I would advise against it. Not to mention the insane amount of work you're in for, the script will be big enough to cause problems on certain computers.

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


#5 Mayday

Mayday
  • Member
  • 18 posts

Posted 04 January 2005 - 07:47 AM

I was intending for a short amount of time for the NPC to have gone, which wouldn't be excessive. The tales would only need to be small ones, after all, wholly taking place in Athkatla. And if I were to have the NPC re-enter the area, I would be able to have a certain level of a proper look to it.

You do make an excellent point about people using NPC mods to keep them in the party, though. Perhaps I should think on this and come up with other methods. Or not.

As for the experience modifying thing, thanks for that. I was unsure whether the game would give the + level up sign in any case.

Just to clarify what I was saying there, though, I meant that one could use the seamless replacement of NPC's with higher level copies until the NPC had already been in the party, and then use the script to simply add experience or change exprience levels after that. Is there no way of creating a random number generator in the game? If you could, you could set the XP to that of the leader, and then simply vary it with the random number generator, couldn't you?

And I certainly wouldn't use a script that would allow such constant updating of the XP. I would merely intend for it to be used whenever the player enters the same parent area as where the NPC would be at. I understand the idea is to keep all these variable checks and such done as little as possible. I may have only a little scripting experience, but I'm a serious efficiency freak. Not that that's a bad thing.

#6 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 04 January 2005 - 08:09 AM

I was intending for a short amount of time for the NPC to have gone, which wouldn't be excessive. The tales would only need to be small ones, after all, wholly taking place in Athkatla. And if I were to have the NPC re-enter the area, I would be able to have a certain level of a proper look to it.

That would probably be wise, yes.

You do make an excellent point about people using NPC mods to keep them in the party, though. Perhaps I should think on this and come up with other methods. Or not.

Don't get me wrong, it's a good idea, but I'm just questioning putting a lot of work into something that won't be displayed to 8/10 users.

As for the experience modifying thing, thanks for that. I was unsure whether the game would give the + level up sign in any case.

No, it won't.

Just to clarify what I was saying there, though, I meant that one could use the seamless replacement of NPC's with higher level copies until the NPC had already been in the party, and then use the script to simply add experience or change exprience levels after that.

This is the thing - you can't script level. You can only script experience. So, you can increase the experience through scripting, but not level.

Is there no way of creating a random number generator in the game? If you could, you could set the XP to that of the leader, and then simply vary it with the random number generator, couldn't you?

I suppose you could work around the game mechanics to get the random number generator you desire. It will take a bit of scripting, though. The problem is that you can't check the exact amount of experience the party leader has unless you do it the way I describe in my previous post.

And I certainly wouldn't use a script that would allow such constant updating of the XP. I would merely intend for it to be used whenever the player enters the same parent area as where the NPC would be at. I understand the idea is to keep all these variable checks and such done as little as possible. I may have only a little scripting experience, but I'm a serious efficiency freak. Not that that's a bad thing.

No, I'm not suggesting updating the XP.

XP(O:Object*,I:XP) means that if [O:Object*] (in this case, Player1) has [I:XP] (a certain specific value of XP), the conditions of the script will turn out True(). Then, you can do whatever you wish, and the game will proceed with it, i.e. my demonstration of DoStuff() (which isn't a real action, btw) can really be anything.

The problem is that if you script

IF
XP(Player1,200000)
THEN RESPONSE #100
DoStuff()
END

the game will here only see the triggers as True() when the XP of Player1 is exactly 200000. If it is 200001, the trigger will be False(), and the game will proceed to the next block in the script. So, if you want to know the exact value of the xp, you have to script

IF
XP(Player1,1)
THEN RESPONSE #100
DoStuff()
END

IF
XP(Player1,2)
THEN RESPONSE #100
DoStuff()
END

etc. all the way up to 8000000. You could have this script in the specific area, if you wish. So, for example, if the player enters and has a XP-value of 235476, then the only block of the 8000000 to turn out True() will be

IF
XP(Player1,235476)
THEN RESPONSE #100
DoStuff()
END

Hence, we use XPLT(O:Object*,I:XP) and XPGT(O:Object*,I:XP) instead of XP. LT stands for Less Than, and GT stands for Greater then. So, here we're dealing with ranges of values. See here;

IF
XPGT(Player1,280000)
XPLT(Player1,600001)
THEN RESPONSE #100
DoStuff()
END

the trigger will now turn out True() if the XP of Player1 is 280001 or larger, up to 600000.

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


#7 Mayday

Mayday
  • Member
  • 18 posts

Posted 04 January 2005 - 08:29 AM

Ah, the late night light finally goes on!
Now I see what you mean about the experience check, thing. Yes, that'd be hell to script that. Heh!

I agree that the best way would be to test it for every time the main character hit a certain xp number, and then just assign an xp close to that number to the NPC.

As for it being a lot of work for the tales, dialogue wise, it isn't. I have something of a gift when it comes to creating dialogue, in that I can think up quite a lot.
Once I got the hang of the code and how it would work, it should largely be a copyable script.