Jump to content

Home

How to give alignment points for specific items?


SithRevan

Recommended Posts

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?

Link to comment
Share on other sites

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 ([color=SkyBlue]!GetLocalBoolean(OBJECT_SELF, 140)[/color]
       && (GetInventoryDisturbType() == [color=Green]INVENTORY_DISTURB_TYPE_REMOVED[/color])
       && (GetTag(GetInventoryDisturbItem()) == "[color=Yellow]st_testitem"[/color])
       && [color=Red]IsObjectPartyMember(GetLastDisturbed())) [/color]
   {
       [color=PINK]AdjustAlignment(GetFirstPC(), ALIGNMENT_DARK_SIDE, 5);[/color]
       [color=SkyBlue]SetLocalBoolean(OBJECT_SELF, 140, TRUE);[/color]
   }
}

 

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

Link to comment
Share on other sites

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 == "[color=Red]st_darkitem[/color]")) {
           AdjustAlignment(GetFirstPC(), ALIGNMENT_DARK_SIDE, 5);
           SetLocalBoolean(OBJECT_SELF, 140, TRUE);
       }
       else if (!GetLocalBoolean(OBJECT_SELF, 141) && (sTag == "[color=SkyBlue]st_lightitem[/color]")) {
           AdjustAlignment(GetFirstPC(), ALIGNMENT_LIGHT_SIDE, 5);
           SetLocalBoolean(OBJECT_SELF, 141, TRUE);        
       }
   }
}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...