Jump to content

Arcade Script


DarkEmperor13
 Share

You are about to reply to a thread that has been inactive for 1284 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Not even sure if this is remotely right

default
{
    state_entry()
    {
        llSay(0, "Hello, Avatar!");
    }

    changed(integer change)
  {
    if (change & CHANGED_LINK)
    {
      key agent = llAvatarOnSitTarget();
      if (agent)
      {
          if(agent != llGetOwner())
          {
              llSetLinkMedia( 1, 0, [PRIM_MEDIA_CURRENT_URL, "https://emulatorgames.online/games/n64/bomberman-64", PRIM_MEDIA_AUTO_PLAY, TRUE, PRIM_MEDIA_WIDTH_PIXELS, 1.2, PRIM_MEDIA_HEIGHT_PIXELS, 0.7, PRIM_MEDIA_PERMS_INTERACT, PRIM_MEDIA_PERM_ANYONE, PRIM_MEDIA_PERMS_CONTROL, PRIM_MEDIA_PERM_NONE]);
        }
        else
        {
            llSetLinkMedia( 1, 0, [PRIM_MEDIA_CURRENT_URL, "https://emulatorgames.online/games/n64/bomberman-64", PRIM_MEDIA_AUTO_PLAY, TRUE, PRIM_MEDIA_WIDTH_PIXELS, 1.2, PRIM_MEDIA_HEIGHT_PIXELS, 0.7, PRIM_MEDIA_PERMS_INTERACT, PRIM_MEDIA_PERM_ANYONE, PRIM_MEDIA_PERMS_CONTROL, PRIM_MEDIA_PERM_NONE, PRIM_MEDIA_AUTO_ZOOM, TRUE ]);
        }
        }
        else
        {
          
        }
    }
}
}

Before anyone asks, i will NOT pay a fortune to hire someone to script an arcade machine just to have it not be modifiable  cause im not made of money. I just want to know how to script it.

Link to comment
Share on other sites

That's in the right ballpark, but there are a few things you could do to clean it up. changing the spacing to make it more readable for one, which would make it easier to catch some mis-matched barces.

also I'm not sure why you need slightly different options for the owner and regular users.

for a multiple-game switcher, you could try something like this:

list gSites=[
    "https://emulatorgames.online/games/n64/bomberman-64",
    "https://archive.org/details/Stargunner",
    "https://tss.asenheim.org/eve-burst-error.html" // no final comma.
];
list gSiteNames = [
    "Bomberman",
    "StarGunner",
    "Eve: Burst Error" // no final comma.
    ];
integer gSitePointer;
integer gButtonRightFace=2;
integer gButtonLeftFace=4;
integer gButtonOff=1;
integer gMediaFace=0;


default
{
    state_entry()
    {
        integer success =llSetPrimMediaParams(gMediaFace,
        [
            PRIM_MEDIA_CURRENT_URL,
                llList2String(gSites,0),
            PRIM_MEDIA_AUTO_PLAY, // " Sets whether the media auto-plays when a Resident can view it. "
                TRUE,
            PRIM_MEDIA_PERMS_CONTROL, // who can change the url with the control bar.
                PRIM_MEDIA_PERM_NONE, // chose from 'NONE,OWNER,GROUP,ANYONE'
            PRIM_MEDIA_AUTO_ZOOM,   //makes the user's camera zoom onto the prim when they interact with it (if TRUE).
                TRUE,
            PRIM_MEDIA_PERMS_INTERACT, // who can change the webpage the site is on through navigation
                PRIM_MEDIA_PERM_NONE // no final comma.
        ]);
        
    }

    touch_start(integer total_number)
    {   //llSay(0,(string)llDetectedTouchFace(0));
        if(llDetectedTouchFace(0)==gButtonRightFace)
        {   ++gSitePointer;
        }else if(llDetectedTouchFace(0)==gButtonLeftFace)
        {   --gSitePointer;
        }else if(llDetectedTouchFace(0)==gButtonOff)
        {   llRegionSayTo(llDetectedKey(0),0,"Power off.");
            llSetPrimMediaParams(gMediaFace,
            [PRIM_MEDIA_CURRENT_URL,""]);
            return;
        }
        else
            return;
        if(gSitePointer>=llGetListLength(gSites))
            gSitePointer=0;
        string Site=llList2String(gSites,gSitePointer);
        string Name=llList2String(gSiteNames,gSitePointer);
        llRegionSayTo(llDetectedKey(0),0,Name);
        llSetPrimMediaParams(gMediaFace,
            [PRIM_MEDIA_CURRENT_URL,Site]);
    }
}

in a cube prim with 0.01 size in the z dimension, and 0.30 taper for x and y.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1284 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...