Convo Start Conditional problem
#1
Posté 31 août 2014 - 02:37
I have a script that will check the inventory ring slots that compiles and works. The problem starts when I try to loop through the PC inventory. I can't even get anything to compile. Can someone teach me how this can be done ?
Ed
#2
Posté 31 août 2014 - 05:03
Post your code ![]()
- Ed Venture aime ceci
#3
Posté 01 septembre 2014 - 05:27
- Ed Venture aime ceci
#4
Posté 01 septembre 2014 - 05:31
Alternatively, if you know the TAG of the ring you are looking for:
#5
Posté 01 septembre 2014 - 12:24
A million thanks. works like a charm.
The PC drinks to much and wakes in a room with a women.
In convo with the women he must choose between being a nice guy or a cad.
The conditional checks to see if he has a ring (Any).
A second script takes a ring by priority, rightring, leftring, or inventory (The price of being a nice guy).
Thank you again, for moving a little higher on the left side of the learning curve.
Buddywarrior,
Here is the completed script:
/* STARTING CONDITIONAL "sc_has_a_ring" Returns TRUE if PC
has a ring (ANY RING) */
int StartingConditional()
{
object oPC = GetFirstPC();
int nBase = BASE_ITEM_RING;
int nType = OBJECT_TYPE_ITEM;
int nSlotR = INVENTORY_SLOT_RIGHTRING;
int nSlotL = INVENTORY_SLOT_LEFTRING;
object oItem = GetFirstItemInInventory(oPC);
if(GetBaseItemType(GetItemInSlot(nSlotR,oPC)) == nBase ||
GetBaseItemType(GetItemInSlot(nSlotL,oPC)) == nBase)
return TRUE;
while(GetIsObjectValid(oItem))
{
if(GetBaseItemType(oItem) == nBase)
{
return TRUE;
}
oItem = GetNextItemInInventory(oPC);
}
return FALSE;
}
I thank you as well.
Ed
#6
Posté 12 septembre 2014 - 04:42
hey i have a similar problem. I need a script for a quest where you start a conversation with a NPC and if you have a particular brooch in your inventory then one conversation is initiated, and if you don't have the brooch in your inventory, another different conversation is initiated.
#7
Posté 13 septembre 2014 - 12:44
It depends on what you mean by conersations. If it is 2 different conversation files,
object oPC
object oNPC
object oItem = GetItemPossessedBy(oPC,sTagOfItem);
string sConvoA
string sConvoB
if(GetIsObjectValid(oItem))
{
AssignCommand(oNPC,ActionStartConversation(oPC,sConvoA,TRUE));// if they have it do this.
}
else
{
AssignCommand(oNPC,ActionStartConversation(oPC,sConvoB,TRUE));//if not do this.
}
If you mean one file with two NPC nodes, check for the item on the first node. The script wizard can do this for you, or you can put this in the Text Appears script.
object oPC = GetPCSpeaker();
object oItem = GetItemPossessedBy(oPC,sTagOfItem);
if(GetIsObjectValid(oItem))
return TRUE;// Show this node
return FALSE;// don't show it
If the PC does not have the Item The second node will be displayed.
Ed
#8
Posté 13 septembre 2014 - 06:38
thanks but i dont get it. Where do you put the script and when i compile it one line is red. to be exact i want just one conversation file with two nodes that displays one if they have it and the other if they dont. Also i want when you respond to the one that have it, it deducts the brooch from your inventory and gives you some prizes.
#9
Posté 13 septembre 2014 - 02:43
Fumm,
Open the script file.
In the lower right hand corner, you will see several tabs.
The first one is Text Appears.
Click the tab.
Next to the window where script names appear, you will see three icons. The first lets you open a panel that shows all of your exsisting scripts. The second is Edit. It allows you to edit the script in the script window(or start a new one if no script is present. The third (looks like a wizard hat) is the script wizard.
Click on the hat.
A panel will come up asking what conditional to test for.
Click on Item in Inventory. Click next. A panel comes up. enter the Tag of the item and click Add, Click Next. Save the script and finish.
The script should appear in the script window. (By practice I always start the name of a Starting Conditional script with sc_)
To take the item and give rewards click on the Action Taken Tab.
Click on the hat. Choose Take From Player, Click Next. In the next panel enter the Tag of the item and click Add, Click next and save the script. (at_)
To give rewards you can either make a script on the next PC node, or edit the above at_ script.
PC node.
Action Taken, Give Rewards, Add, Save.
Edit.
For gold use the GiveGoldToCreature function.
For items use CreateItemOnObject function.
Save.
Don't be afraid to make a random NPC and give him a simple conversation. This is a good way to explore all of the options in the conversion file. Use script names like sc_test_ and at_test. Later you can always delete the NPC,coversation file, and all of the test scripts.
Practice, practice,practice.
I've been at this going on a couple of years now, and I still have to come here for help.
Ed
#10
Posté 14 septembre 2014 - 02:38
I made a test module and it works! thank you so much





Retour en haut







