Just wondering...

This forum is for those interested in discussing NWN scripting.

Moderators: DM_eaze, Luceran, DM_Jaydaan, ST_DM_Myle, dm_xeen1, DM Nexus, DM_TrainWrek, Carpe_DM1, DM_Unicorn, DM_Griphon, DM_Shadowlands, dm_zane, DM_Centaur, DM_Mystic, DM Rendyll, DM_Avalon

User avatar
driller
Site Admin
Site Admin
Posts: 4792
Joined: Tue Jul 04, 2006 8:52 am
Contact:

Post by driller »

Try this:

http://nwvault.ign.com/View.php?view=Sc ... il&id=1469

-driller
Mer`Zikain wrote:I'm workin on a dying script and having a bit of trouble. The EffectHitPointChangeWhenDying function isn't working for me at all. The character just lays there and there's never any change in hp. So I setup a different method to make concurrent calls to a dying function of my own design. The problem with it is that it shows "someone damages you..." when the script executes instead of "you're bleeding to death".

I'm not sure why the hp change effect isn't working. The example at nwnlexicon is bugged as all get out, they even spelled the visual effect wrong :P

How does yours work? ^^;
Mer`Zikain
Count
Count
Posts: 105
Joined: Thu May 31, 2007 2:09 pm

Post by Mer`Zikain »

I've been looking over that and testing with it since you posted the link. Some things I'm having a little trouble with.

For one, I can make the players blind while sleeping now but I can't remove the blindness if the rest is interrupted or cancelled. Works fine when the rest is finished. I sent the event type as a message to the pc and it shows the right type (3 for cancelled) but it's not executing the cancelled conditional. The condition is being met but the RemoveEffect isn't working like it should and does for the finished event.

I've noticed that when rest is interrupted on BSK that sometimes the blindness doesn't go away, but it does when rest is cancelled. Any idea what is causing mine to not work right?
User avatar
Caesius
Duke
Duke
Posts: 735
Joined: Wed Jul 05, 2006 8:57 am
Location: Somewhere within the Imaginary Number Domain...

Post by Caesius »

One cheap workaround might be to put a duration on the blindness effect so it stays in effect for the duration of a rest action. That way interrupted sleep may still result in a few more seconds of blindness but at least it would be something that would eventually pass.
The only constant is change.
Mer`Zikain
Count
Count
Posts: 105
Joined: Thu May 31, 2007 2:09 pm

Post by Mer`Zikain »

Well I started out using a duration, but the rest duration varies from what i've seen so it's not a very reliable setup, unless I just did it wrong ^^;
User avatar
Pretty Fly White Guy
Duke
Duke
Posts: 1350
Joined: Tue Jul 04, 2006 4:40 pm
Location: Yorkshire
Contact:

Post by Pretty Fly White Guy »

make the blindness last as long as a level 40 rests for perhaps?
Mer`Zikain
Count
Count
Posts: 105
Joined: Thu May 31, 2007 2:09 pm

Post by Mer`Zikain »

Here's an interesting dilemma. When a player quits, you are storing any changes made to the character. Is that using the ExportSingleCharacter function or something else?
Mer`Zikain
Count
Count
Posts: 105
Joined: Thu May 31, 2007 2:09 pm

Post by Mer`Zikain »

I must know, how are you handling subraces? I see that you're using creature skins like I'm trying to but then you're also using ILR so I'm really confused on how you got that to work. Mine always dump the skin into my inventory unless i turn off ILR which is something i DON'T want to do --;
User avatar
Dugaru327
Baron
Baron
Posts: 96
Joined: Mon Jan 22, 2007 7:23 pm
Location: University of Maryland

Post by Dugaru327 »

Mer`Zikain wrote:Here's an interesting dilemma. When a player quits, you are storing any changes made to the character. Is that using the ExportSingleCharacter function or something else?
Should do that automatically for Server Vault.
Mer`Zikain wrote:I must know, how are you handling subraces? I see that you're using creature skins like I'm trying to but then you're also using ILR so I'm really confused on how you got that to work. Mine always dump the skin into my inventory unless i turn off ILR which is something i DON'T want to do --;
Someone else just asked about this, and I bumped it...
Sincerely,
Father Unen E'lie
Founding elven warrior-stealth monk of the Shining Order Monastery
Mer`Zikain
Count
Count
Posts: 105
Joined: Thu May 31, 2007 2:09 pm

