This is simple and should do.. Place OnActivate
void main()
{
object oItem = GetItemActivated();
if(GetTag(oItem) == "TAG")
{
object oPC = GetItemActivatedTarget();
BootPC(oPC);
}
}
This way you can copy the if(GetTag(oItem) == "TAG") to add more items if you need.. Just add it under the } under boot, and define the variables again.
[snapback]13868[/snapback]
i would have requested it for an onactivate script if i wanted one.
i just need a very simple boot script that is activated by another script.
-Lord Elessar
can someone give me a way to target something for a script in a conversation?
-Lord Elessar
[snapback]13899[/snapback]
You mean the speaker, or a person that's the target of a item that makes the conv start? Something like a dm wand?
-Mel
Daniel1975:
Sounds to me like you're both getting the same dialog, I don't know if that helps but I've seen it happen :P
[snapback]13916[/snapback]
hmmm so you mean that everyone who gets a teleporter and activates it must get his own dialog window?
Daniel1975:
Sounds to me like you're both getting the same dialog, I don't know if that helps but I've seen it happen :P
[snapback]13916[/snapback]
hmmm so you mean that everyone who gets a teleporter and activates it must get his own dialog window?
[snapback]13917[/snapback]
No, you're useing the same variables or whatever. How you get the target? You do it whit a localint on the module or area? Or you apply variables on the players themself? Or something else?
I use a weird way to get my targets whit my dmwand. But once the target is targetted the target may even leave, the ban will still apply because everything is stored in strings on the itemactivator.
Best way is to post a small piece of code where you think it goes wrong. Posting thinks of my dmwand is pointless because it's working whit a database and selfmade includes. Just will confuse.
-Mel
can someone give me a way to target something for a script in a conversation?
-Lord Elessar
[snapback]13899[/snapback]
You mean the speaker, or a person that's the target of a item that makes the conv start? Something like a dm wand?
-Mel
[snapback]13900[/snapback]
yes bzk should know since i asked him to help me test earlier. I'm looking for a way so that when I click on the choice the conversation closes and a target button pops up like with spells and i click the person i wish to target.
-Lord Elessar
This is simple and should do.. Place OnActivate
void main()
{
object oItem = GetItemActivated();
if(GetTag(oItem) == "TAG")
{
object oPC = GetItemActivatedTarget();
BootPC(oPC);
}
}
This way you can copy the if(GetTag(oItem) == "TAG") to add more items if you need.. Just add it under the } under boot, and define the variables again.
[snapback]13868[/snapback]
i would have requested it for an onactivate script if i wanted one.
i just need a very simple boot script that is activated by another script.
-Lord Elessar
[snapback]13897[/snapback]
Excuse me for not knowing exactly what you wanted when you said 'plain boot script'
can someone give me a way to target something for a script in a conversation?
-Lord Elessar
[snapback]13899[/snapback]
You mean the speaker, or a person that's the target of a item that makes the conv start? Something like a dm wand?
-Mel
[snapback]13900[/snapback]
yes bzk should know since i asked him to help me test earlier. I'm looking for a way so that when I click on the choice the conversation closes and a target button pops up like with spells and i click the person i wish to target.
-Lord Elessar
[snapback]13942[/snapback]
That's like making a selfmade spell (is possible). I think target and then chose is easyer.
I used a list of special ability's for that on the old arivs, to boot ect. Including a nice cast graphic and so. But they nerfed the special ability's (securty/anti-hack) whit patch 1.64 for pc's. So you'll have to do it in a other way. Not yet have a clear idea (6.43am for me, can't think :P)
-Mel
Daniel, just do what i did and give everyone an item that teleports them to certain areas (that way they don't have to keep coming back to the same area)...course i don't know if you are a PvP or an Adventure mod
[snapback]13965[/snapback]
As far I know he use that now, but want's the dialoge way.
Right?
-Mel
ok... i think i have an idea on what im gonna do to do it, but it might be annoying to find the proper functions....
-Lord Elessar
[snapback]14001[/snapback]
I somethimes write a whole script for something where I could use 1 prebuild function for. Learning a lot of nwn function out of your head is useless anyway :P
If you don't know a function, but you think it may already be written. Just ask here.
-Mel
Daniel, just do what i did and give everyone an item that teleports them to certain areas (that way they don't have to keep coming back to the same area)...course i don't know if you are a PvP or an Adventure mod
[snapback]13965[/snapback]
As far I know he use that now, but want's the dialoge way.
Right?
-Mel
[snapback]13991[/snapback]
yes, I do. I don't want to use a single item for every area I want to teleport because then you get a flood of items in your inventory.
I just want a single teleport-item that starts the teleport-conversation with the one who activates it. The script for that item is used in "OnActivateItem" but it only starts the conversation. The teleport-scripts are connected to the conversation.
But this way it doesn't work always as it should...but I told you about the problem already.
I am not at home right now so I can post the teleport-script tomorrow when I am at home again.
I think the error happens because the script doesn't know exactly what player to teleport. There must be a way to make a difference between every player who is activating the teleport-conversation.
Daniel, just do what i did and give everyone an item that teleports them to certain areas (that way they don't have to keep coming back to the same area)...course i don't know if you are a PvP or an Adventure mod
[snapback]13965[/snapback]
As far I know he use that now, but want's the dialoge way.
Right?
-Mel
[snapback]13991[/snapback]
yes, I do. I don't want to use a single item for every area I want to teleport because then you get a flood of items in your inventory.
I just want a single teleport-item that starts the teleport-conversation with the one who activates it. The script for that item is used in "OnActivateItem" but it only starts the conversation. The teleport-scripts are connected to the conversation.
But this way it doesn't work always as it should...but I told you about the problem already.
I am not at home right now so I can post the teleport-script tomorrow when I am at home again.
I think the error happens because the script doesn't know exactly what player to teleport. There must be a way to make a difference between every player who is activating the teleport-conversation.
[snapback]14010[/snapback]
The thing that matter is the part where you get the target (can be the caller too).
The rest of the script is prolly fine.
-Mel
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]
hmmm...but wouldn't I need to give every caller another localstring? Or else the problem would be the same or not???
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]
I had the same problem.. This is what I use, and it works.. Put this on you OnActivate Script if you want to..
location lLocation=GetItemActivatedTargetLocation();
object oOther = GetItemActivatedTarget();
object oItemUser = GetItemActivator();
SetLocalLocation(oItemUser,"location",lLocation);
SetLocalObject(oItemUser,"object",oOther);
For your scripts.. Like teleport one.. Put this instead of GetItemActivatedTarget..
object oUser=GetPCSpeaker();
object oPC = GetLocalObject(oUser,"object");
Apply effects to oPC.. You can change the names to go with your script if you want to use it..
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]
I had the same problem.. This is what I use, and it works.. Put this on you OnActivate Script if you want to..
location lLocation=GetItemActivatedTargetLocation();
object oOther = GetItemActivatedTarget();
object oItemUser = GetItemActivator();
SetLocalLocation(oItemUser,"location",lLocation);
SetLocalObject(oItemUser,"object",oOther);
For your scripts.. Like teleport one.. Put this instead of GetItemActivatedTarget..
object oUser=GetPCSpeaker();
object oPC = GetLocalObject(oUser,"object");
Apply effects to oPC.. You can change the names to go with your script if you want to use it..
[snapback]14384[/snapback]
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
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]
I had the same problem.. This is what I use, and it works.. Put this on you OnActivate Script if you want to..
location lLocation=GetItemActivatedTargetLocation();
object oOther = GetItemActivatedTarget();
object oItemUser = GetItemActivator();
SetLocalLocation(oItemUser,"location",lLocation);
SetLocalObject(oItemUser,"object",oOther);
For your scripts.. Like teleport one.. Put this instead of GetItemActivatedTarget..
object oUser=GetPCSpeaker();
object oPC = GetLocalObject(oUser,"object");
Apply effects to oPC.. You can change the names to go with your script if you want to use it..
[snapback]14384[/snapback]
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]
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" ?)
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]
I had the same problem.. This is what I use, and it works.. Put this on you OnActivate Script if you want to..
location lLocation=GetItemActivatedTargetLocation();
object oOther = GetItemActivatedTarget();
object oItemUser = GetItemActivator();
SetLocalLocation(oItemUser,"location",lLocation);
SetLocalObject(oItemUser,"object",oOther);
For your scripts.. Like teleport one.. Put this instead of GetItemActivatedTarget..
object oUser=GetPCSpeaker();
object oPC = GetLocalObject(oUser,"object");
Apply effects to oPC.. You can change the names to go with your script if you want to use it..
[snapback]14384[/snapback]
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]
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" ?)
[snapback]14415[/snapback]
Yes, you can do that whit
Property 15=castspell Subtype 513=activate item (long range)
You can edit those in the mod with leto or something. Other way is just importing a long range item from a hotu mod where you can select it from the list in the prperty menu of the item.
Or just import the attached one (version 1.29 or higher needed :P) and edit it to your needs. I zipped it to be able to attach it + it's smaller.
-Mel