Jump to content

Home

Scripting Issue


MasterWaffle

Recommended Posts

I was wondering if anyone can tell me what's wrong with the script below. It isn't working, although the script it's supposed to be replacing seems to be, along with the creature spawning script it's for. (IE: mangriff_26 works when attached to a dialog)

 

void main()
{

    object oEntering = GetEnteringObject();
    object oPC=GetFirstPC();

    if (GetIsPC(oEntering))
    {

         if (GetIsObjectValid(GetObjectByTag("man26_griff_03")))
         {
              ExecuteScript("mangriff_26", OBJECT_SELF);
         }     
    }

    ExecuteScript("old_k_pman_26a_load", OBJECT_SELF);
}

 

Any ideas?

Link to comment
Share on other sites

I was wondering if anyone can tell me what's wrong with the script below. It isn't working, although the script it's supposed to be replacing seems to be, along with the creature spawning script it's for. (IE: mangriff_26 works when attached to a dialog)

 

(snip)

 

Any ideas?

 

The name of the second script, old_k_pman_26a_load, is too long. A resource file name can be at most 16 characters in length (that one is 19).

 

What is the script supposed to do? Currently it should run the script mangriff_26.ncs if the character triggering the script is a Player Character and an object with the tag man26_griff_03 exists in the area.

Link to comment
Share on other sites

The name of the second script, old_k_pman_26a_load, is too long. A resource file name can be at most 16 characters in length (that one is 19).

 

What is the script supposed to do? Currently it should run the script mangriff_26.ncs if the character triggering the script is a Player Character and an object with the tag man26_griff_03 exists in the area.

 

It's supposed to trigger mangriff_26 if the object does not exist.

Link to comment
Share on other sites

if it is supposed to check that it does not exist then you need to change it as follows.

 

(!GetIsObjectValid(GetObjectByTag("man26_griff_03")))

 

In the current script above it checks if the object is valid if it is valid then it fires. Rather the edit I just listed above will fire the script if the object is "not" valid. You can also have a test for a false as below.

 

(GetIsObjectValid(GetObjectByTag("man26_griff_03")) == FALSE)

 

However it has been mentioned before that this is not 100% reliable even though programmatically it should be for an "IF" statement.

Link to comment
Share on other sites

if it is supposed to check that it does not exist then you need to change it as follows.

 

(!GetIsObjectValid(GetObjectByTag("man26_griff_03")))

 

In the current script above it checks if the object is valid if it is valid then it fires. Rather the edit I just listed above will fire the script if the object is "not" valid. You can also have a test for a false as below.

 

(GetIsObjectValid(GetObjectByTag("man26_griff_03")) == FALSE)

 

However it has been mentioned before that this is not 100% reliable even though programmatically it should be for an "IF" statement.

 

Hmm, I fixed that issue and it's still not working. I wonder if it has something to do with replacing the wrong script?

Link to comment
Share on other sites

Hmm, I fixed that issue and it's still not working. I wonder if it has something to do with replacing the wrong script?

 

How does your script look currently? You can check in the .ARE file in a module what the different event scripts associated with its area is called, to be sure you substitute the correct one.

Link to comment
Share on other sites

How does your script look currently? You can check in the .ARE file in a module what the different event scripts associated with its area is called, to be sure you substitute the correct one.

 

That was it. It wasn't with the scripts under the module in KT so I had to use FindRefs. Thus my confusion. It works now.

 

Thanks for the help, stoffe & Darkkender!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...