Jump to content
You are about to reply to a thread that has been inactive for 1515 days.

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

Recommended Posts

Posted

Hello everyone,

I'm looking for a script that shows the number of prim on a sim with the maxium with only text above a prim (it's to put in a hud).

Example : Prims : 154/689

gpx6.png

 

a big thank you if anyone has this in their inventory

 

Posted (edited)

This is not my best script but it should do what you want!

 

default
{
    touch_start(integer total_number)
    {
        vector currentPosition = llGetPos();
        vector color = <0.1,0.2,0.8> ;
        
        integer count = llGetParcelPrimCount(currentPosition, PARCEL_COUNT_TOTAL, FALSE);
        integer max = llGetParcelMaxPrims(currentPosition, FALSE) ;
        string title = (string)count + "/"  + (string)max ;
        //llSetText(title, color, 1.0) ;
          llOwnerSay(title) ;
        }
}

 

For a HUD you will need llOwnerSay() rather than llSetText()

Edited by Sabrina Tamerlane
added llOwnerSay
Posted

a big thank you for your sharing

 

on the other hand I am obliged to click on the cube to update the new number of prim in the field when I rez a cube or other prim

 

do you think there is a way to have the same thing with the text but without having to click on the prim to update the new number of prim present on the sim

 

big thx Sabrina

Posted

I would just like the prim counter to update automatically when I rez or delete a prim

without anything indicated in the chat just indicate it in the numbers on my prim

example : 16/677

i rez on prim 

exemple : 17/677

just that the text above my prim changes automatically without indicating any information in the chat room

 

I hope my English is not too bad. I apologize.  ^^

Posted (edited)
integer Running = FALSE;
integer delay = 60 ;

integer lastCount = 0;

default
{
    touch_start(integer total_number)
    {
        if (Running) {
            Running = FALSE;
            llSetTimerEvent(0) ;
        }
        else {
            llSetTimerEvent(delay) ;
            Running = TRUE;
        }
    }
    timer()
    {
        
        vector currentPosition = llGetPos();        
        integer count = llGetParcelPrimCount(currentPosition, PARCEL_COUNT_TOTAL, FALSE);
        integer max = llGetParcelMaxPrims(currentPosition, FALSE) ;
        if (count != lastCount) {
            lastCount = count ;
            llOwnerSay( (string)count + "/"  + (string)max) ;
        }
    }
}

You can do it like so.. it will check every minute if the prim count is different and then update you...

Edited by Sabrina Tamerlane
code
  • Like 1
Posted

in fact I've seen a hud like this, when you go to a sim or a sandbox it updates automatically without IM or writing in the chat, it only changes the numbers on the prim porter in the hud. 

 

as in the picture example

gpx6.png

 

thanks for your patience

Posted (edited)
display_land_impact()
{
    vector here = llGetPos();

    integer current = llGetParcelPrimCount(here, PARCEL_COUNT_TOTAL, FALSE);
    integer max = llGetParcelMaxPrims(here, FALSE);

    llSetText((string)["Prims: ", current, "/", max], <1,1,1>, 1);
}

default
{
    state_entry()
    {
        display_land_impact();
        llSetTimerEvent(60);
    }

    timer()
    {
        display_land_impact();
    }
}

That'll give you the current/maximum land-impact use for the current parcel as a hovertext, and it updates every minute.

Edited by Wulfie Reanimator
  • Like 1
Posted
8 hours ago, Wulfie Reanimator said:

display_land_impact()
{
    vector here = llGetPos();

    integer current = llGetParcelPrimCount(here, PARCEL_COUNT_TOTAL, FALSE);
    integer max = llGetParcelMaxPrims(here, FALSE);

    llSetText((string)["Prims: ", current, "/", max], <1,1,1>, 1);
}

default
{
    state_entry()
    {
        display_land_impact();
        llSetTimerEvent(60);
    }

    timer()
    {
        display_land_impact();
    }
}

That'll give you the current/maximum land-impact use for the current parcel as a hovertext, and it updates every minute.

Just thought I'd mention there is still a bug that affects llGetParcelMaxPrims() when SimWide is FALSE and a region bonus is present.

  • Like 1
  • Thanks 2
You are about to reply to a thread that has been inactive for 1515 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
×
×
  • Create New...