Author Topic: Stumped over why this script wont work.  (Read 8753 times)

Ser Red Ronnet Connington

  • Guest
Stumped over why this script wont work.
« on: June 01, 2006, 04:02:40 PM »
object oItem;
/*   Script generated by
Lilac Soul's NWN Script Generator, v. 2.3

For download info, please visit:
http://nwvault.ign.com/View.php?view=Other...&id=4683&id=625    */

void main()
{
object oPC;

if (!GetIsPC(GetItemActivatedTarget())
){

SendMessageToPC(GetItemActivator(), "Thats not a PC!");
return;}

if (GetItemPossessedBy(oPC, "kovkey")== OBJECT_INVALID)
   {
   oPC = GetItemActivatedTarget();

   CreateItemOnObject("kovkey", oPC);

   oPC = GetItemActivator();

   FloatingTextStringOnCreature("You have been given the KoV Members and Guests Key! You have tempory access to some of the members only restricted areas of the mod!", oPC);

   }
else if (GetItemPossessedBy(oPC, "kovkey")!= OBJECT_INVALID)
   {
   oPC = GetItemActivatedTarget();

   oItem = GetFirstItemInInventory(oPC);

   while (GetIsObjectValid(oItem))
      {
      if (GetTag(oItem)=="kovkey") DestroyObject(oItem);

      oItem = GetNextItemInInventory(oPC);
      }

   oPC = GetItemActivator();

   FloatingTextStringOnCreature("The KoV Members and Guests Key has been removed! You no longer have access to the restricted areas of the mod!", oPC);

   }
}

Ok stumped at why this script is not working. It compiles properly. It does half it should and then fails me.

Ok the script is a unique power script, based on a tool that targets PC's, when it targets a PC the script is supposed to see if the PC has an item by the tag "kovkey"; if it does not have it, its supposed to add it onto the PC and send the message thats shown above.

It does all that fine.

The problem im having is, when the PC targeted has the item "kovkey" or any number of those items. Its supposed to delete them from his/her inventory and then state the message above.

It does not do that, what it does is each time i target myself for instance, (and i have the item from the mod load up) is just add the item, then it states the first message above.

Any help would be appreciated.
« Last Edit: June 01, 2006, 04:03:47 PM by Ser Red Ronnet Connington »

Offline Talon

  • Hero Member
  • *****
  • Posts: 88772
    • View Profile
    • http://
    • Email
Stumped over why this script wont work.
« Reply #1 on: June 01, 2006, 05:59:55 PM »
Is the tag of the blueprint "kovkey" set to "kovkey"?
I would double-check that.

Ser Red Ronnet Connington

  • Guest
Stumped over why this script wont work.
« Reply #2 on: June 01, 2006, 06:00:33 PM »
Quote
Is the tag of the blueprint "kovkey" set to "kovkey"?
I would double-check that.
[snapback]29112[/snapback]

It is yes

Another problem ive found is.. the messages dont seem to go to the targeted PC, instead they go to the PC who used to Tour Tool, the tool that initiates the whole script.

Bloody hate being limited to lilac... its pathetic for tools
« Last Edit: June 01, 2006, 06:02:26 PM by Ser Red Ronnet Connington »

Offline WitchHunter_Z

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • http://
Stumped over why this script wont work.
« Reply #3 on: June 01, 2006, 06:01:07 PM »
Its working now isn't it? It seemed to when I entered earlier tonight, was given on entry and kept me out of places when we did them tests

Ser Red Ronnet Connington

  • Guest
Stumped over why this script wont work.
« Reply #4 on: June 01, 2006, 06:03:59 PM »
Quote
Its working now isn't it? It seemed to when I entered earlier tonight, was given on entry and kept me out of places when we did them tests
[snapback]29114[/snapback]

Oh that works fine yes ... thats not the issue. If u read up ul see the problem is the second function of the script is not working

Offline WitchHunter_Z

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • http://
Stumped over why this script wont work.
« Reply #5 on: June 01, 2006, 06:06:13 PM »
ah I see, meh, didn't see the last  few lines of the post

