Aller au contenu

Photo

Trying to get pins working


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
nn125

nn125
  • Members
  • 42 messages
Curret code to toggle a pin

void main ()
{
    object oPC = GetHero();
    DisplayFloatyMessage(oPC, "Doing It", FLOATY_MESSAGE, 16777215, 20.0);

    object oPin = GetPlayerMapPin(oPC,"my_test_pin_1");

    if(IsObjectValid(oPin))
    {
        DisplayFloatyMessage(oPC, "Valid Pin", FLOATY_MESSAGE, 16777215, 20.0);
        SetMapPinState (oPin,!GetMapPinState(oPin));
    }
    else
    {
        DisplayFloatyMessage(oPC, "Bad Pin", FLOATY_MESSAGE, 16777215, 20.0);
    }

}

Get the Doing It message but don't get  either Valid Pin or Bad Pin

Can anybody explain this

The state of the Pin doesn't change - Being looking through the stuff in the new kit and cant see these functions anywhere

They seam to be using

WR_SetWorldMapLocationStatus

Has anybody used this? can anybody expain how to use this

Thanks in advance

#2
Gocek

Gocek
  • Members
  • 154 messages
check here - http://social.biowar...hp/Map_tutorial

#3
nn125

nn125
  • Members
  • 42 messages
For anyone who is interested This code seams to work



void main()

{

string sVar = GetLocalString(GetModule(),"RUNSCRIPT_VAR");

int nFind = FindSubString(sVar," ");

string sVal = SubString(sVar,0,nFind);

int iVal = StringToInt(sVal);

object oPC = GetHero();



object oPin = GetObjectByTag("test_pin_1");



if(IsObjectValid(oPin))

{

DisplayFloatyMessage(oPC, "Valid Pin", FLOATY_MESSAGE, 16777215, 20.0);



switch (iVal) {

case 1:

WR_SetWorldMapLocationStatus (oPin, WM_LOCATION_INACTIVE);

break;

case 2:

WR_SetWorldMapLocationStatus (oPin, WM_LOCATION_GRAYED_OUT);

break;

case 3:

WR_SetWorldMapLocationStatus (oPin, WM_LOCATION_ACTIVE);

break;

case 4:

WR_SetWorldMapLocationStatus (oPin, WM_LOCATION_DESTROYED);

break;

}

}

else

{

DisplayFloatyMessage(oPC, "Bad Pin", FLOATY_MESSAGE, 16777215, 20.0);

}

}