Neverwinter Nights > Script Request

boot script

<< < (5/6) > >>

Tea-cup:
If I'm right, GetItemActivatedTarget does get the last object that was targetted. Doesn't matters by what. I would get the target when you use the item. Right on that moment. And store the information on the player that is targetting. Then use that information to get the target back when the action is done. Use localstrings or something and a loop to get matches trough the pc's logged on.

-Mel

Daniel1975:

--- Quote ---If I'm right, GetItemActivatedTarget does get the last object that was targetted. Doesn't matters by what. I would get the target when you use the item. Right on that moment. And store the information on the player that is targetting. Then use that information to get the target back when the action is done. Use localstrings or something and a loop to get matches trough the pc's logged on.

-Mel
[snapback]14082[/snapback]
--- End quote ---

hmmm...but wouldn't I need to give every caller another localstring? Or else the problem would be the same or not???

CleTus:

--- Quote ---hmmm...but wouldn't I need to give every caller another localstring? Or else the problem would be the same or not???
[snapback]14102[/snapback]
--- End quote ---

I had the same problem.. This is what I use, and it works.. Put this on you OnActivate Script if you want to..


--- Code: ---location lLocation=GetItemActivatedTargetLocation();
        object oOther = GetItemActivatedTarget();
         object oItemUser = GetItemActivator();
        SetLocalLocation(oItemUser,"location",lLocation);
        SetLocalObject(oItemUser,"object",oOther);

--- End code ---

For your scripts.. Like teleport one.. Put this instead of GetItemActivatedTarget..


--- Code: ---object oUser=GetPCSpeaker();
     object oPC = GetLocalObject(oUser,"object");

--- End code ---

Apply effects to oPC.. You can change the names to go with your script if you want to use it..

Tea-cup:

--- Quote ---
--- Quote ---hmmm...but wouldn't I need to give every caller another localstring? Or else the problem would be the same or not???
[snapback]14102[/snapback]
--- End quote ---

I had the same problem.. This is what I use, and it works.. Put this on you OnActivate Script if you want to..


--- Code: ---location lLocation=GetItemActivatedTargetLocation();
        object oOther = GetItemActivatedTarget();
         object oItemUser = GetItemActivator();
        SetLocalLocation(oItemUser,"location",lLocation);
        SetLocalObject(oItemUser,"object",oOther);

--- End code ---

For your scripts.. Like teleport one.. Put this instead of GetItemActivatedTarget..


--- Code: ---object oUser=GetPCSpeaker();
     object oPC = GetLocalObject(oUser,"object");

--- End code ---

Apply effects to oPC.. You can change the names to go with your script if you want to use it..
[snapback]14384[/snapback]
--- End quote ---
I use a other way. But this looks very fine and easy to add in the scripts you have gwydion. I would use it  :)

My way is to store use that localint part only in the scripts that need it. Other words, the onactivteitem event is justthe origenal for me. And I use it in a bit different way because I want a ban to work even if the target left the game. But you don't need that anyway.

-Mel

Daniel1975:

--- Quote ---
--- Quote ---
--- Quote ---hmmm...but wouldn't I need to give every caller another localstring? Or else the problem would be the same or not???
[snapback]14102[/snapback]
--- End quote ---

I had the same problem.. This is what I use, and it works.. Put this on you OnActivate Script if you want to..


--- Code: ---location lLocation=GetItemActivatedTargetLocation();
        object oOther = GetItemActivatedTarget();
         object oItemUser = GetItemActivator();
        SetLocalLocation(oItemUser,"location",lLocation);
        SetLocalObject(oItemUser,"object",oOther);

--- End code ---

For your scripts.. Like teleport one.. Put this instead of GetItemActivatedTarget..


--- Code: ---object oUser=GetPCSpeaker();
     object oPC = GetLocalObject(oUser,"object");

--- End code ---

Apply effects to oPC.. You can change the names to go with your script if you want to use it..
[snapback]14384[/snapback]
--- End quote ---
I use a other way. But this looks very fine and easy to add in the scripts you have gwydion. I would use it  :)

My way is to store use that localint part only in the scripts that need it. Other words, the onactivteitem event is justthe origenal for me. And I use it in a bit different way because I want a BAN to work even if the target left the game. But you don't need that anyway.

-Mel
[snapback]14397[/snapback]
--- End quote ---

thank you all for helping me!  :D

And yet another question:

Problem:

All items with special powers (like stunner etc.) seem to have a short range only so you have to be very close to the target to activate its power on a player. Is there a way to increase the range? (for example like the range of the spell "fireball" ?)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version