You guys are going to hate me... as I have explained before I am not a scripter, I can muddle my way through a script and figure out what if will do, but cant write a script from scratch. Anyway I need some help with at least 4 more scripts, most of them may even be the same issues... basically what happens with all of the is when I buy an item say flint that I can use later to create a campfire, or a tent for later resting. a tent or a campfire will randomly appear somewhere else in the mod near another player. or with the tent when clicked later to open a convo to ask the player to pack up the tent it packs up the tent and then right away spawns in another tent in front of the player... It may also be an Onaquire or Onactivate Mod script, I can send thos along as well if you wan to look at that...
Script one: This is my camfire script that when you use flint, a campfire appears next to the player...
#include "x2_inc_switches"
void main()
{
if (GetUserDefinedEventNumber() != X2_ITEM_EVENT_ACTIVATE)return;
object oPC;
object oTarget;
object oSpawn;
location lTarget;
oPC = GetItemActivator();
lTarget = GetItemActivatedTargetLocation();
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "rr_campsite", lTarget);
}
script two: This is my tent script, in a convo, that asks you to pack up the tent, when you do,this script fires and it spawns in another tent in front you and puts the tent bundle back in your inventory...
#include "x2_inc_switches"
void main()
{
if (GetUserDefinedEventNumber() != X2_ITEM_EVENT_ACTIVATE)return;
object oPC = GetPCSpeaker();
object oTarget;
oTarget = OBJECT_SELF;
DestroyObject(oTarget, 0.0);
//Give Item
CreateItemOnObject("geo_tent", oPC);
}
and finally my Horse script... When I buy a horse mount/dismount tool from a merchant, it immediatly opens the convo that lets you mount/dismout your horse...
#include "x2_inc_switches"
void main()
{
if (GetUserDefinedEventNumber() != X2_ITEM_EVENT_ACTIVATE)return;
object oPC;
object oTarget;
oPC = GetItemActivator();
//The PC will technically start a conversation with himself
//You should add some odd little sound to the first line in the
//conversation file, or the PC will give his normal voicegreeting.
oTarget = oPC;
AssignCommand(oTarget, ActionStartConversation(oPC, "luc_convo"));
}