Request: Events UI

First off, I think we need a subforum for requests.

On to the topic:

I just need a simple events UI that will display the image in the lower right corner, display the name of the event on the top line, the prize on the bottom and warp them to the events house when the “Click here to join” is clicked.

For for the sake of simple edits, I would appreciate if it could be set up in repetitive form for me to add/remove things easily. Also, I'd like the UI to be hidden when no event is set and to automatically hide after 2 minutes if not clicked.

Thanks in advance. Player statue will be added to staff room for credit.

Re: Request: Events UI

Xoria has something like that going on.

Not sure the best way to do it but since i'm gunghoe for strings, i'd do something like:

In sys npc:
if(strequals(#I(server.events,0),yes)){
timeout = 0.05;
}
if(timeout){
showimg 500,eventsbg.png,this.screenposition[0]+238,this.screenposition[1]+36;
showimg 501,eventsbox.png,this.screenposition[0]+260,this.screenposition[1]+36;
showimg 502,@ariel@left@#I(server.events,3),this.screenposition[0]+240,this.screenposition[1]+58;
showimg 503,@ariel@left@#I(server.events,1),this.screenposition[0]+240,this.screenposition[1]+39;
}

if (actionleftmouse) {
setlevel #I(server.events,2);
hideimgs 500,503;
}

In Event Runner npc:
if(playertouchsme){
toweapons EventPlanner;
}

if (playerchats && startswith(newevent,#c)) {
tokenize #c;
replacestring server.events,0,#t(1); //yes/no
replacestring server.events,1,#t(2); // event name
replacestring server.events,2,#t(3); // levelname of event
replacestring server.events,3,#t(4); // prize
}
//OR prewrite some
if (playerchats && startswith(New Survivor Event,#c)){
replacestring server.events,0,yes;
replacestring server.events,1,Survivor;
replacestring server.events,2,survivor.nw;
replacestring server.events,3,1000g;
}

If you want it to automatically disappear after a certain time span, just incorporate the timeout to do it, or else use timevar. Also when you actually run the event, have it go replacestring server.events,0,no; So people stop trying to join. Another idea would be instead of using a chat command just setup blocks in the event room, and slash them to do the diff events.

Re: Request: Events UI

Thanks, man. I'll see if I can pick it apart and make it work for me.

I tweaked it to work on my UI's timeout and to shut itself off after two minutes. Originally, I would have to re-enter the level for the events UI to update to a different event or being shut off. But I tweaked it a bit more to be completely active.

I put this as my event setter. I found it easier to use those pre-made strings. I tossed a sleep command in there for my time till the event joining is over.

// NPC made by Koroshiya&&Handuponyohip if (playertouchsme) { toweapons Staff/Event Setter; } if (playerchats && startswith(/event off,#c)){ replacestring server.events,0,no; replacestring server.events,1,; replacestring server.events,2,; replacestring server.events,3,; } if (playerchats && startswith(/event ctf,#c)){ replacestring server.events,0,yes; replacestring server.events,1,Capture The Flag; replacestring server.events,2,events_ctf.nw; replacestring server.events,3,3 Event Coins; sleep 120; replacestring server.events,0,no; replacestring server.events,1, ; replacestring server.events,2, ; replacestring server.events,3, ; }

And I added this to my System NPC. Again, relying on the timeout set by my HUD. I added another timeout condition that if events0 is no, to hide the events UI. This added functionality for my timer and the ability to toggle the UI on an off.

if (timeout&&strequals(#I(server.events,0),yes)){ showimg 510,nyght_ui_events.png,this.screenposition[0]+340,this.screenposition[1]+410; showimg 511,@ariel@center@#I(server.events,3),this.screenposition[0]+450,this.screenposition[1]+446; showimg 512,@ariel@center@#I(server.events,1),this.screenposition[0]+450,this.screenposition[1]+421; changeimgvis 510,4; changeimgvis 511,4; changeimgvis 512,4; timeout=0.05; } if (timeout&&strequals(#I(server.events,0),no)) { hideimgs 510,512; } if (actionleftmouse) { setlevel #I(server.events,2); hideimgs 510,512; }

Thanks, again, for your help. I've never really pressed the issue of using strings, but the gears are really turning now that I believe I have a grasp on them. Kudos.

(Sidenote: We really need a reputation add-on. lol)