Post by Mer`Zikain »

Been busy for a while and unable to work on my mod. And go figure that as soon as I start working on it again I end up with a ridiculous problem.

The spawner is acting stupid (yet again). I know that when I add a new creature type to the spawnlist script I'm supposed to recompile all three script files again. But for some stupid reason I constantly get a "too many instructions" error. I'm using the same code as before and recompiling everything like before and yet I still get this ridiculous message and no spawn. What could be causing that?
User avatar
driller
Site Admin
Site Admin
Posts: 4792
Joined: Tue Jul 04, 2006 8:52 am
Contact:

Post by driller »

Post your code.

-driller
Mer`Zikain wrote:Been busy for a while and unable to work on my mod. And go figure that as soon as I start working on it again I end up with a ridiculous problem.

The spawner is acting stupid (yet again). I know that when I add a new creature type to the spawnlist script I'm supposed to recompile all three script files again. But for some stupid reason I constantly get a "too many instructions" error. I'm using the same code as before and recompiling everything like before and yet I still get this ridiculous message and no spawn. What could be causing that?
Mer`Zikain
Count
Count
Posts: 105
Joined: Thu May 31, 2007 2:09 pm

Post by Mer`Zikain »

I seem to have found part of the problem but it's kind of confusing as to WHY it's a problem.

I'm using wolves_01_90_300_00_00_a for the tag of the object. Using that it gives me "ERROR: TOO MANY INSTRUCTIONS" when it tries to spawn. But if I increase the number from 1 to 2 or more it works fine. What the crap? --;

So I looked at the script figuring there was some kind of infinite loop or something conflicting with NumCreatures being 1.

for (i=1;i<=GetLocalInt(OBJECT_SELF,"NumCreatures");i++)

That's the loop code and when you replace the get local int with the actual value it doesn't spell "infinite loop"

for (i=1;i<=1;i++)

If i is 1 then i is definitely less than or equal to 1 since 1 = 1. So it should execute the loop once then stop. Yet for some reason it's not doing that.

So then I added an if statement of my own to the script for if NumCreatures == 1. But it still screws up.

What is the deal with just spawning a single instance of a creature as opposed to two or more? I just wanted a spawner for town folk or special NPC villians. It wouldn't make sense that everyone has a twin :P

-------- update --------

