I'm wanting to have a script on a door's OnAreaTransitionClick that randomly moves the player to another door.
I would like to be able to use this script again if I can, so I'm saveing area variables to the door.
The area I'm getting is "DECLARATION DOES NOT MATCH PARAMETERS" on case 1
void main(){
object oPC = GetClickingObject();if (!GetIsPC(oPC)) return;
string oWP1 = GetLocalString(OBJECT_SELF, "oWP1");string oWP2 = GetLocalString(OBJECT_SELF, "oWP2");string oWP3 = GetLocalString(OBJECT_SELF, "oWP3");string oWP4 = GetLocalString(OBJECT_SELF, "oWP4");string oWP5 = GetLocalString(OBJECT_SELF, "oWP5");string oWP6 = GetLocalString(OBJECT_SELF, "oWP6");
int nCommonRoll = d6();
switch(nCommonRoll) { case 1: AssignCommand(oPC, JumpToObject(oWP1));break; //Error begins here. case 2: AssignCommand(oPC, JumpToObject(oWP2));break; case 3: AssignCommand(oPC, JumpToObject(oWP3));break; case 4: AssignCommand(oPC, JumpToObject(oWP4));break; case 5: AssignCommand(oPC, JumpToObject(oWP5));break; case 6: AssignCommand(oPC, JumpToObject(oWP6));break;
}
}
Any suggestions as to what I'm doing wrong is welcome. Thank you kindly!
Random Area Transition
Débuté par
Buddywarrior
, mai 19 2012 09:31
#1
Posté 19 mai 2012 - 09:31
#2
Posté 19 mai 2012 - 09:51
void main()
{
object oPC = GetClickingObject();
if (!GetIsPC(oPC)) return;
string oWP1 = GetLocalString(OBJECT_SELF, "oWP1");
string oWP2 = GetLocalString(OBJECT_SELF, "oWP2");
string oWP3 = GetLocalString(OBJECT_SELF, "oWP3");
string oWP4 = GetLocalString(OBJECT_SELF, "oWP4");
string oWP5 = GetLocalString(OBJECT_SELF, "oWP5");
string oWP6 = GetLocalString(OBJECT_SELF, "oWP6");
int nCommonRoll = d6();
switch(nCommonRoll)
{
case 1: AssignCommand(oPC, JumpToObject(oWP1));
break;
//Error begins here.
case 2: AssignCommand(oPC, JumpToObject(oWP2));break;
case 3: AssignCommand(oPC, JumpToObject(oWP3));break;
case 4: AssignCommand(oPC, JumpToObject(oWP4));break;
case 5: AssignCommand(oPC, JumpToObject(oWP5));break;
case 6: AssignCommand(oPC, JumpToObject(oWP6));break;
}
}
Script repost.
{
object oPC = GetClickingObject();
if (!GetIsPC(oPC)) return;
string oWP1 = GetLocalString(OBJECT_SELF, "oWP1");
string oWP2 = GetLocalString(OBJECT_SELF, "oWP2");
string oWP3 = GetLocalString(OBJECT_SELF, "oWP3");
string oWP4 = GetLocalString(OBJECT_SELF, "oWP4");
string oWP5 = GetLocalString(OBJECT_SELF, "oWP5");
string oWP6 = GetLocalString(OBJECT_SELF, "oWP6");
int nCommonRoll = d6();
switch(nCommonRoll)
{
case 1: AssignCommand(oPC, JumpToObject(oWP1));
break;
//Error begins here.
case 2: AssignCommand(oPC, JumpToObject(oWP2));break;
case 3: AssignCommand(oPC, JumpToObject(oWP3));break;
case 4: AssignCommand(oPC, JumpToObject(oWP4));break;
case 5: AssignCommand(oPC, JumpToObject(oWP5));break;
case 6: AssignCommand(oPC, JumpToObject(oWP6));break;
}
}
Script repost.
#3
Posté 19 mai 2012 - 09:55
It looks like your problen is that oWP* are not objects, they are strings.
So if the local strings are the tags for the waypoints do something like:
object oWP1 = GetWaypointByTag(GetGetLocalString(OBJECT_SELF, "oWP1"));
So if the local strings are the tags for the waypoints do something like:
object oWP1 = GetWaypointByTag(GetGetLocalString(OBJECT_SELF, "oWP1"));
#4
Posté 20 mai 2012 - 02:15
object oWP1 = GetWaypointByTag(GetLocalString(OBJECT_SELF, "oWP1"));
That did the trick! Thanks Lightfoot8!
That did the trick! Thanks Lightfoot8!





Retour en haut