Offline Talon

  • Hero Member
  • *****
  • Posts: 88772
    • View Profile
    • http://
    • Email
Stumped over why this script wont work.
« Reply #6 on: June 01, 2006, 06:59:11 PM »
I see your problem:

oPC is not defined before you call GetItemPossessedBy.

A simple fix is to replace:
"object oPC;"
with
"object oPC = GetItemActivatedTarget();"

Additionally, remove all of the:
"oPC = GetItemActivator();"
and the text will be displayed on the person you target, instead of yourself.

The script still sucks, but that will make it work.

Offline Mo

  • Administrator
  • Hero Member
  • *****
  • Posts: 3051
    • MSN Messenger - cochy@msn.com
    • View Profile
    • http://lucidmagic.net
    • Email
Stumped over why this script wont work.
« Reply #7 on: June 01, 2006, 07:17:06 PM »
Har har Talon said it sucks
har har har *points and laughs*  :tease:

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
Stumped over why this script wont work.
« Reply #8 on: June 01, 2006, 10:56:28 PM »
Quote
Har har Talon said it sucks
har har har *points and laughs*  :tease:
[snapback]29118[/snapback]

From best to worst scripting:

1. Floodgate Shadows of Undrentide (Used community scripts)

2. Bioware NWN Original Campaign (Scripts made by the people who wrote the language)

3. Lilac Soul's Script Generator (Better than the next one)

4. Bioware Hordes of the Underdark (couldn't make it multiplayer because Jay Watamaniuk's idiot nephew used GetFirstPC in every conversation instead of GetPCSpeaker)

-420

Ser Red Ronnet Connington

  • Guest
Stumped over why this script wont work.
« Reply #9 on: June 02, 2006, 08:40:57 AM »
Quote
The script still sucks, but that will make it work.
[snapback]29117[/snapback]

Thanks alot, it works perfectly now.

Offline Mo

  • Administrator
  • Hero Member
  • *****
  • Posts: 3051
    • MSN Messenger - cochy@msn.com
    • View Profile
    • http://lucidmagic.net
    • Email
Stumped over why this script wont work.
« Reply #10 on: June 02, 2006, 03:05:39 PM »
Quote
From best to worst scripting:

1. Floodgate Shadows of Undrentide (Used community scripts)

2. Bioware NWN Original Campaign (Scripts made by the people who wrote the language)

3. Lilac Soul's Script Generator (Better than the next one)

4. Bioware Hordes of the Underdark (couldn't make it multiplayer because Jay Watamaniuk's idiot nephew used GetFirstPC in every conversation instead of GetPCSpeaker)

-420
[snapback]29123[/snapback]

You can't play HotU multiplayer?

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
Stumped over why this script wont work.
« Reply #11 on: June 02, 2006, 03:46:06 PM »
Quote
You can't play HotU multiplayer?
[snapback]29134[/snapback]

Officially HotU does not support multiplayer even though it lists the connection requirments for multiplayer on the box.

This was a big stink when HotU first came out and I found it odd that Bioware made it clear on the forums that they had no intention of fixing this. This, of course, prompted me to crack open HotU and see what the deal was.

The basic problem is that one of Jay Watamaniuk's relatives, Preston Watamaniuk, did a bunch of the scripting but since he used GetFirstPC instead of GetPCSpeaker in every conversation file the NPC always looks for the various plot items/local variables on the last PC to log into the server instead of the speaker or party leader. This also causes everyone but the last PC to get stuck in cutscenes.

Also, in certain places, everyone needs to have a certain plot item. Like the "grappling hook" in act 3. There are a few ways to get around it but it's a pain in the ass.

There are quite a few multiplayer-enabled versions of HotU on the NWVault but with some work you can get though the Official HotU compaign with some workarounds.

For instance, to start HotU have one player go through the first cutscene and get to his room in the inn then have everyone else log in so they go to the inn room and don't get stuck in the cutscene area. You may have to save/reload before other can join without getting stuck, I forget.

Throbble and I have gone through HotU together and we may have gone through with Cuchulann at one point but it was a long time ago.

I hope they never let Preston near another product or Bioware will become known for it's shitty games.

-420