I didn't see your post before I made this one. The code is identical to the default code for the mmorpg spawner script and the spawn list change I made for this particular creature is as follows:

}else if(strList == "wolves"){ // WOLVES
list_add_rear_string(OBJECT_SELF,"creature_list","100:wolf001");
return SPAWNER_LIST_CREATE_SUCCESS;

After the failure of my attempt to add a conditional to the spawner script i reverted the script to the way it was originally. I then attempted changing the for to:

for (i=0;i<*get NumCreatures*;i++)

and still have the same problem as before. With that failure I'm at a loss for what else could cause it.
User avatar
driller
Site Admin
Site Admin
Posts: 4792
Joined: Tue Jul 04, 2006 8:52 am
Contact:

Post by driller »

Put in code to debug it.

Code: Select all

for (i=1;i<=GetLocalInt(OBJECT_SELF,"NumCreatures");i++) 
SendMessageToPC(GetFirstPC(),"DEBUG: "+IntToString(GetLocalInt(OBJECT_SELF,"NumCreatures")))';
Tell me what it is doing.

-driller
Mer`Zikain wrote:I seem to have found part of the problem but it's kind of confusing as to WHY it's a problem.

I'm using wolves_01_90_300_00_00_a for the tag of the object. Using that it gives me "ERROR: TOO MANY INSTRUCTIONS" when it tries to spawn. But if I increase the number from 1 to 2 or more it works fine. What the crap? --;

So I looked at the script figuring there was some kind of infinite loop or something conflicting with NumCreatures being 1.

for (i=1;i<=GetLocalInt(OBJECT_SELF,"NumCreatures");i++)

That's the loop code and when you replace the get local int with the actual value it doesn't spell "infinite loop"

for (i=1;i<=1;i++)

If i is 1 then i is definitely less than or equal to 1 since 1 = 1. So it should execute the loop once then stop. Yet for some reason it's not doing that.

So then I added an if statement of my own to the script for if NumCreatures == 1. But it still screws up.

What is the deal with just spawning a single instance of a creature as opposed to two or more? I just wanted a spawner for town folk or special NPC villians. It wouldn't make sense that everyone has a twin :P

-------- update --------

I didn't see your post before I made this one. The code is identical to the default code for the mmorpg spawner script and the spawn list change I made for this particular creature is as follows:

}else if(strList == "wolves"){ // WOLVES
list_add_rear_string(OBJECT_SELF,"creature_list","100:wolf001");
return SPAWNER_LIST_CREATE_SUCCESS;

After the failure of my attempt to add a conditional to the spawner script i reverted the script to the way it was originally. I then attempted changing the for to:

for (i=0;i<*get NumCreatures*;i++)

and still have the same problem as before. With that failure I'm at a loss for what else could cause it.
Mer`Zikain
Count
Count
Posts: 105
Joined: Thu May 31, 2007 2:09 pm

Post by Mer`Zikain »

I have no idea why, but now it's working right. The strange thing is that it was giving me that too many commands error before, but only when i wanted to put single enemy spawns. The NPC spawners didn't have any problems before and still don't and they were generating only one creature at a time. I added the debug anyway just to see what would happen, and added the name of the creature list so i'd know what was what, and it spat out the right number each time. So I'm really quite baffled as to what was causing it and why it's not doing so now.

I do intend to randomize the spawning just a bit though. I'm not too fond of it auto populating the screen to capacity each time. I used to go to the kobold caves a lot in your old BSK mod and i noticed that when i first entered, that area right after the water had a few, maybe 4 kobolds at most, then on my way back out after clearning the cave out there would be like 10 or more. Was that something you did on purpose?

Also is there any way to make sure that the creatures are not spawned in illegal placements? Like how in the tyranoid swamp you'd end up with enemies in the trees or in the sewers you'd have a rat man levitating in the middle of nowhere (could only see him with the camera in the right place in a certain area of the sewer)? That's the main reason I've considered just placing a single spawn point for each enemy instead of making a single spawn point for multiple enemies. I don't want funky placements ^^;
User avatar
driller
Site Admin
Site Admin
Posts: 4792
Joined: Tue Jul 04, 2006 8:52 am
Contact:

Post by driller »

There are several ways to get around funky placements, but the easiest way is to put down waypoints and spawn the creatures on them.

So instead of running a function that gets a random location. Make one that gets a random waypoint. It shouldn't be to hard to do.

Lay down 50 waypoints called "WP_SPAWN" then do something like:

object oWP = GetNearestObjectByTag("WP_SPAWN",Random(50)+1);
location lLoc = GetLocation(oWP);

Then have the spawner make the creature at that location.

-driller

Mer`Zikain wrote:I have no idea why, but now it's working right. The strange thing is that it was giving me that too many commands error before, but only when i wanted to put single enemy spawns. The NPC spawners didn't have any problems before and still don't and they were generating only one creature at a time. I added the debug anyway just to see what would happen, and added the name of the creature list so i'd know what was what, and it spat out the right number each time. So I'm really quite baffled as to what was causing it and why it's not doing so now.

I do intend to randomize the spawning just a bit though. I'm not too fond of it auto populating the screen to capacity each time. I used to go to the kobold caves a lot in your old BSK mod and i noticed that when i first entered, that area right after the water had a few, maybe 4 kobolds at most, then on my way back out after clearning the cave out there would be like 10 or more. Was that something you did on purpose?

Also is there any way to make sure that the creatures are not spawned in illegal placements? Like how in the tyranoid swamp you'd end up with enemies in the trees or in the sewers you'd have a rat man levitating in the middle of nowhere (could only see him with the camera in the right place in a certain area of the sewer)? That's the main reason I've considered just placing a single spawn point for each enemy instead of making a single spawn point for multiple enemies. I don't want funky placements ^^;
Mer`Zikain
Count
Count
Posts: 105
Joined: Thu May 31, 2007 2:09 pm

Re: Just wondering...

Post by Mer`Zikain »

Awesome, that's a great idea. I'll give it a try. Thanks :D
Locked