Hello there. I have tried multiple times to put in a few potals, from scripts that I have found online to scripts from lilacs generator. None of them have worked. I placed visual portals over general transitions and painted waypoints over them. I tried with stone of recall and put the mod on chapter one. Among other attempts. Any advice or places to go to find a working portal script?
This is the latest example:
#include “x2_inc_switches”
#include “nw_i0_plot”
void main ()
{
object oPC = GetLastUsedBy();
if (!GetIsPC)) return;
object oTarget;
location lTarget;
oTarget = GetWayPointByTag( “tag”);
lTarget = GetLocation(oTarget);
if (GetAreaFromLocation(lTarget) == OBJECT_INVALID) return;
AssignCommand(oPC, ActionJumpToLocation(lTarget)));
oTarget =oPC;
int nInt;
nInt = GetObjectType(oTarget);
if (nInt = i= (OBJECT_TYPE) ApplyEffwctToObject DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget;
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget));
A script won’t work until you get a clean compilation, that is, no errors when you compile the script in the toolset.
When posting scripts here, you need to enclose it in the [code] bbcodes, otherwise the double quotes are corrupted.
Your compiler will tell you that there is an error in line 9. Double-click on GetIsPC to see that it requires an object as its argument. Count the brackets - you have one open but two close, which can’t be right. The line should read
if (!GetIsPC(oPC)) return;
There is no such function as GetWayPointByTag (which you can verify by searching in the right-hand pane of the compiler window). You probably mean GetWaypointByTag - the compiler is case-sensitive.
The line
AssignCommand(oPC, ActionJumpToLocation(lTarget)));
won’t work because you have two open brackets but three close. Try
AssignCommand(oPC, ActionJumpToLocation(lTarget));
The rest of the script - applying the VFX - looks a bit garbled, so maybe cut-and-paste the correct version from where you found it, or comment it out while you get the basic jump working.
Either way, you’ll need a curly brace at the end of the script because you have 1 open and 0 close:
}
1 Like
I am sorry for the rough scripting, I am on a tablet. I am getting my desktop up and running soon. With the toolset compiler, the much better, non tablet written script compiles successfully. This script is from the lilac soul generator.
There is also a default BioWare script (a script that always exists in the toolset and thus in any module made in it, no matter what) called x0_o2_use_portal . This script is, well, for portals - you put it OnUsed of a usable placeable, you create an appropriate waypoint,* and clicking the placeable will transport your PC. Doesn’t have to be a portal placeable, either, which is neat.
*An “appropriate waypoint” for this script is a waypoint that has a tag “DST_tagofyourportal”. So if you make a portal with a tag portal_to_doom then the waypoint should be tagged DST_portal_to_doom. This is kinda-contrary to the comment section found in that script, which makes it sound like the tag should be “LOC_tagofyourportal” and is generally misleading.
I like to use that script because it’s an universal script that can be used on any amount of placeables as long as you give them unique tags.
2 Likes
Thank you, will give it a try. Thank you for your reply.