Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Problem -.- (https://forums.graalonline.com/forums/showthread.php?t=50399)

TheStivi 01-14-2004 05:58 PM

Problem -.-
 
*Rewrite because bad english *g* *
5 Minutes ago i tried to make a new Walking Engine...
I added something like this :

for (i=0;i<4;i++) if(keydown(i)) this.walk=1;

if (this.walk=1) setani aol_walk,;
else setani aol_idle,;

setplayerprop #P1,aol_head.png
....

I can see me =)
But some other people cant.

I cant see some people too.
They are invisible or i can only see a part of the legs(#P3) GFX...

But not all. I can see 1 Man =) but he cant see me correctly...

mhermher 01-14-2004 06:31 PM

Re: Problem -.-
 
Quote:

Originally posted by TheStivi
*Rewrite because bad english *g* *
5 Minutes ago i tried to make a new Walking Engine...
I added something like this :

for (i=0;i<4;i++) if(keydown(i)) this.walk=1;

if (this.walk=1) setani aol_walk,;
else setani aol_idle,;

setplayerprop #P1,aol_head.png
....

I can see me =)
But some other people cant.

I cant see some people too.
They are invisible or i can only see a part of the legs(#P3) GFX...

But not all. I can see 1 Man =) but he cant see me correctly...

I can't tell you how to fix it, but i sure can tell you to use brackers.. ( the { and } )

TheStivi 01-14-2004 07:31 PM

its dont works -.-

Loriel 01-14-2004 08:45 PM

Re: Problem -.-
 
Quote:

Originally posted by TheStivi
setplayerprop #P1,aol_head.png
You are going to get in trouble ;)

TheStivi 01-14-2004 08:46 PM

aol is the short version of age of legends ....

GoZelda 01-14-2004 09:09 PM

Perhaps serverside/clientside problem...

Oh and do use the { and } brackets, improves readability.

Hevaricubed 01-15-2004 10:26 AM

... maybe #3 instead of #P1?

TheStivi 01-15-2004 03:10 PM

no i setted head etc. with Parameters
after a while it worked more and more

now it works better than before x-x

osrs 01-15-2004 03:31 PM

Re: Problem -.-
 
Quote:

Originally posted by TheStivi
if (this.walk=1) setani aol_walk,;
Use '==' when comparing two values for equality.
Use '=' when assigning a value to a variable.

So, in that case:

NPC Code:

if(this.walk==1){
//stuff;
}



.. is better.

Alexander 01-15-2004 04:53 PM

check if everyone has the gani, if they do tell them to restart graal. if that doesn't help, good luck :D

TheStivi 01-15-2004 05:19 PM

So *g*
****On Order of Loriel i edited the script on the 'must to post' ...
I just give you the complete script :

NPC Code:

...
setplayerprop #P2,aol_arms2.png;
setplayerprop #P3,aol_legs2.png;
setplayerprop #P4,aol_head2.png;
setplayerprop #P5,aol_body2.png;
...
disabledefmovement;
...
this.walk=0;
this.newx=0;
this.newy=0;
//Keycheck
for (i=0;i<4;i++){
if (keydown(i)){set();}
}
//Onwall :D
...
//Show Chattext
showtext 1,x+this.newx,y-3+this.newy,Verdana,cb,#s(this.text);
changeimgzoom 1,0.7;
changeimgvis 0,1;
//Ask if can setgani
if (this.setgani=0){
if (this.power=6){
triggeraction playerx+vecx(playerdir)*2,playery+vecy(playerdir)* 2,hit,;
this.power=0;
}
if (keydown(4)){
freezeplayer 0.2;
this.set=0;
if (strequals(#s(client.pregani),)){
this.power++;
}
if (this.set2=0){setani aol_#s(client.pregani)shoot,;this.set2=1;}
}
else{
this.power=0;
if (this.set2=1) setani aol_#s(client.pregani)idle,;
this.set2=0;
if (this.walk=1){
if (this.set=0){
setani aol_#s(client.pregani)walk,;this.set=1
}
if (!strequals(#m,aol_#s(client.pregani)walk)){
setani aol_#s(client.pregani)walk,;this.set=1
}
}
else{
setani aol_#s(client.pregani)idle,;this.set=0;
}
}
}
...
function set(){
playerdir=i;
this.newx+=vecx(i)*0.5;
this.newy+=vecy(i)*0.5;
this.walk=1;
}



I hope it can help you to help me =)

Dont Copy for your server its illegal and wont help us all

Ningnong 01-15-2004 07:11 PM

How about reading Osrs's post -_-?

GoZelda 01-15-2004 07:16 PM

Quote:

Originally posted by Ningnong
How about reading Osrs's post -_-?
You know that doesn't matter? It just there for compatability with Java or somethin'.

Hevaricubed 01-15-2004 08:03 PM

and c++, read npcprogramming.doc to be corrupted.

xManiamaNx 01-15-2004 10:09 PM

Quote:

Originally posted by GoZelda

You know that doesn't matter? It just there for compatability with Java or somethin'.

It may not matter, but it is best to use ==.

Loriel 01-15-2004 11:29 PM

Well, you do not have to use == for testing equality, but no one will bother to read your scripts if you fail to obey some basic conventions.
btw, this thread's title sucks.

osrs 01-15-2004 11:31 PM

Quote:

Originally posted by Loriel
Well, you do not have to use == for testing equality, but no one will bother to read your scripts if you fail to obey some basic conventions.
btw, this thread's title sucks.


Why do you care with thread titles? n_n

Goboom 01-16-2004 12:28 AM

Quote:

Originally posted by osrs



Why do you care with thread titles? n_n

Rules & Guidelines:
Please try to make the thread title match the nature of the thread. The regulars are less likely to read your thread if it's titled "help" as opposed to something sensible like "Triggeraction problem".
---------------------------------
This one happens to be to blunt and un-informative.

osrs 01-16-2004 12:30 AM

Useless rule.

ZeLpH_MyStiK 01-16-2004 12:43 AM

Quote:

Originally posted by osrs
Useless rule.
Ditto, we still read the thread because we found the title interesting lol =D

Python523 01-16-2004 01:34 AM

Quote:

Originally posted by osrs
Useless rule.
No, this is a coding forum, not a chit-chat forum, the titles should make sense.


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.