Koro's Requests

Y'know… I'm just going to make a thread for my requests. This should keep the clutter down. lol.

Anyways, I'm having some issues with making event coins stack up.

Currently, it consists of two NPC's. One is used to tell the player how many coins they have. The other adds to the coin count. However, I've run into several issues with the various ways I've done it.

Coin Count Display

// NPC made by Koroshiya //#CLIENTSIDE if (playertouchsme) { toweapons Event Coins; } if (weaponfired) { setplayerprop #c,You have #v(client.nyghtcoins) Event Coins!; }

Event Coin

// NPC made by Koroshiya if (created) { setimg nyght_eventscoin.png; } if (playertouchsme) { client.nyghtcoins+=1; play extra.wav; destroy; }

Now, it works perfectly fine until the player exits the zone.

I tried using “addstring” but I just get an array, but I can’t find a way to have the display NPC sum the strings up and show the total amount. Nor can I make it total them up on the string so that the display NPC can work with #I(client.nyghtcoins).

What am I doing wrong/what could be done better?

Re: Koro’s Requests

Alrighty, well to change the string under if(playertouchsme){ you should use
this.o = strtofloat(#s(client.nyghtcoins));
setstring client.nyghtcoins,#v(this.o+1);

the problem is strings work in words so you have to use strtofloat (string to float- float is a number with a decimal point), to use it as a number.

Also ussually instead of addstring, your better off with replacestring. Since you can point it at a certain spot, instead of after a certain spot.

Oops one last thing, for displaying a string in a message you must use #s(stringname); So
setplayerprop #c,You have #s(client.nyghtcoins) Event Coins!;

Re: Koro’s Requests

Awesome! I think I see how you did that. You rock, dude. <3

Re: Koro’s Requests

NEXT!!!

Ok, I'm drawing a blank on getting a good script for a Capture the Flag event.

Currently, I've got things set up to follow the player when touched and that team's flag must be home before they can score. Works great offline, but I can already see this failing online because it would default to isleader because of the bug. So, I think I need to scrap it and ask for help on this one.

What I need it to do:

-Flags able to distinguish teams (#C1, blue/red)
-Follow a single player when THAT player touches the opposing flag.
-Return to origin when carrier dies.
-Add point when touching own flag while own flag is at origin and carrying opposing flag.

I can make the score UI, thanks to Beholder and Handuponyohip. So, once these flags are finished, I can finalize the event. Also, I just need the script for one flag. I can mirror and adjust origin, etc… Just keep it in repetitive format for me. <3

Again, credit will be given in staff room. (Once it's finished)

Re: Koro’s Requests

Kinda rough lookin, but it should work fine. Make sure to save a copy as redflag.txt.

if(created){  // should use something else here, but i&#39;ll leave it up to you.
 setimg redflag.png;
 replacestring server.flagreturn,1,0;
 this.pickedup = 0;
}
if(hasflagblue){
 if(playertouchsme&&#L(redbase.nw)){
 this.score = strtofloat(#s(server.redscore));
 setstring server.redscore,#v(this.score+1);
 unset hasflagblue;
 replacestring server.flagreturn,0,1;
 }
}
elseif(!hasflagblue){
 if(playertouchsme&&strequals(#C1,blue)&&!this.pickedup==1){
 toinventory hasflagred;
 this.pickedup=1;
 timeout = 0.05;
 }
 if(playertouchsme&&strequals(#C1,red)&&!this.pickedup==1){
 toinventory hasflagred;
 this.pickedup=1;
 timeout = 0.05;
 }
}
if(timeout){
 showimg 2,redflag.png,playerx,playery-1.5;
 changeimgvis 2,3;
 timeout = 0.05;
}
if(keypressed){ // So players can drop the flag or hand it off. Press F
 if(keydown2(keycode(f),false)){
 putnpc redflag.png,redflag.txt,playerx,playery;
 unset hasflagred;   
 }
}

if(playerhearts<1&&playerhurt){ //might be better to use (playerhearts==0)
 putnpc redflag.png,redflag.txt,playerx,playery;
 unset hasflagred;
}

And Put this npc in the base, for if its returned.

if(strequals(#I(server.flagreturn,1),1){
putnpc redflag.png,redflag.txt,x,y;
}	

The blue base being the same only with #I(server.flagreturn,0),1){

Re: Koro’s Requests

Does this show the other players who the carrier is? I noticed you used toinventory but the players won't know who to go after. Personally, I think it would be hilarious to make people guess who the flag carrier is, but I know there would be too many complaints about it. lol. I'm sure you can imagine.

Re: Koro’s Requests

Yup, they can all see.
“showimg 2” using an index under 200 shows for everybody. Only index’s over 200 are shown locally.

Tested online just now and it shows for all.

Re: Koro’s Requests

You rock. <3

Re: Koro’s Requests

This is more of a question than a request.

I've seen, in numerous default Q-menus, that when you create a folder for the weapons, they have an icon. How is this done? And can you specify the different icons for different folders?

Re: Koro’s Requests

toweapons BagName/WeaponName;
Should work in online mode, as for setting the image of the bag, you cannot. It is part of the sprites.png (v2 version has the bag image, previous versions do not).

You can tell the version of your sprites.png by looking at it. v2's sprites.png only has one red portion for where the ASD goes (as well as an ear icon and ghosts), where as the previous version has 3.

Re: Koro’s Requests

So, even if I had a new version, it wouldn't work? Kinda sucks. And there's no way to force one other than a custom Q-menu, correct?

Re: Koro’s Requests

Correct XD

Re: Koro’s Requests

Ew… Oh, well. Looks tacky without one, but it's not threatening stability.

Ok, now for an actual request. After watching one of my housemates playing KH2, I got inspired to do a new GUI. Though, I don't know how much of a pain it would be. The graphics of my last one were extremely rushed. The layout was terrible and the quality was mediocre. So, I totally redid it in a KH2 fashion.

If this could be redone, I'd appreciate it.

Thanks for putting up with all my begging. =P

:Edit:
Apparently I can't use attachments. So, here's the example and the image.

Re: Koro’s Requests

Bit different, theres no clean way to do your health bar though (atleast with an image)

Re: Koro’s Requests

True, its not clean but there is a way :stuck_out_tongue:

If graal uses static memory locations for the health variable, then it would be possible to make a health bar embed it in the DX TAdventure frame and keep updating it to current health.

Re: Koro’s Requests

I mean his circular HP bar :stuck_out_tongue:
image effects work in rectangles and cannot go diagonally.
One bastardization would be to turn it into a bunch of sections/sprites

Re: Koro’s Requests

lol. That sucks. Hmm… Well, that tells me what my limitations are.

How did you do your AP bar? Maybe it could be replicated? If I need to, I can make the health bar a complete circle.

Re: Koro’s Requests

Just chop the image into a bunch of parts, then have it remove frames for health instead of a bar. Or if it's over the tiny part threshhold you set then remove a frame, so you act like a bar(decreasing the showimgpart width) until it hits the threshold then remove one of the sections.

And you only really need to do any of this when their hp is lower then 30%, since thats when your hp bar starts curling.

Re: Koro’s Requests

My AP bar is made of showpoly :stuck_out_tongue:

Re: Koro’s Requests

Well, I've scrapped the curling bar. It's just too much of a hassle, really. I'll keep simple, straight bar. Although, I'm going to give the design a total overhaul. But, thanks to the core that Beholder gave me, the only hard part will be making the HUD image look clean. (I suck at low resolution art)

But, now onto the matter that's kept me boggled for the past week or two… I'm working on a custom currency script, it worked fine until I decided that it might be a good thing for the player to see how much money they have.

Before the need for showimg, it worked fine with just “client.copper+=1.” But,recalling HandUpOnYoHip’s Event Coin script, I went to

this.o = strtofloat(#s(client.copper)); setstring client.copper,#v(this.o+1);

But, the part that broke is when you get 100 copper, it won't convert to 1 silver and so on to platinum. I figured this would be easy, it seemed simple enough. But, I think I'm screwing something up in my syntax. Here's a clip of the conversion, how should I rephrase it? I've got the whole thing on a timeout so that it's constantly updated.

if (strequals(client.silver,#v(this.o>99))) { setstring client.silver,#v(this.o-100); setstring client.gold,#v(this.o+1); timeout=0.05; }