Neverwinter Nights > Script Request
boot script
Elessar Telrunya:
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
Tea-cup:
--- Quote ---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]
--- End quote ---
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
Daniel1975:
--- Quote ---
--- Quote ---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]
--- End quote ---
As far I know he use that now, but want's the dialoge way.
Right?
-Mel
[snapback]13991[/snapback]
--- End quote ---
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.
Tea-cup:
--- Quote ---
--- Quote ---
--- Quote ---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]
--- End quote ---
As far I know he use that now, but want's the dialoge way.
Right?
-Mel
[snapback]13991[/snapback]
--- End quote ---
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]
--- End quote ---
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
Daniel1975:
All special items in our mod are combined in one script "item_activate" that goes in "OnItemActivate" in module-events.
The part where the behaviour of the teleport item is declared goes like this:
if (GetTag (oItem) == "Teleporter")
{
AssignCommand(oSpieler, ActionStartConversation (oSpieler, "use_teleporter", TRUE));
}
This starts the conversation where you can choose where you want to teleport the target (the target can be yourself).
Every teleport-script goes like this:
void main()
{
object oPC = GetItemActivatedTarget();
object oTarget = GetWaypointByTag("WP_Arena_to_Gateway");
location lTarget = GetLocation(oTarget);
int iGender = GetGender(oPC);
effect eVisual01 = EffectVisualEffect(VFX_IMP_MAGIC_PROTECTION);
effect eVisual02 = EffectVisualEffect(VFX_DUR_GLOBE_INVULNERABILITY);
ClearAllActions();
if (iGender == GENDER_FEMALE)
{
PlaySound("vs_chant_necr_lf");
}
if (iGender == GENDER_MALE)
{
PlaySound("vs_chant_necr_lm");
}
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual01, oPC);
DelayCommand(1.8, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual02, oPC));
DelayCommand(3.2, AssignCommand(oPC, ActionJumpToLocation(lTarget)));
}
But when two players are using the teleporter at the same time it happens that one chooses his destination but the other player gets teleported instead of him.
There must be a way ... but I don't know that... :(
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version