Would you like to react to this message? Create an account in a few clicks or log in to continue.

ExecuteScript

2 posters

Go down

ExecuteScript Empty Re: ExecuteScript

Post by Drgnwlkr Tue Aug 16, 2011 5:20 pm

When you add an 'Execute' to an existing script, it goes above the script under void main() ?
Drgnwlkr
Drgnwlkr
Seasoned Explorer
Seasoned Explorer

Number of posts : 180
Age : 59
Main Character : Elladyr the Pathfinder
Other Character : Arauka'dae the Ghost
Other Character. : Adahi Ditlihi, Knight of Dalix
Other Character.. : Aradia the Warblade
Registration date : 2011-04-30

Back to top Go down

ExecuteScript Empty Re: ExecuteScript

Post by The Amethyst Dragon Tue Aug 16, 2011 6:56 pm

You put the ExecuteScript command within the main script. For example, take this script being called within a conversation:

Code:

void main()
{
object oPC = GetPCSpeaker(); // This defines oPC as the player character the NPC is speaking with.
object oNPC = OBJECT_SELF;  // We'll have this called from the NPC's conversation.

SpeakString("I am running some sort of script!  Ha!"); // The NPC says something dumb.

ExecuteScript("metoo", oPC); // player character runs the script called "metoo"

SpeakString("You just had to interrupt me, didn't you?"); // The NPC says something else dumb, after the PC runs the "metoo" script.
}
The Amethyst Dragon
The Amethyst Dragon
Ludicrous Level
Ludicrous Level

. : Creator of Aenea / Dungeon Master
Male Number of posts : 7841
Age : 49
Location : probably on the computer or wrangling his offspring
NWN Username : amethystdragon
DM Name : The Amethyst Dragon
Time Zone : GMT - 6:00 (Wisconsin)
Registration date : 2008-06-02

https://www.amethyst-dragon.com

Back to top Go down

ExecuteScript Empty ExecuteScript

Post by Drgnwlkr Tue Aug 16, 2011 6:59 pm

Ah, thank you Amethyst Dragon. That helps alot =)
Drgnwlkr
Drgnwlkr
Seasoned Explorer
Seasoned Explorer

Number of posts : 180
Age : 59
Main Character : Elladyr the Pathfinder
Other Character : Arauka'dae the Ghost
Other Character. : Adahi Ditlihi, Knight of Dalix
Other Character.. : Aradia the Warblade
Registration date : 2011-04-30

Back to top Go down

ExecuteScript Empty Re: ExecuteScript

Post by Drgnwlkr Wed Nov 09, 2011 7:58 pm

Okay, I was adding some 'include' script to OnClientEnter and got the error:

'x3_mod_def_enter' did not compile.
aps_include.nss: ERROR: DUPLICATE FUNCTION IMPLEMENTATION (VectorToString)

Anyone have any clues? The original script just add the horse menus to the PC and what I was adding...

#include "ldh_pers_hsng"
#include "aps_include"

void main()
{
ldh_OnUnAcquireItem();

...was meant to be part of a housing system I thought about using.
Drgnwlkr
Drgnwlkr
Seasoned Explorer
Seasoned Explorer

Number of posts : 180
Age : 59
Main Character : Elladyr the Pathfinder
Other Character : Arauka'dae the Ghost
Other Character. : Adahi Ditlihi, Knight of Dalix
Other Character.. : Aradia the Warblade
Registration date : 2011-04-30

Back to top Go down

ExecuteScript Empty Re: ExecuteScript

Post by The Amethyst Dragon Wed Nov 09, 2011 8:30 pm

ERROR: DUPLICATE FUNCTION IMPLEMENTATION (VectorToString)

This means that the VectorToString() function is defined in more than one place for your script. Probably in more than one of the "includes" you are using. For a script to compile properly (or at all), no function can be a duplicate of another (at least in name) in the same script (and all includes are considered part of the script you are, um, including them in).
The Amethyst Dragon
The Amethyst Dragon
Ludicrous Level
Ludicrous Level

. : Creator of Aenea / Dungeon Master
Male Number of posts : 7841
Age : 49
Location : probably on the computer or wrangling his offspring
NWN Username : amethystdragon
DM Name : The Amethyst Dragon
Time Zone : GMT - 6:00 (Wisconsin)
Registration date : 2008-06-02

https://www.amethyst-dragon.com

Back to top Go down

ExecuteScript Empty Re: ExecuteScript

Post by Drgnwlkr Wed Nov 09, 2011 8:34 pm

Since the error named aps_include.nss, would that be one of the duplicates?
Drgnwlkr
Drgnwlkr
Seasoned Explorer
Seasoned Explorer

Number of posts : 180
Age : 59
Main Character : Elladyr the Pathfinder
Other Character : Arauka'dae the Ghost
Other Character. : Adahi Ditlihi, Knight of Dalix
Other Character.. : Aradia the Warblade
Registration date : 2011-04-30

Back to top Go down

ExecuteScript Empty Re: ExecuteScript

Post by The Amethyst Dragon Thu Nov 10, 2011 2:23 pm

Drgnwlkr wrote:Since the error named aps_include.nss, would that be one of the duplicates?
Probably.
The Amethyst Dragon
The Amethyst Dragon
Ludicrous Level
Ludicrous Level

. : Creator of Aenea / Dungeon Master
Male Number of posts : 7841
Age : 49
Location : probably on the computer or wrangling his offspring
NWN Username : amethystdragon
DM Name : The Amethyst Dragon
Time Zone : GMT - 6:00 (Wisconsin)
Registration date : 2008-06-02

https://www.amethyst-dragon.com

Back to top Go down

ExecuteScript Empty Re: ExecuteScript

Post by Drgnwlkr Thu Nov 10, 2011 7:32 pm

I've looked through the whole script and there is only 1 aps_include in the script where the error occurred.

Now I have an 'unknown state in compiler' error in another script t\about climate/weather but I did not alter anything around this error and what I did alter was written exactly the way others parts of those 'areas'...meaning when I created a 'mild climate' it was written exactly like the pre-existing 'moderate climate' with just the variable %s changed.
Drgnwlkr
Drgnwlkr
Seasoned Explorer
Seasoned Explorer

Number of posts : 180
Age : 59
Main Character : Elladyr the Pathfinder
Other Character : Arauka'dae the Ghost
Other Character. : Adahi Ditlihi, Knight of Dalix
Other Character.. : Aradia the Warblade
Registration date : 2011-04-30

Back to top Go down

ExecuteScript Empty Re: ExecuteScript

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum