Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

How to give alignment points for specific items?

Page: 1 of 1
 SithRevan
07-23-2006, 12:47 AM
#1
I was wondering if it was possible to give a DS or LS point for getting a specific item, if it is can somebody help me with doing that?
 Princess Artemis
07-23-2006, 1:52 AM
#2
Hmm. You mean when you pick something up? Or if someone gives it to you? The items themselves can't do that, but the way you acquire them, it may be possible to do an alignment shift.

If it's someone giving you the item (i.e., you get it as a result of a dialogue or cutscene), it would be fairly easy to add an alignment shift script to the dialogue that gives you the item, and perhaps say that the item caused the alignment shift, even though technically it didn't.

I'm not sure it's possible to get an alignment shift if you randomly pick up an item, although if the item is in a unique container all the time, it should be possible to add a script to the container that would shift your alignment for opening it, and then you could just say the shift was caused by the contents. Check the scripts for creating items in containers, they should help.

Any specific item you had in mind?
 SithRevan
07-23-2006, 3:00 AM
#3
Actually it was an item the I had created and it is in a unique container, so I guess I will have to look up a script to do an alignment shift and attach it to the container, but thanks for your help anyway.
 stoffe
07-23-2006, 6:06 AM
#4
Actually it was an item the I had created and it is in a unique container, so I guess I will have to look up a script to do an alignment shift and attach it to the container, but thanks for your help anyway.

You could add a script to the OnInvDisturbed event script slot of the container placeable holding the item which checks if an item was taken and if it was your particular item. Here is an example script:

void main() {
if (!GetLocalBoolean(OBJECT_SELF, 140)
&& (GetInventoryDisturbType() == INVENTORY_DISTURB_TYPE_REMOVED)
&& (GetTag(GetInventoryDisturbItem()) == "st_testitem")
&& IsObjectPartyMember(GetLastDisturbed()))
{
AdjustAlignment(GetFirstPC(), ALIGNMENT_DARK_SIDE, 5);
SetLocalBoolean(OBJECT_SELF, 140, TRUE);
}
}


This would give the main character a 5 point Darkside adjustment, once, if a party member picks up an item with the tag st_testitem from the container the script is attached to. :D
 SithRevan
07-23-2006, 9:05 AM
#5
I don't even know what to say your amazing, thanks.
 SithRevan
07-23-2006, 9:30 AM
#6
One question, how would I add an item to that script that would give me a LS point?
 Arбtoeldar
07-23-2006, 9:48 AM
#7
One question, how would I add an item to that script that would give me a LS point?

Change ALIGNMENT_DARK_SIDE to ALIGNMENT_LIGHT_SIDE
 SithRevan
07-23-2006, 10:14 AM
#8
I actually wanted to add two items to that script a darkside item and a light side item.
 stoffe
07-23-2006, 11:16 AM
#9
One question, how would I add an item to that script that would give me a LS point?

Here's a variant using two items. The item with the tag "st_darkitem" gives a darkside adjustment when taken. while the item with the tag "st_lightitem" gives a lightside adjustment. Otherwise the script works like the previous example.


void main() {
if ((GetInventoryDisturbType() == INVENTORY_DISTURB_TYPE_REMOVED)
&& IsObjectPartyMember(GetLastDisturbed()))
{
string sTag = GetTag(GetInventoryDisturbItem());
if (!GetLocalBoolean(OBJECT_SELF, 140) && (sTag == "st_darkitem")) {
AdjustAlignment(GetFirstPC(), ALIGNMENT_DARK_SIDE, 5);
SetLocalBoolean(OBJECT_SELF, 140, TRUE);
}
else if (!GetLocalBoolean(OBJECT_SELF, 141) && (sTag == "st_lightitem")) {
AdjustAlignment(GetFirstPC(), ALIGNMENT_LIGHT_SIDE, 5);
SetLocalBoolean(OBJECT_SELF, 141, TRUE);
}
}
}
 SithRevan
07-23-2006, 11:33 AM
#10
Thank you again that was exactly what I needed.
Page: 1 of 1