LucidMagic.net

Neverwinter Nights => NwN Building => Topic started by: Xen on September 23, 2004, 01:46:17 AM

Title: Random Script
Post by: Xen on September 23, 2004, 01:46:17 AM
Ok, I know people are gonna request scripts, Or some are embarrased to. I'll make some scripts and just post em. Do not add comments this is not for that. Just scripts if You want to add comments add it at the base of your post AFTER your script.
Title: Random Script
Post by: Xen on September 23, 2004, 01:56:01 AM
//Basic Sit Script (Place OnUsed in an objects "Events" tab)[/span]
[span style=\'color:blue\']void[/span] main()
{
[span style=\'color:blue\']object[/span] oObject = [span style=\'color:blue\']OBJECT_SELF[/span];
[span style=\'color:blue\']object[/span] oUser = GetLatsUsedBy();

AssignCommand(oUser, ActionSit(oObject));
}

[span style=\'color:red\']Heres the basic sit script everyone keeps wanting.
Title: Random Script
Post by: Xen on September 23, 2004, 02:24:28 AM
/*
Basic Conversation starter, You can use it werever you want. Lets say you put it OnUsed in a objects "Events" tag it will fire every tim ethat object is used
*/
[/span][span style=\'color:blue\']void[/span] StartConversation([span style=\'color:blue\']object[/span] oPC)
{
AssignCommand(oPC, ActionStartConversation(PC, "convo resref", [span style=\'color:blue\']TRUE[/span]));
}



[span style=\'color:red\']//Now, the command:[/span]

[span style=\'color:blue\']void[/span] main()
{
[span style=\'color:green\']// In this isntance we are going to use "OnUsed"[/span]
[span style=\'color:blue\']object oUser = GetLastUsedBy();
StartConversation(oUser);
}
Title: Random Script
Post by: Xen on September 23, 2004, 02:51:45 AM
/*
Simple Animation que for placable objects, In this example we are making a Statue that Causes you to worship:
*/[/span]
[span style=\'color:blue\']void[/span] main()
{
[span style=\'color:blue\']object oUser = GetLastUsedBy();

AssignCommand(oUser, ActionPlayAnimation(ANIMATION_LOOPING_WORSHIP,5.0);
}
Title: Random Script
Post by: 420 on September 23, 2004, 12:19:10 PM
//Alternate script for an items OnUsed trigger event, will automatically use the conversation that is specified in the "conversation" field in an objects advanced menu

void main()
{
    object oPC = GetLastUsedBy();
    ActionStartConversation(oPC, "", TRUE, FALSE);
}


(The conversation started is private so as not to bug other players.)

-420
Title: Random Script
Post by: 420 on September 23, 2004, 12:23:58 PM
//Alternate sit script for a chair, checks to make sure no one is already sitting in the chair, goes in the OnUsed event trigger

void main()
{
object oChair = OBJECT_SELF;

  if(!GetIsObjectValid(GetSittingCreature(oChair)))
    {
    AssignCommand(GetLastUsedBy(), ActionSit(oChair));
    }
}