Hi!
So, what I want to do is that when you use a object this teleports you to a waypoint, easy right?
So I tried scripting the JumpToLocation function
idk what i’m doing wrong, in my belief, everything looks fine, but, it’s clearly not fine.
Hi!
So, what I want to do is that when you use a object this teleports you to a waypoint, easy right?
So I tried scripting the JumpToLocation function
idk what i’m doing wrong, in my belief, everything looks fine, but, it’s clearly not fine.
Your location function looks odd. You need to state the destination more thoroughly. Where is the housetop for example. The game doesn’t know this. You have to define that.
You have declared lDestination but it needs something like this:
void main ()
{
location lDestination = GetNearestObjectByTag(“jump_here”,OBJECT_SELF,1);
JumpToLocation(lDestination);
}
Where the tag of your waypoint is made to be “jump_here” so this script can find it. I hope this helps!
Ok, I get your point, “housetop” is a waypoint in my area.
If the destination isn’t in the same area I don’t think you can use GetNearestObjectByTag, but you should instead use GetObjectByTag. If it is in the same area, then no problem.
EDIT: Ok, then like this (just modifying what @pliny_the_elder said:
void main ()
{
location lDestination = GetNearestObjectByTag(“housetop”,OBJECT_SELF,1);
JumpToLocation(lDestination);
}
And the housetop’s tag is housetop?
Wait a minute…
void main ()
{
object oPC = GetFirstPC();
object oTarget = GetWaypointByTag("housetop");
location lDestination = GetLocation(oTarget);
AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC,JumpToLocation(lDestination ));
}
Maybe this will work?
EDIT: I would recommend you downloading and using Lilac Soule’s Script Generator:
https://neverwintervault.org/project/nwn1/other/tool/lilac-souls-nwn-script-generator-v23
That helped me A LOT in the beginning. Especially for simpler scripts. I hardly use it anymore though.
Another source that you should check out is the NWN Lexicon: NWN Lexicon
EDIT2: Make sure the housetop is walkable, otherwise your PC won’t be able to jump there.
EDIT3: Alright, I have to bed now. It’s way past midnight here where I live. I hope you get it to work. I’ll check back here in the morning.
EDIT4: Sorry, my previous script was faulty. Check the new one above.
I will try everything and let you know, good night
PD: Thank you for the advices, I will check out Lilac Soule’s Script Generator, it would be great if I can make it work
EDIT 1: It worked perfectly, thank you very much!!
EDIT 2: I’ve been testing Lical Soule’s Script Generator, it’s pretty insane what this app have, for real, i would have no posts in the forum asking for help if I had this app before. Thank you very much!