![]() |
?Tile>Fish<Random?
Ok the subject gives ya a clue on what I need help on. I am trying to make a fish for Eternal Destiny just randmize around on a certain tile. Can somebody even tell me where I begin!?
|
~AlphaFlame~
Just a guess, but wouldn't you need to do something like if (timeout){ Check(); showimg 0,0,fish.gif,this.x,this.y; timeout=1; } function Check(){ this.x=int(random(0,64)); this.y=int(random(0,64)); if (!tiles[this.x,this.y]=tile)Check(); } Eh, maybe? |
gah that helps alot! thanx, i've never done a script that runs on random and on a certain tile so i didnt know what to do.
|
i dont thinkthat is right
first Let me saywhat the crap is this
if (timeout){ Check(); showimg 0,0,fish.gif,this.x,this.y; timeout=1; } function Check(){ this.x=int(random(0,64)); this.y=int(random(0,64)); if (!tiles[this.x,this.y]=tile) Error... no ; Check(); YOUR redoing the function within the function...... } Ok i wil explain ok have it so that it replaces the fish in a diffeent spot every couple seconds... right.. and lets not use functions..since.. it might confuse u.. no offense if (timeout||created){ // does the stuff below when // first created or when timer runs out this.done=0; while (!this.done=1){ // keeps doing the below until it finds a tile //that is what ever the tile u are looking for is this.x=int(random(0,64)); // gets a random number between 0&64 this.y=int(random(0,64)); if (tiles[this.x,this.y]=***){this.done=1;} } showimg 0,0,fish.gif,this.x,this.y; // shows fish at this.x and this.y timeout=1; } // ends statment Where the ***'s are at put in the number tile for the water.. or what ever.. i dont know what it is this should work i have not checked.. Hope that helps Dragoon Vengance Owner of Pangea Relics of Time |
gah too hard **** XD! I am mainly into levels and gfx but scripting isnt too bad but crap like this is confusing. I have alot of stuff to script so I need some practice. No it doesnt work.
|
let me test it and fix it for u then
|
Sorry im so stupid .. i dont know why i dint think of using on water
if (timeout||created){ this.done=0; while (!this.done=1){ this.x=int(random(0,64)); this.y=int(random(0,64)); if (onwater(this.x,this.y)){this.done=1;} showimg 1,appletree1.gif,this.x,this.y; } timeout =1;} replace appletree1.gif with the fish |
1 Attachment(s)
omg! me too...damn water and tiles...lol...btw it only puts the picture in 1 spot around everywhere! I wanted the fish to roam around without warping places! heres the pic
|
ive been doing this for water spashes should work for fish too
if (playerenters) { timeout = 0.1; } while (timeout) { setani FISHANI,; x = random(water end left,water end right); y = random(water end up,water end down); sleep 0.2; } the water end DIR is the X and Y needed |
~AlphaFlame~
Oh my god... Poogle... why the hell are you using while (timeout)?! And besides, recalling a function within a function could be used in conjunction with strings if you needed to do... say... a wall-crawling spider and a water-roaming fish in the same NPC. Or if you needed to recall the function someplace else in the script. Trada. I win. |
~AlphaFlame~
Oh my god... XD the forum agreed with me! I WIN!! |
1 Attachment(s)
~AlphaFlame~
Err screenshot... wtf is up with the attacher... |
dont ask ;P
NPC Code: |
ok liquid that is still wrong...God made me not to be a scripter so please dont critisize. It just bouces off the walls and sides liquid. I want it to setimg when x is - then change when x is +....not like a ping pong ball that keeps boucing back in fourth....
Too hard XD |
ok.. i thought u wanted it to randomly appear sorry
so u want it to move just right till it hits a wall then left.. or what.. give me more detail and if i feel like it i will this is easy i just miss understood u |
Quote:
|
Quote:
|
Quote:
|
i dont get what u mean.
|
Quote:
|
I have a script already perfectly for my servers fishing works fine and all, but wont give it out :-\ I might of helped chik but I quit/got fired from ed
|
Quote:
|
this also has nothing to do with jobs.....it is just something that will be swimming around.
|
Quote:
|
it was good enough for a 5 minute thing. Now back to what I was saying.
|
~AlphaFlame~
Hey poogle... I'll say this, 56k modem. The only edit I did to that picture was adding the n for win. OMG LIKE THAT N IS A WHOLE ATOM OFF!!! OMG FAAAAAAKEEEEEEEE!!!!!!!!!!!! Poogle... do me (and probably more people) a biiiiiig favor... tie a rock around your neck with a frayed rope, then put the rock on a pier. Jump over the edge so that you're hanging over shark-infested waters, and so crows and ravens and seagulls can eat your eyes out. Then, the rope breaks and you fall in, promptly getting eaten by sharks. And the peasants rejoice. <Peasants> *Rejoice* |
Quote:
|
~AlphaFlame~
Can you tell I don't like Poogle? Anyway, left/right fish? Try this... and yes, I have been up for uh... 14 hours now, so it might not exactly work 100%... if (playerenters || created){timeout=.05;timereverywhere;} if (timeout){ if (x in |left x,right x){x+=vecx(this.dir)/4;} else { if (x<left x)this.dir=3; else this.dir=1; } timeout=.5; } Change the speed by modifying this: x+=vecx(this.dir)/4; Just change the 4... right now, it moves .25 left/right. And make sure to edit the parts in bold. [edit] Notice, Poogle, If (timeout) [/edit] |
so u want x and y movement totally randomized..
|
thanx....yes a random moving fish.
|
~AlphaFlame~
*ker-try* if (playerenters || created){timeout=.05;timereverywhere;} if (timeout){ this.dircng+=random(.01,.3); if (this.dircng>1){ this.dircng-=1; this.dir=int(random(0,5)); } if (!onwall(x+vecx(this.dir),y+vecy(this.dir))){ x+=vecx(this.dir); y+=vecy(this.dir); } else { this.dircng=1; } timeout=.5; } Another 4:30 a.m. script, brought to you by... *snoooore* |
It goes on grass
|
Quote:
|
i made a cool fish
i made a cool fish that wandered around in all directions and did stuff like that, but than i kinda realized i scripted it bad and it would hit the wall, and freeze after a while, so i quit graal.
|
How did you guess that!? Man dont tell out my secret.. I have a ubber leet server comming out.. Its called "Stuff I take from forums" and then I just got done scripting this npc that says hi... took me 3 days
its like //Npc made by Mrmicro if (playerenters) message hi!; DONT STEAL THAT SCRIPT I DID IT AND IT TOOK ME 3 DAYS! If you beleive that then your an idiot... I was simply testing to see if the fish went on grass or not..! Dont flip out |
better not use my graphics mr chik
|
Note: He is using the graphics you sent him
|
you know
he never told me that the graphics i give him belong to the server i signed no contract so your agreement is void never told me about it nor did i agree to it those graphics belong to me and if you use them you are stealing graphics and i will tell stefan |
Quote:
|
umm
why dont you try this:
NPC Code: that will make your fish wonder around aimlessly on the water. not a whole lot to it. this thread didnt need to be 3 pages long. |
| All times are GMT +2. The time now is 08:20 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.