Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Howto Hitpoint System (https://forums.graalonline.com/forums/showthread.php?t=50809)

R0bin 02-06-2004 01:29 AM

yeah jagen, what do you mean?

Python523 02-06-2004 01:44 AM

Quote:

Originally posted by R0bin
yeah jagen, what do you mean?
They were non existant last time I used them... ages ago anyway

Riot 02-06-2004 03:30 AM

Quote:

Originally posted by Duwul
Erm, there is? =o

When I want to pass strings and variables from one npc to a DB npc, I use thiso. vars and they work..

I just use strings/variables without prefixes, which works fine.

xManiamaNx 02-06-2004 03:33 AM

thiso.strings exist. Haven't had any luck with thiso.vars yet though

Duwul 02-06-2004 03:54 AM

They both work.

Value 02-06-2004 04:13 AM

Still messed up
 
Stefan, I did what your doc said about the actionprojectile and it still doesn't work. I did the serverside one. Also, clientside doesnt work either. Only actionprojectile2 works. Is there something wrong with my server or something? Name of my server is Altair. Please reply as soon as possible. I want to make cool bows :(

Duwul 02-06-2004 05:54 AM

Is your actionprojectile in the Control-NPC?

Value 02-06-2004 04:16 PM

Yes
 
Yes it is in the Control-NPC. I also tried putting it a DB npc as clientside and serverside. And only actionprojectile2 works. There has to be a problem somewhere. It's messed up that just because i take away the 2 from actionprojectile, it doesn't work and when i add the 2 to actionprojectile it works. And i know there is a difference between both statements. But I did what stefan put in his docu and it still only works with actionprojectile2!!!

Value 02-06-2004 04:32 PM

Posting Script
 
1 Attachment(s)
Here is the script for my bow, control-npc and class. Help me find the problem!!!!!

R0bin 02-06-2004 06:05 PM

Re: Posting Script
 
Quote:

Originally posted by Value
Here is the script for my bow, control-npc and class. Help me find the problem!!!!!
perhaps to be putting the join commands at the top of the script?

Riot 02-06-2004 10:53 PM

Re: Re: Posting Script
 
Quote:

Originally posted by R0bin
perhaps to be putting the join commands at the top of the script?
Nah, mine work fine and I put them at the end of the serverside parts.

Duwul 02-07-2004 01:05 AM

Hmm, I don't know. =o

There's something I don't understand. What's the different between actionprojectile and actionprojectile2?

Riot 02-07-2004 01:55 AM

Re: Posting Script
 
Quote:

Originally posted by Value
Here is the script for my bow, control-npc and class. Help me find the problem!!!!!
NPC Code:

//Script From Class hpfunctions
function attackplayers() {
pid = playerid;
pindexes = getnearestplayers(this.attackx,this.attacky,player id!=pid);
dist = 0;
for (i=0; i<arraylen(pindexes); i++) {
with (players[pindexes[i]]) {
dx = playerx + 1.5 - this.attackx;
dy = playery + 2 - this.attacky;
dist = (dx*dx + dy*dy)^0.5;
if (dist<=2)
hurtplayer();
}
if (dist>2)
break;
}
}
function hurtplayer() {
newhp = playerhearts - this.attackpower;
if (newhp<=0) {
newhp = 3;
setani dead,;
} else {
setani hurt,;
}
playerhearts=#v(newhp);
}
//END


playerhearts = #v(newhp); is wrong, no #v() is needed.

Dach 02-07-2004 03:29 AM

Quote:

Originally posted by Duwul
Hmm, I don't know. =o

There's something I don't understand. What's the different between actionprojectile and actionprojectile2?

the first is client-side, the latter is server-side, the first is triggered when the npc is hit with a projectile, the latter is triggered when a projectile lands on the board

Value 02-07-2004 03:35 AM

OK
 
Ok about the playerhearts part, but that still doesn't prevent the actionprojectile from triggering. Does anyone know what is wrong?


All times are GMT +2. The time now is 12:33 AM.

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