Scripting portal-like door-to-door movement in the same area
Moderators: Moderator, Developer, DM
-
Khaine
- Posts: 26
- Joined: Thu Jan 06, 2011 12:45 am
Scripting portal-like door-to-door movement in the same area
I basically have a door at the bottom of a "tower" and one at the top and want to be able to transition between the two.
Here's the code I have, but it isn't working. I've been through several websites looking for assistance but I can't find anything with door-to-door transitioning in the same area.
Doors are both set to transition to a door and each door has a unique name. Did the script compiling and all that good stuff.
void main()
{
object oPC = GetLastUsedBy();
if (!GetIsPC(oPC)) return;
object oTarget;
location lTarget;
oTarget = GetObjectByTag("tag_of_object");
lTarget = GetLocation(oTarget);
if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return;
AssignCommand(oPC, ClearAllActions());
DelayCommand(3.0, AssignCommand(oPC, ActionJumpToLocation(lTarget)));
oTarget = oPC;
int nInt;
nInt = GetObjectType(oTarget);
if (nInt != OBJECT_TYPE_DOOR) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget);
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget));
}
Here's the code I have, but it isn't working. I've been through several websites looking for assistance but I can't find anything with door-to-door transitioning in the same area.
Doors are both set to transition to a door and each door has a unique name. Did the script compiling and all that good stuff.
void main()
{
object oPC = GetLastUsedBy();
if (!GetIsPC(oPC)) return;
object oTarget;
location lTarget;
oTarget = GetObjectByTag("tag_of_object");
lTarget = GetLocation(oTarget);
if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return;
AssignCommand(oPC, ClearAllActions());
DelayCommand(3.0, AssignCommand(oPC, ActionJumpToLocation(lTarget)));
oTarget = oPC;
int nInt;
nInt = GetObjectType(oTarget);
if (nInt != OBJECT_TYPE_DOOR) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget);
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget));
}
Arden Reede - Shield Dwarf Meatshield Fellow
Uthyriel Sy'ceera - Wood Elf Archer Fellow
Khadym An'ak'kuur - HandsomeDevil Paladin Fellow
Vos Mhorroth - Big Sword Wielding Fellow
Uthyriel Sy'ceera - Wood Elf Archer Fellow
Khadym An'ak'kuur - Handsome
Vos Mhorroth - Big Sword Wielding Fellow
-
Blackman D
- Retired Staff
- Posts: 4818
- Joined: Sat Sep 12, 2009 5:43 am
- Location: IL
Re: Scripting portal-like door-to-door movement in the same
is it an actual door that you are using?
if so you can change the options for the door to jump to a waypoint and then create a waypoint for the spot you need to jump to and it will have the same effect of what you are trying to do i think
just set transition to waypoint, put in the tag of the way point and place the actual waypoint where every you need it to go to
if its not an actual door it can still be done using waypoints but then you will need an item jump script and setup a variable
but whats the actual placeables you are using?
if so you can change the options for the door to jump to a waypoint and then create a waypoint for the spot you need to jump to and it will have the same effect of what you are trying to do i think
just set transition to waypoint, put in the tag of the way point and place the actual waypoint where every you need it to go to
if its not an actual door it can still be done using waypoints but then you will need an item jump script and setup a variable
but whats the actual placeables you are using?
everyone is evil till proven otherwise
-
Khaine
- Posts: 26
- Joined: Thu Jan 06, 2011 12:45 am
Re: Scripting portal-like door-to-door movement in the same
Not sure what a placeable is, will have to look that up. just started messing with this stuff last night.
I do have two actual doors. The idea is that you step in the door, walk up the inside of the tower, and come out up top.
But without actually walking up the stairs inside the tower. You just enter the bottom door and come out the top door.
I do have two actual doors. The idea is that you step in the door, walk up the inside of the tower, and come out up top.
But without actually walking up the stairs inside the tower. You just enter the bottom door and come out the top door.
Arden Reede - Shield Dwarf Meatshield Fellow
Uthyriel Sy'ceera - Wood Elf Archer Fellow
Khadym An'ak'kuur - HandsomeDevil Paladin Fellow
Vos Mhorroth - Big Sword Wielding Fellow
Uthyriel Sy'ceera - Wood Elf Archer Fellow
Khadym An'ak'kuur - Handsome
Vos Mhorroth - Big Sword Wielding Fellow
-
Blackman D
- Retired Staff
- Posts: 4818
- Joined: Sat Sep 12, 2009 5:43 am
- Location: IL
Re: Scripting portal-like door-to-door movement in the same
yea set it up as transition to waypoint and then set your waypoint where you need it
you want to use the waypoint that is just named "waypoint" at the bottom of the list
you may also want to change the tag on your doors also just to make it easier on yourself tho that part isnt required
so say your bottom door is "bottomfloordoor" (as its tag, just to keep track of your doors) in the options enable transition to waypoint and name your waypoint "bottomfloordoorWP", also enable invisible transitions
then go to the spot you need to come out of and place the waypoint there and name it "bottomfloordoorWP" and when you run the module you will jump to that waypoint when you enter that door, and to go back just do the same thing but using the top floors door
door to door transitions are kinda buggy and may not work all the time, but havent had an issue with transition to waypoint yet
you want to use the waypoint that is just named "waypoint" at the bottom of the list
you may also want to change the tag on your doors also just to make it easier on yourself tho that part isnt required
so say your bottom door is "bottomfloordoor" (as its tag, just to keep track of your doors) in the options enable transition to waypoint and name your waypoint "bottomfloordoorWP", also enable invisible transitions
then go to the spot you need to come out of and place the waypoint there and name it "bottomfloordoorWP" and when you run the module you will jump to that waypoint when you enter that door, and to go back just do the same thing but using the top floors door
door to door transitions are kinda buggy and may not work all the time, but havent had an issue with transition to waypoint yet
everyone is evil till proven otherwise
-
Khaine
- Posts: 26
- Joined: Thu Jan 06, 2011 12:45 am
Re: Scripting portal-like door-to-door movement in the same
Ahhhh, man, being such a noob at this I thought the waypoint flag would be visible on the screen, which is why I didn't use it at first. But thanks for your explanation, it makes a helluva lot more sense than what I was previously doing.
Arden Reede - Shield Dwarf Meatshield Fellow
Uthyriel Sy'ceera - Wood Elf Archer Fellow
Khadym An'ak'kuur - HandsomeDevil Paladin Fellow
Vos Mhorroth - Big Sword Wielding Fellow
Uthyriel Sy'ceera - Wood Elf Archer Fellow
Khadym An'ak'kuur - Handsome
Vos Mhorroth - Big Sword Wielding Fellow
-
Blackman D
- Retired Staff
- Posts: 4818
- Joined: Sat Sep 12, 2009 5:43 am
- Location: IL
Re: Scripting portal-like door-to-door movement in the same
if you enable map point then they will appear, just have to leave it disabled and you wont have to worry about it showing up
everyone is evil till proven otherwise
-
Khaine
- Posts: 26
- Joined: Thu Jan 06, 2011 12:45 am
Re: Scripting portal-like door-to-door movement in the same
Does this setup not need a script? Door to Waypoint jumping?
Arden Reede - Shield Dwarf Meatshield Fellow
Uthyriel Sy'ceera - Wood Elf Archer Fellow
Khadym An'ak'kuur - HandsomeDevil Paladin Fellow
Vos Mhorroth - Big Sword Wielding Fellow
Uthyriel Sy'ceera - Wood Elf Archer Fellow
Khadym An'ak'kuur - Handsome
Vos Mhorroth - Big Sword Wielding Fellow
-
Duster47
- Retired Staff
- Posts: 3727
- Joined: Mon Nov 16, 2009 7:57 pm
- Location: Florida, USA
Re: Scripting portal-like door-to-door movement in the same
Place two doors in the area.
Change the tag of each to be unique. Name them so you know from looking at the door's tags that there it is part of a matched pair. Such as "door_1a" and "door_1b".
Scroll down the door's property listing until you get to the tab about transitions.
Check transition on box.
Use the drop-down to select WP or Door.
Type the other door's (or WP) tag.
Repeat for the other door but this time use the tag of the first door as the destination.
This works for any matched-pair of doors within a module.
Change the tag of each to be unique. Name them so you know from looking at the door's tags that there it is part of a matched pair. Such as "door_1a" and "door_1b".
Scroll down the door's property listing until you get to the tab about transitions.
Check transition on box.
Use the drop-down to select WP or Door.
Type the other door's (or WP) tag.
Repeat for the other door but this time use the tag of the first door as the destination.
This works for any matched-pair of doors within a module.
PC1 = Nerys, Emissary and Skald of the Greyfox tribe, last seen roaming north near Secomber
PC2 = Valqis Sanejmeh; far away cartographer, Oracle of Nut at chaltin QulDaq, former navigator of the Sea Seeker, Reader of Candlekeep and sometime performer.
PC2 = Valqis Sanejmeh; far away cartographer, Oracle of Nut at chaltin QulDaq, former navigator of the Sea Seeker, Reader of Candlekeep and sometime performer.
-
jmbrosendo
- Retired Staff
- Posts: 334
- Joined: Tue Dec 22, 2009 8:08 pm
Re: Scripting portal-like door-to-door movement in the same
K, so all you wish is for a nice visual effect each time you transition, if I am reading it right. That is where the need for a custom script comes from, otherwise a simple setup of door transitions works.
And you're using Lilac Soul's script generator. I can tell, I began scripting using it too.
The way you're working you will need two scripts. One for going up, one for going down. Because of the tags of each door, and such.
Instead of location use waypoints and set them up. you're making the PC jump to the location of a door, which may be creating an error, as in, porting into a wall, or non walkeable area. I am pretty sure the blockage comes from calling the location of the destination object.
A destination waypoint close to the door, in a walkeable area is best solution.
The vfx function you're using is from NWN1 days, and outdated, it may work or not, it's trial and error on that one. Keep trying with different effects if that one does not work.
If you're more experienced with scripting, use the Obsidian function for vfx's, and an Ipoint.
Cheers.
And you're using Lilac Soul's script generator. I can tell, I began scripting using it too.
The way you're working you will need two scripts. One for going up, one for going down. Because of the tags of each door, and such.
Instead of location use waypoints and set them up. you're making the PC jump to the location of a door, which may be creating an error, as in, porting into a wall, or non walkeable area. I am pretty sure the blockage comes from calling the location of the destination object.
A destination waypoint close to the door, in a walkeable area is best solution.
The vfx function you're using is from NWN1 days, and outdated, it may work or not, it's trial and error on that one. Keep trying with different effects if that one does not work.
If you're more experienced with scripting, use the Obsidian function for vfx's, and an Ipoint.
Cheers.
Forever thankful and amazed at all the hard work of DMs, developers and staff that kept running and improving the server over the years.
Login: Cachucho
Login: Cachucho
-
Ivan38Rus
- Retired Staff
- Posts: 1417
- Joined: Sat Aug 08, 2009 11:44 pm
Re: Scripting portal-like door-to-door movement in the same
Not necessarily. You can create a universal script which will be checking for variables on the door, which you will have to previously create.jmbrosendo wrote:The way you're working you will need two scripts. One for going up, one for going down. Because of the tags of each door, and such.
-
Khaine
- Posts: 26
- Joined: Thu Jan 06, 2011 12:45 am
Re: Scripting portal-like door-to-door movement in the same
At this point, I am scrapping any scripting ideas. Going to delete the doors and waypoints tomorrow after finals and start over. If I can get my pc to teleport from door to waypoint, I'll be happy.
Thanks for all the help though, this shit will come in handy later when I start delving into C and all that good stuff for school.
Thanks for all the help though, this shit will come in handy later when I start delving into C and all that good stuff for school.
Arden Reede - Shield Dwarf Meatshield Fellow
Uthyriel Sy'ceera - Wood Elf Archer Fellow
Khadym An'ak'kuur - HandsomeDevil Paladin Fellow
Vos Mhorroth - Big Sword Wielding Fellow
Uthyriel Sy'ceera - Wood Elf Archer Fellow
Khadym An'ak'kuur - Handsome
Vos Mhorroth - Big Sword Wielding Fellow
-
Khaine
- Posts: 26
- Joined: Thu Jan 06, 2011 12:45 am
Re: Scripting portal-like door-to-door movement in the same
Actually, I should add something. The way I have it set up, I have both doors set into cave entrances. Is this going to screw things up? This is also an exterior area. Sorry for these lack of details earlier, again I just started on this two nights ago.
So maybe it is the cave entrance I should have as the portal to waypoint, and not the door??
So maybe it is the cave entrance I should have as the portal to waypoint, and not the door??
Arden Reede - Shield Dwarf Meatshield Fellow
Uthyriel Sy'ceera - Wood Elf Archer Fellow
Khadym An'ak'kuur - HandsomeDevil Paladin Fellow
Vos Mhorroth - Big Sword Wielding Fellow
Uthyriel Sy'ceera - Wood Elf Archer Fellow
Khadym An'ak'kuur - Handsome
Vos Mhorroth - Big Sword Wielding Fellow
-
Ivan38Rus
- Retired Staff
- Posts: 1417
- Joined: Sat Aug 08, 2009 11:44 pm
Re: Scripting portal-like door-to-door movement in the same
It doesn't really matter. Look at guard's tower in BG. Door to WP transition right there.
-
Khaine
- Posts: 26
- Joined: Thu Jan 06, 2011 12:45 am
Re: Scripting portal-like door-to-door movement in the same
Just don't know what to say, guys. Deleted my doors and waypoints and replaced them and set them up exactly as you described and no dice.
I walk up to the door, I click on it, it opens, I click on the darkness of the cave entrance, nothing happens. I even moved the waypoints to a place I KNOW you can walk and nothing. No wonder so few people work on this stuff, frustrating as hell.
I walk up to the door, I click on it, it opens, I click on the darkness of the cave entrance, nothing happens. I even moved the waypoints to a place I KNOW you can walk and nothing. No wonder so few people work on this stuff, frustrating as hell.
Arden Reede - Shield Dwarf Meatshield Fellow
Uthyriel Sy'ceera - Wood Elf Archer Fellow
Khadym An'ak'kuur - HandsomeDevil Paladin Fellow
Vos Mhorroth - Big Sword Wielding Fellow
Uthyriel Sy'ceera - Wood Elf Archer Fellow
Khadym An'ak'kuur - Handsome
Vos Mhorroth - Big Sword Wielding Fellow
-
Khaine
- Posts: 26
- Joined: Thu Jan 06, 2011 12:45 am
Re: Scripting portal-like door-to-door movement in the same
Disregard everything I said in previous post. Found the problem. The place I am transitioning to says it is walkable in the editor, but for some reason when I load the module, it actually isn't. No idea why this is. I moved the waypoint a little bit further from the door than I'd like, but for now, it works. Thanks again everyone for all the help! 
Arden Reede - Shield Dwarf Meatshield Fellow
Uthyriel Sy'ceera - Wood Elf Archer Fellow
Khadym An'ak'kuur - HandsomeDevil Paladin Fellow
Vos Mhorroth - Big Sword Wielding Fellow
Uthyriel Sy'ceera - Wood Elf Archer Fellow
Khadym An'ak'kuur - Handsome
Vos Mhorroth - Big Sword Wielding Fellow