Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Automatic Tile Setter (https://forums.graalonline.com/forums/showthread.php?t=56713)

ZeroTrack 12-28-2004 08:56 AM

Automatic Tile Setter
 
Yes this is lame and yes im very bored
PHP Code:

if (mousedown && leftmousebutton) {
tiles1={0x7FF,0x0,0x7FF,0x1,0x7FF,0x10,0x2A8,0x7FF,0x2A7,0x7FF,0x66F,0x7FF,0x7FF,0x2B7,0x7FF,0x2B8,0x7FF,0x38B,0x6E7,0x7FF,0x6E6,0x7FF,0xD11,0x7FF};
  
tiles2={0x1FF,0x3FF,0x7FF,0x1FF};
  for (
dx=0dx<65dx++) {
    for (
dy=0dy<65dy++) {
      
t=int(random(0,arraylen(tiles1)));
      if (
tiles[dx,dyin tiles2) {
        
tiles[dx,dy]=tiles1[t];
      }
    }
  }
  
updateboard 0,0,64,64;



DarkShadows_Legend 12-28-2004 09:39 AM

NPC Code:

tiles1={0x7FF,0x0,0x7FF,0x1,0x7FF,0x10,0x2A8,0x7FF ,0x2A7,0x7FF,0x66F,0x7FF,0x7FF,0x2B7,0x7FF,0x2B8,0 x7FF,0x38B,0x6E7,0x7FF,0x6E6,0x7FF,0xD11,0x7FF};



The tiles1 variable produces an error because of the space. I put it in bold. :)

ZeroTrack 12-28-2004 10:21 AM

well mines not lol forums must've done it

Moonite 12-28-2004 10:45 AM

u better stop foolign around and make some nice scripts 4 eden.... finding good personal is hard these days

WanDaMan 12-28-2004 11:20 AM

Moonite: Is that a threat?

Nice script Sern, I havn't tested it yet. I prefer to level by hand though ^^

Anarchy04 12-28-2004 10:06 PM

I was actually joking around yesterday talking about making one, heh.

That's pretty cool though...I think it details it way too much though, makes it look kinda ugly. You should make it where it it's more random when it lays tiles, so like...maybe it only details 30% of the tiles or something like that.

Also, too bad you can't save the levels like that. The only way you can make it actually save is if you do it online with the serverside updateboard2.

Still though, it's nice. :)

[Edit] Oh, as far as saving goes...I totally didn't think about putting the script in a text file in the levels/npc's directory and doing it from there. [/Edit]

ZeroTrack 12-29-2004 12:39 AM

Quote:

Originally Posted by Moonite
u better stop foolign around and make some nice scripts 4 eden.... finding good personal is hard these days

pishh i made the gui , qmenu , and profiler and i have more rights than you so shush =p <3

haro41 12-29-2004 03:52 AM

i dont understand how it works. leftmousebutton when? in level?

i turned it into a editor npc and saved it. is that how i do it? HALP

Anarchy04 12-29-2004 04:58 AM

Quote:

Originally Posted by haro41
i dont understand how it works. leftmousebutton when? in level?

i turned it into a editor npc and saved it. is that how i do it? HALP


either of those ways should work. You'll need to add the event flag 'mousedown' in the first if statement though.

if (mousedown && leftmousebutton) {

CaTigus 12-30-2004 06:03 PM

I don't know if some of you know this, But you don't have to have mousedown before leftmousebutton. Mousedown is if any button is pressed and adding leftmousebutton is just completely pointless. You can just do if (leftmousebutton).

Kaimetsu 12-30-2004 06:12 PM

Quote:

Originally Posted by CaTigus
Mousedown is if any button is pressed and adding leftmousebutton is just completely pointless. You can just do if (leftmousebutton).

Wrong. leftmousebutton is not an event.

ZeroTrack 12-30-2004 10:52 PM

Quote:

Originally Posted by CaTigus
I don't know if some of you know this, But you don't have to have mousedown before leftmousebutton. Mousedown is if any button is pressed and adding leftmousebutton is just completely pointless. You can just do if (leftmousebutton).

wow.... *ahem* , yea what your prob thinking of is if its in a loop .... .. if your not you need to read a bit more *calls rule 4* >_<

Evil_Trunks 12-31-2004 12:53 AM

you can also do this, better:

NPC Code:
if (mousedown) {
if (strequals(#p(0),left)) {
stuff();
}
}



but not leftmousebutton alone

ZeroTrack 12-31-2004 01:45 AM

Quote:

Originally Posted by Evil_Trunks
you can also do this, better:

NPC Code:
if (mousedown) {
if (strequals(#p(0),left)) {
stuff();
}
}



but not leftmousebutton alone

or even
NPC Code:

if(mousedown && mousebuttons == 1){
setplayerprop #c,Left Mouse Clicked;
}


CaTigus 12-31-2004 02:15 AM

Quote:

Originally Posted by ZeroTrack
wow.... *ahem* , yea what your prob thinking of is if its in a loop .... .. if your not you need to read a bit more *calls rule 4* >_<

NPC Code:

if (mousescreenx in |315,357|&&mousescreeny in |145,183|) {
showimg 801,@tempus sans itc@b@#w(this.index),315,340;
changeimgvis 801,5;
changeimgzoom 801,.65;
if (leftmousebutton) {


There is no loop in my script. Once again you illiterate idiot, That was not a solution, That was a suggestion. Was your little "Rule" quote an attempt to be clever? Because it failed. Go bash someone else, and get your information correct first.

Kaimetsu 12-31-2004 02:23 AM

Tigairius, the fact remains that leftmousebutton is a flag, not an event. And rule #4 covers advice in addition to complete solutions.

Evil_Trunks 12-31-2004 02:29 AM

Quote:

Originally Posted by CaTigus
NPC Code:

if (mousescreenx in |315,357|&&mousescreeny in |145,183|) {
showimg 801,@tempus sans itc@b@#w(this.index),315,340;
changeimgvis 801,5;
changeimgzoom 801,.65;
if (leftmousebutton) {


There is no loop in my script. Once again you illiterate idiot, That was not a solution, That was a suggestion. Was your little "Rule" quote an attempt to be clever? Because it failed. Go bash someone else, and get your information correct first.

you would need something like that in a timeout loop

sure, it will still work, but it's not correct

CaTigus 12-31-2004 02:29 AM

Quote:

Originally Posted by Kaimetsu
Tigairius, the fact remains that leftmousebutton is a flag, not an event.

Righto.

ZeroTrack 12-31-2004 03:13 AM

Quote:

Originally Posted by Kaimetsu
Tigairius, the fact remains that leftmousebutton is a flag, not an event. And rule #4 covers advice in addition to complete solutions.

Sern 2 , Tigairius 0

CaTigus 12-31-2004 03:43 AM

Quote:

Originally Posted by ZeroTrack
Sern 2 , Tigairius 0

Oh I never realized this was a game.

ZeroTrack 12-31-2004 07:29 AM

Quote:

Originally Posted by CaTigus
Oh I never realized this was a game.

Graal Online most certainly is =D

CaTigus 12-31-2004 07:34 AM

Well, I'm sure you can see that we are clearly not on Graalonline client talking to each other right now. This is a communication center, not a game.

haro41 12-31-2004 09:53 AM

Sern 2, Tigairius 1


All times are GMT +2. The time now is 03:41 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.