Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   The Z-Axis (https://forums.graalonline.com/forums/showthread.php?t=29613)

mikepg 05-21-2002 05:52 AM

The Z-Axis
 
Ok, I know how to set a player's z (playerz = ect), but I have no Idea how to set an NPC's z coordinate!

z is stored as a normal variable (like i, a, m, n...).
npcs[i].z doesnt work either.

there is one command I am curious about, but i think it has to do with gmaps... setz real,real,real,real,real,real,real,real;

Is there a way to set an NPC's z?

And what exactly does setz do, because it's not explained in newfeatures, or listed anywhere that I know of.

Thanks for your help :)


~War Lord Mgp2

Neonight 05-21-2002 06:09 AM

Re: The Z-Axis
 
Quote:

Originally posted by mikepg


And what exactly does setz do, because it's not explained in newfeatures, or listed anywhere that I know of.


Jagen:
setz x,y,width,height,a,b,c,d; sets the height of the positon at the x and y your choose, a b c d are the heights of the corners,
after you use setz, use updateterrain (kindof like updateboard)

mikepg 05-21-2002 06:14 AM

yay
 
Thank you for your help. I will Try these out.

But, basically what you are saying, this is for the tiles themselves, not the npcs? correct?

Neonight 05-21-2002 06:16 AM

Re: yay
 
Quote:

Originally posted by mikepg
Thank you for your help. I will Try these out.

But, basically what you are saying, this is for the tiles themselves, not the npcs? correct?


Jagen:
yes, it sets the actual height of a part of a terrain (it only works when a terrain has been loaded I think)

mikepg 05-21-2002 06:28 AM

well...
 
