Posts by yahwho

    Yep that's what I have done, everything works normally (panels buttons etc for all users), but when a player logs off the listener for clicks (for all remaining users) stops working :/ I'm just about to start another one from scratch. See if I can see where I was going wrong.


    And yes - good advice on the onSpawn rather than onConnect - my onConnect method contained a lot! Moved it all to onSpawn instead :)

    Hmm my code albeit different does indeed use unique attribute name for labels, which are unique for each player (the set attribute in part uses the players UID).


    Only thing different is my labels are added to panels and then the panels added to the players gui.


    I think I'll rewrite the whole GUI (starting with something super super simple) and see if I can stop the listeners from unregistering / being garbage collected.


    It will probably turn out I've missed a "new" constructor somewhere. 8|

    Just thought I would mention this in case it's what you are after; Medieval Realms is a survival server.


    Ore is set to a lower than standard amount. Items like the ore detector, mining drill, and other modern day items are locked out so players can't use them. Fly mode is disabled, there are no teleports (apart from one SOS one - sometimes we just get stuck). So if you want to travel, you need to travel!


    The server also has a ranking system in place for things like "survival time". Current record for someone surviving without dying is just under four days (so a challenge there to beat the record!)


    It is however, a themed server - so medieval period builds only.


    Welcome to join us if you like.


    p.s. There are other survival servers available too ^^

    Hmm the problem there is that giving access to *every* spawnnpc command, allowing players to spawn not just the "dummies" :(


    I had wanted to control the amount on an individual (automated) basis.


    Tbh I would like to have console access or at least all the console commands available through the API too.

    I totally agree there!


    I would also like to map certain commands to keys, like setr/setl/setp that you mentioned. Would be so time saving when building with planks and beams using a key press rather than typing in setr 1 setr15 all the time (which I seem to be doing more and more often).


    I *think* it may be possible to do what I'm asking with direct database writes to the main world database ( <X x1000 ) . . . but that will require a LOT of work and LOT of testing on a none-live server before I would even consider adding it to a live world.


    Hopefully @red51 will heed our calls and add API calls for all the console commands in the near future ;):saint::D

    It would be great to have some kind of access the games console via the API.


    I'm imagining something like this sudocode:


    Code
    Console c = this.server.getConsole();
    int id = 1;
    c.execute("spawnnpc dummy id " + id);


    Why? Well I would like to let people spawn NPCs dummies into their builds, but I want to *limit* this (depending on game time). I don't want to allow a new player, who may just be on the server to cause chaos to go around spawning 100's (if not 1000's) of NPCs (which someone could do with a script if blanket access was allowed).


    I would also like to be able to easily write a plugin to spawn NPC animals. I've had a look at the API and I can't see any calls in there that would allow me to do this. The only way round I can see is to directly add new NPCs via the main database. Something I don't like doing hence my own database and own tables for Medieval Realms!


    Something like this would be great!



    Code
    for ( int i = 0 ; i < TOTAL ; i++ ) {
    c.execute("spawnnpc cow id " + some_id_number);
    }


    P.s. I know this is sudocode; I'm not sure how you can spawn anything with an ID number as I've not looked into it yet, but we'll defo need ID numbers on the spawns if we are to keep track of them :saint:

    Thanks for the code snippets Minotorious! I will digest what you have suggested and see if I can add implement it! :rolleyes:


    No worries about the delay pal - I've been busy pondering animal spawning; it looks to me like there is no API call so a direct database write is in order. Much testing and experimentation will need to be done! :/

    Are you running anything else at the same time? You might want to try running the Rising World in Safe Mode with networking (just to test).


    I have found on my rig that Rising World will fail to start if I'm using Window Media player when it is playing certain video files with certain codecs.


    Conflict of resources. . .


    Just an idea you could try whilst waiting for the expert!

    Your log files say "WARNING: Selected display mode: 1920 x 1080 x 0 @0Hz" that may be your problem?


    There is a config file in the games root that contains settings where you can change the resolution.


    If you're not comfortable editing config files I would suggest uninstalling the game, deleting any leftover files (particular the config file), reboot, and reinstall.


    Or you could wait to see what Red says.


    P.s. when deleting files it's always best practice to rename the file to filename.extension.old - just in case you need to reverse what you did!


    Hope that helps.

    A simple solution to this (for server owners) is to log the chat messages and include the name and UID. My server does this and if someone is using inappropriate language and is reported by another player a simple log search will reveal the offenders UID.

    Something odd is happening. Probably relating to my lack of understanding.



    Code
    GuiLabel Label1 = new GuiLabel("TEXT", 10.0f, 25.0f, false);
    Label1.setClickable(true);

    This works fine, but it appears that when someone logs off, everyone's labels stop being clickable. :/


    Does anyone have a complete mini/simple example of how I should be using "clickable labels" ?

    Update: I've had a player have this happen to them and they told me what happened - might be useful in tracking it down @red51. They fell through the world down to hell; where the graphics appeared to be glitching ( falling through hell multiple times). This is where (I believe) the event call "onPlayerDeath" gets called multiple times.