Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   testimage(x,y) (https://forums.graalonline.com/forums/showthread.php?t=18360)

adam 12-05-2001 10:22 PM

testimage(x,y)
 
just like testnpc but for showimg.

You would prabably have to implement things like.

image[index].x
image[index].y
image[index].width
image[index].height
image[index].type
showimg index,image,x,y;
imgtype index,5;

Now you can check for the image with the specified type.

Like if you have a bunch of images in a level and only want to detect certain one's you can change the type and check for that.

etc... surely there are more things....


There could be many use's for this im sure. And several I can think of right now.


NPC Code:

if (playerenters){
for (this.i=0;this.i<10;this.i++){
xys[this.i+0]=random(0,64);
xys[this.i+1]=random(0,64);
xys[this.i+2]=random(-1,1);
xys[this.i+3]=random(-1,1);
showimg this.i,stone.gif,xys[this.i],xys[this.i+1];
imgtype this.i,5;
}
timeout=.05;
}

if (timeout){
for (this.i=0;this.i<arraylen(xys);this.i+=4){
xys[this.i+0]+=xys[this.i+2];
xys[this.i+1]+=xys[this.i+3];
showimg this.i,stone.gif,xys[this.i+0],xys[this.i+1];
}
timeout=.05;
}

// insert into npc trying to test for these randomly flying rocks
// with a type of 5

function test(){
for (this.i=0;this.i<imagescount;this.i++){
if (images[this.i].type==5){
if (testimage(x,y)==this.i){
putexplosion2 3,0,x,y;
}
}
}
}




... I hope that conveys the idea...

adam 12-07-2001 04:34 AM

:(

adam 12-08-2001 12:13 PM

:(
*bangs head on wall*

Qwert616 12-08-2001 12:25 PM

I...don't get it sorry

(posting so you dont go crazy:) )

adam 12-09-2001 04:32 AM

:D a reply@!


But im looking for comments@!#

adam 12-10-2001 02:33 PM

*waits for comments from smart people who know stuff*


*waits some more*

Falcor 12-10-2001 10:31 PM

Image stuff would be good.. But isnt it a little bit uselss?

adam 12-11-2001 01:02 AM

I find it easier to make an asteroid field with showimg than just npc's...


my asteroids script could all be in one script (asteroids included) with testimage(x,y) and type.


There is no accurate way to do it otherwise. well almost.

But I'd rather not do that hehe.

I have other things to do like school

Spark910 12-11-2001 02:05 AM

Yeah i think stefan should start and choose some ideas and make them happen.

adam 12-20-2001 12:46 PM

It would be nice if Stefan set out to make the most powerful scripting engine any game has ever seen. But he didn't
He is simply out to make a fun game full of little things like golf. Not that that is bad or anything.
It would be nice if we had a much more powerful scripting language. With which we can do many many more things.

I mean right now it can't even do some basic snes stuff. If we could at least emulate snes quality stuff like image rotation *wink wink* man the effects would take a skyrocket up there!

Xaviar 12-21-2001 12:34 AM

That'd be cool, but mostly, setimgrotate is a command I want to see, you can do alot of the other stuff with arrays...the width and height would be nice, though...

Juron Pilo 12-21-2001 02:55 PM

we have traveled down this road many times... imgrotation AINT GONNA WORK... I asked about this LONG AGO... GIVE IT UP

Admins 12-21-2001 07:39 PM

It's not the script language, its the problem
that many gfx cards don't support it.
It would be take ~5 minutes to add
image rotation, but only people with Direct3D
support could see it, so you couldn't use
it for important stuff.

aesquivel 12-21-2001 10:05 PM

Quote:

Originally posted by Stefan
It's not the script language, its the problem
that many gfx cards don't support it.
It would be take ~5 minutes to add
image rotation, but only people with Direct3D
support could see it, so you couldn't use
it for important stuff.

well that really wouldnt matter because i bet most ppl that play graal can and if they wanted to play grall with kool stuff then they would upgrade there cpu so hat they could

Xaviar 12-21-2001 11:35 PM

Quote:

Originally posted by Stefan
It's not the script language, its the problem
that many gfx cards don't support it.
It would be take ~5 minutes to add
image rotation, but only people with Direct3D
support could see it, so you couldn't use
it for important stuff.

Possibly add a 'direct3dsupported' flag, so that we can check for it, and give people an alternative if they can't

Tyhm 12-22-2001 01:58 AM

Hang on...Stefan, surely you could rotate an image 90 degrees without Direct3d, yes? It's just a matter of drawing it top-to-bottom instead of left-to-right...sure, it's a bit complicated, but I could make an NPC rotate a showimg 90 degrees practically in my sleep...
Maybe it shows the smooth rotations for D3D people and the 90 degree rotations for the unupgraded?

Warcaptain 12-22-2001 08:15 AM

Re: testimage(x,y)
 
Quote:

Originally posted by adam
just like testnpc but for showimg.

You would prabably have to implement things like.

image[index].x
image[index].y
image[index].width
image[index].height
image[index].type
showimg index,image,x,y;
imgtype index,5;

Now you can check for the image with the specified type.

Like if you have a bunch of images in a level and only want to detect certain one's you can change the type and check for that.

etc... surely there are more things....


There could be many use's for this im sure. And several I can think of right now.


NPC Code:

if (playerenters){
for (this.i=0;this.i<10;this.i++){
xys[this.i+0]=random(0,64);
xys[this.i+1]=random(0,64);
xys[this.i+2]=random(-1,1);
xys[this.i+3]=random(-1,1);
showimg this.i,stone.gif,xys[this.i],xys[this.i+1];
imgtype this.i,5;
}
timeout=.05;
}

if (timeout){
for (this.i=0;this.i<arraylen(xys);this.i+=4){
xys[this.i+0]+=xys[this.i+2];
xys[this.i+1]+=xys[this.i+3];
showimg this.i,stone.gif,xys[this.i+0],xys[this.i+1];
}
timeout=.05;
}

// insert into npc trying to test for these randomly flying rocks
// with a type of 5

function test(){
for (this.i=0;this.i<imagescount;this.i++){
if (images[this.i].type==5){
if (testimage(x,y)==this.i){
putexplosion2 3,0,x,y;
}
}
}
}




... I hope that conveys the idea...


um....

let me go find the post where I POSTED ABOUT THIS FIRST >:o

adam 01-08-2002 12:34 PM

Re: Re: testimage(x,y)
 
Quote:

Originally posted by Warcaptain



um....

let me go find the post where I POSTED ABOUT THIS FIRST >:o

Perhaps you did mention it first.

But I just thought up a use for it so blah :p I posted it again. And It came from my mind. And I scripted that example from scratch on the spot. blah blah blah.


All times are GMT +2. The time now is 11:36 AM.

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