I dont have any terrain to upload, lol...and, my main question hasnt been solved yet :(.

The Z axis for NPCs...is there one? If so, how do you set it?

Thanks though, Jagen.

Neonight 05-21-2002 06:33 AM

Re: well...
 
Quote:

Originally posted by mikepg
I dont have any terrain to upload, lol...and, my main question hasnt been solved yet :(.

The Z axis for NPCs...is there one? If so, how do you set it?

Thanks though, Jagen.


Jagen:
NPC Code:


if (playerchats&&startswith(z,#c)) {
z=strtofloat(#e(2,-1,#c));
}



That should work fine, just say z then a number

mikepg 05-21-2002 06:41 AM

hmmm
 
that looks like it would just set a value for z. Does that pertain to the NPC's Z-Axis though?

Saga2001 05-21-2002 11:19 AM

Ummmm...
setz is for terrain, not for npcz...
don't worry about z axis yet man...

mikepg 05-22-2002 02:37 AM

well
 
The reason I want to know how to change an NPCs axis is because of the shoot command.

To make that go above walls on a non terrain type levels, you have to set the z above 3, and the NPC will not be triggered unless it's at the same z height.

So, that is why I need to know ;).

would updating the terrain change the height of the NPC that rests on it?

Thanks.

Spanko 05-22-2002 05:07 PM

Re: well
 
Quote:

Originally posted by mikepg
The reason I want to know how to change an NPCs axis is because of the shoot command.

To make that go above walls on a non terrain type levels, you have to set the z above 3, and the NPC will not be triggered unless it's at the same z height.

So, that is why I need to know ;).

would updating the terrain change the height of the NPC that rests on it?

Thanks.

Just try it, dagnabbit.

Saga2001 05-22-2002 10:52 PM

Re: Re: well
 
Quote:

Originally posted by Spanko
Just try it, dagnabbit.
<3

Its not a hard command, dang, its described in newfeatures2002.txt, duh!

mikepg 05-23-2002 02:44 AM

umm
 
I tried it. Doesnt work for me :(.

Maybe my version is outdated. I'm gonna go see if there is a new dl.

nyghtGT 05-23-2002 02:46 AM

Wait...

The z axis is a specefic point of elevation on the terrain ?

Spanko 05-23-2002 05:42 PM

You can also sort of simulate it by just subtracting the height you want from the NPCs Y and then customly drawing the shadow at it's actual location, though it'd normally still block at the new space you put it, and the 3d terrain likes messing that up.
Another easier way would just making a new gani, though that'd still be a pain since I believe variable sprite locations per frame still aren't possible.

Anyway the subtracting from y trick does work for showimg, which is quite handy.

Projectshifter 05-23-2002 08:42 PM

o_O! I've used a Z axis b/4 in Geometry, but didn't realize it could be used in Graal. I noticed that G2k2 seemed to have 3d terrain. That is SUPER leet0, i'm gonna have to try that out... hrm... should the terrain file just be a gif of any size, or does a 3d terrain file need to take up an entire level?? I'll have to get some GATs I know to make some so I can play around with it. Bring a whole new look to Anarchy!
---Shifter

Python523 05-23-2002 10:08 PM

Quote:

Originally posted by Projectshifter
o_O! I've used a Z axis b/4 in Geometry, but didn't realize it could be used in Graal. I noticed that G2k2 seemed to have 3d terrain. That is SUPER leet0, i'm gonna have to try that out... hrm... should the terrain file just be a gif of any size, or does a 3d terrain file need to take up an entire level?? I'll have to get some GATs I know to make some so I can play around with it. Bring a whole new look to Anarchy!
---Shifter

3d terrains work off of files called gmaps, which can be made by using a program called the terrain generator
A gmap is basically like a HUGE level, even though they are made up of levels, when you load a gmap, its like loading one extremely big level

mikepg 05-23-2002 10:34 PM

umm
 
OK, what you all are saying is that there is no actual Z-Axis for NPCs??

If there isn't, then I'm going to have to rescript my whole weapon... :(.
Wont be hard, but i figured it would be a lot less laggier with the new shoot command...but alas, lol.

If there isnt a way to raise NPCs...then why have an angle and z height in the params. The only thing it would be able to hit would be a player :(.

Gohan43331 05-24-2002 10:45 AM

Re: Re: The Z-Axis
 
Quote:

Originally posted by Neonight

Jagen:
<setz stuff>

I'm trying this on a screenshot of a G2k2 level, and here's the script:

NPC Code:

if (playerenters) {
playerx=30;
playery=30;
playerz=0;
timeout = .05;
}
if (timeout) {
message #v(playerz);
timeout = .05;
}
if (playerchats) {
setz 30,30,3,3,0,1,2,3;
updateterrain;
}



Yet, it still doesn't work...it's always equal to 0...Is there some other command to start the setz?

Python523 05-24-2002 08:36 PM

umm, did you even load the gmap? how can you set the heights of a terrain without even loading one

Er1c 05-25-2002 04:56 AM

NPC Code:
z = height_you_want;



It only works on LOADED gmaps, though.

Poogle 05-25-2002 05:10 AM

Re: The Z-Axis
 
Quote:

Originally posted by mikepg
playerz = ect
its ETC not ECT!

Saga2001 05-25-2002 05:19 AM

Well no. You can set the z axis, but it doesn't matter, z axis doesn't matter if you don't load a gmap...

mikepg 05-25-2002 06:24 PM

uh
 
No, im pretty sure it ect, as opposed to etc.

Either way...
I need a G map just to set ONE Npc's z-height?

That is really dumpy.

Saga2001 05-26-2002 10:21 AM

=D it 'tis indeed. Also if you wish to work with playerz, you should do things like get some gmaps and play around, its not really tough...well most of it.

Gohan43331 05-27-2002 01:50 AM

Lol...i used a screenshot of one of the start levels and used the gmap and "changed" it a little in the editor and saved it.

Now i have two gigantic mountains in that level... :-/

Python523 05-27-2002 02:09 AM

1 Attachment(s)
Quote:

Originally posted by Gohan43331
Lol...i used a screenshot of one of the start levels and used the gmap and "changed" it a little in the editor and saved it.

Now i have two gigantic mountains in that level... :-/

replace the start gmap with this one, you shouldn't edit gmaps because the client doesnt redownload them

Gohan43331 05-27-2002 06:14 AM

Hehe...thanks... Maybe i'll make a backup of it and rename the files inside it :D


All times are GMT +2. The time now is 09:14 PM.

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