The scripting I am used to doing/did do for some personal mods in Bioware's Neverwinter Nights game, was (I think), a customised C++ using their very powerful NWN Toolset.
Soooo.....Just to kind of get it clear in my own head about the type of programming involved for PSWG, this is an example of a piece of code I wrote to do with creating a characters ability to fly or jump according to certain things in the game environment. (this type of scripting is something I find relatively easy to get my head around) does this seem *similar* to the programming that would be needed here?
void main()
{
object oPC = OBJECT_SELF;
object oArea = GetArea(oPC);
location lLoc = GetSpellTargetLocation();
if (GetCreatureWingType(oPC) != CREATURE_WING_TYPE_NONE && GetIsAreaAboveGround(oArea) == TRUE)
{
SendMessageToPC(oPC, "flight mode");
//location lLoc = GetSpellTargetLocation();
effect eFly = EffectDisappearAppear(lLoc);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eFly, oPC, 2.5);
}
if(GetIsAreaInterior(oArea) == TRUE)
{
// location lLoc = GetSpellTargetLocation();
location lStart = GetLocation(oPC);
vector vSelf = GetPositionFromLocation(lStart);
vector vTarget = GetPositionFromLocation(lLoc);
int nLos = LineOfSightVector(vSelf,vTarget); // if the pc has a clear line of sight to the flight location
float fJump = GetDistanceBetweenLocations(lStart, lLoc); // the distance of the attempted jump/flight assisted jump
//
if(nLos == TRUE && fJump <= 3.00)// pc makes a short distance jump (later will work on this according to class type)
{
SendMessageToPC(oPC, "Jump mode");
effect eFly = EffectDisappearAppear(lLoc);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eFly, oPC, 2.5);
}
else if(nLos == TRUE && fJump > 3.00)// the pc can see where they want to go but the distance is greater than 3 m
{
if (GetCreatureWingType(oPC) != CREATURE_WING_TYPE_NONE ) //the pc has wings so can make longer flight assisted jumps
{
// make a check now for flight barriers (so that you can't fly through placeables/doors etc)
object oObject = GetNearestObjectToLocation(OBJECT_TYPE_PLACEABLE, lLoc);
location lObject = GetLocation(oObject);
float fDist = GetDistanceBetweenLocations(lLoc, lObject);
if(fDist <= 4.00) // if the nearest placeable is 4 m away or less cannot fly (to stop an exploit where you can jump to impossible locations)
{
SendMessageToPC(oPC, "I cannot successfully jump nor fly to there");
}
else
{
SendMessageToPC(oPC, "Flght mode");
effect eFly = EffectDisappearAppear(lLoc);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eFly, oPC, 2.5);
}
}
else
{
SendMessageToPC(oPC, "Too far"); // the pc has no wings and its too far to jump
}
}
//
else if(nLos == FALSE)
{
SendMessageToPC(oPC, "I can't see a way");
}
}
}