Author Topic: Looking for help with making a simple "Unique Power Self only" script  (Read 576 times)

Legacy_Raven_blood123

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0


               Hello all;

Too bad for the switch, the old Bioware forum will be missed '<img'> My hopes for the newer generations to keep the D&D game alive!

Anywho, as my topic states, im not really here for my condulence about the forums, but rather something that ive utterly failed at doing: and thats scripting.

Now dont try to tell me that "scripting is easy" or "there are other things to help you" because for 1: yes i have tried scripting, it is most certainly NOT easy after nearly 5 years of studying it, I STILL dont get it. And 2: I do in fact have a system that helps me, which is why i rarely make an appearance on such forums lol
=================================================================================================
Now that the formailities are outta the way my thought was to create a simple power self only script from a small item that would merely produce a sound.

The idea was to create a judge hammer for In-game court halls and such. Now ive already picked out the parts i need, i just need to find a way to  get them all working >.<

My idea was to use Lilac Soul's Script Generator to create such an item, yet it failed through my illsuion that i understood how to do it exactly lol

So far i have the Item labeled "Judge Knocker" and the sound that will be produced "as_cv_hammering2" All i want is someone to show me exacrly how to do it wether it be step-by-step or all at once. any help is greatly appreciated
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Looking for help with making a simple "Unique Power Self only" script
« Reply #1 on: August 05, 2010, 09:08:08 am »


               Something like so:

#include "x2_inc_switches"
void main()
{

int nEvent =GetUserDefinedItemEventNumber();
if(nEvent !=  X2_ITEM_EVENT_ACTIVATE)return;

object oPC = GetItemActivator();
AssignCommand(oPC, PlaySound("as_cv_hammering2"));
}

Assuming you have tag based scripting activated as most people do, whatever tag your item has, save this script as the exact same name as the tag.

Now when you use that item it will seek out this script and run it. That's it.

You'll notice there is a check at the top of the script. It just checks to make sure that this script is being fired because someone used an item and not acquired an item or unacquired an item or whatever.

One thing to note though. This script will play the sound from the person who used the item. This sometimes makes it difficult for people who aren't very close to hear it. So there are other options if you find that it is too quiet for other players to hear.

Hope that helps. Good luck.
               
               

               
            

Legacy_Raven_blood123

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Looking for help with making a simple "Unique Power Self only" script
« Reply #2 on: August 06, 2010, 01:53:30 am »


               wow! thats great! thanks GhostOfGod , thats actualy what ive been looking for :3



Now about this tag based scripting activation? i am unsure of this, is it something within the toolset or aset into the script base itself?



other than that, it was most helpful and i think i understand most of what was going on. my idea was for it to be heard within a hearing distance of, per say, just an area. Though a limited ranged effect would work nicely too...
               
               

               
            

Legacy_TSMDude

  • Hero Member
  • *****
  • Posts: 1515
  • Karma: +0/-0
Looking for help with making a simple "Unique Power Self only" script
« Reply #3 on: August 06, 2010, 01:59:18 am »


               It is on by default if this is a new module. You would have had to turn it off yourself if you did a bit ago.
               
               

               
            

Legacy_Raven_blood123

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Looking for help with making a simple "Unique Power Self only" script
« Reply #4 on: August 06, 2010, 08:04:09 am »


               ah i see, very well my thanks also TSMDude



I shall report back if all went well or not, wish me luck! lol
               
               

               
            

Legacy_Raven_blood123

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Looking for help with making a simple "Unique Power Self only" script
« Reply #5 on: August 09, 2010, 07:21:30 pm »


               ok;



im not sure f i did it right or wrong, but i  cant seem to get the script to work. I did as was provided for me by "GhostOfGod" and named the sript off the tag of the item? (if that is correct then that is what i did) i set the item to item activate (upon the PC) and nothing happend :-|
               
               

               
            

Legacy_420

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
Looking for help with making a simple "Unique Power Self only" script
« Reply #6 on: August 10, 2010, 01:15:07 am »


               

Raven_blood123 wrote...

ok;

im not sure f i did it right or wrong, but i  cant seem to get the script to work. I did as was provided for me by "GhostOfGod" and named the sript off the tag of the item? (if that is correct then that is what i did) i set the item to item activate (upon the PC) and nothing happend :-|

Check to make sure you are using the default OnModuleLoad script (x2_mod_def_load).

Next, check to see if the script is firing at all by putting this in the script:

SendMessageToPC(GetItemActivator(), "Script fired.");

If the script is firing but not doing what you want post your script here.

-420
               
               

               
            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
Looking for help with making a simple "Unique Power Self only" script
« Reply #7 on: August 11, 2010, 11:29:13 pm »


               He probably didn't save the script under the tagname of the item...



Secondly, he said he is using Unique Power Self Only, therefore, he needs to apply the property to the item:   Cast Spell: Unique Power Self Only, to use this special property (eg. make a sound)
               
               

               
            

Legacy_420

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
Looking for help with making a simple "Unique Power Self only" script
« Reply #8 on: August 12, 2010, 06:45:57 am »


               

Genisys wrote...

He probably didn't save the script under the tagname of the item...

Secondly, he said he is using Unique Power Self Only, therefore, he needs to apply the property to the item:   Cast Spell: Unique Power Self Only, to use this special property (eg. make a sound)

I believe those issues were addressed in the above post:

Raven_blood123 wrote...

ok;

im not sure f i did it
right or wrong, but i  cant seem to get the script to work. I did as was
provided for me by "GhostOfGod" and named the sript off the tag of the
item? (if that is correct then that is what i did) i set the item to
item activate (upon the PC) and nothing happend :-|


-420