Graal Forums

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

lordhelmut 02-10-2002 04:22 AM

Passing Actions
 
Alright, I have this NPC

// NPC made by Lord Helmut
if (created) {
x+=.4;
y+=.7;
}
if (playerenters) {
message Player 1;
}
if (playertouchsme) {
setani idle,;
disabledefmovement;
setstring server.axeplayer1,#a;
setfocus 31,28;
}

then I have this one

// Graal2002 NPC by Stefan Knorr
if (created) {
showcharacter;
setcharprop #3,head0.png;
setcharprop #C0,orange;
setcharprop #C1,white;
setcharprop #C2,blue;
setcharprop #C3,red;
setcharprop #C4,black;
setcharprop #2,noshield.gif;
dir = 3;
}
if(playerenters){
timeout=.05;
}
if(timeout){
if(strequals(#a,server.axeplayer1)){
if(keydown(3)){
x+=5;
timeout=.05;
}
timeout=.05;
}
}

the first NPC is a controlled and the second is supposed to move when the first one is used. Like, the first is a button, im trying to make it so that if they push right it moves the NPC in the ring. Any idea why it wont pass the action?

TDK_RC6 02-10-2002 08:07 AM

callnpc index,event;

i guess that would work

royce 02-11-2002 08:29 AM

Babylon is a free server. Callnpc is only for p2p last time I checked. Why not use the server string as a number. first use it as 1 then use other script as 2?

zallus-k 02-11-2002 08:36 AM

The code
 
if(strequals(#a,server.axeplayer1)){
is comparing your account name to the word server.axeplayer1.

if(strequals(#a,#s(server.axeplayer1))){
would more likely run.

lordhelmut 02-11-2002 09:09 AM

Re: The code
 
Quote:

Originally posted by zallus-k
if(strequals(#a,server.axeplayer1)){
is comparing your account name to the word server.axeplayer1.

if(strequals(#a,#s(server.axeplayer1))){
would more likely run.

thanks, I will try it :D

TDK_RC6 02-11-2002 10:39 AM

im confused

first off, what was your ? lordhelmut

second, callnpc isn't only for p2p is it??

TDO2000 02-11-2002 06:54 PM

Quote:

Originally posted by royce
Babylon is a free server. Callnpc is only for p2p last time I checked. Why not use the server string as a number. first use it as 1 then use other script as 2?
You probably mean getnpc...

TDK_RC6 02-11-2002 08:18 PM

Quote:

Originally posted by TDO2000


You probably mean getnpc...

lets hope so

Saga2001 02-11-2002 11:38 PM

timereverywhere;

Saga2001 02-11-2002 11:42 PM

*waits for a cookie*

Yeah that is very true, whenever you express something like a string like server.playeri you have to put #s() around it otherwise the code checks on the string server.playeri not the value of the string server.playeri.

TDK_RC6 02-12-2002 01:28 AM

Quote:

Originally posted by Saga2001
*waits for a cookie*

Yeah that is very true, whenever you express something like a string like server.playeri you have to put #s() around it otherwise the code checks on the string server.playeri not the value of the string server.playeri.

except when using the string arrays functions, like lindexof or sarraylen

TDK_RC6 02-12-2002 02:53 AM

Quote:

Originally posted by Kaimetsu


Well, that's because you're referring to a string object rather than an actual string of characters. Just like you do when you use #s.

well, yeah, but some people may not know that

neomaximus2k 02-12-2002 04:10 AM

hmmm
 
I aint sure what you are trying to achiev, but i have created a sniper rifle using a simliar thing but using Keydowns rather than call npc and all that stuff,

TDK_RC6 02-12-2002 04:37 AM

Re: hmmm
 
Quote:

Originally posted by neomaximus2k
I aint sure what you are trying to achiev, but i have created a sniper rifle using a simliar thing but using Keydowns rather than call npc and all that stuff,
a sniper rifle? for a 2d game, man why would you want something like that

neomaximus2k 02-12-2002 05:24 AM

because it is a weapon not currently used, it isn't a TRUE sniper rifle as in you hit them one place and it only takes so much off, but you cant kill someone with it,
i guess you could call it a long range riffle but then wouldn't sound as good :P

TDK_RC6 02-12-2002 09:14 AM

Quote:

Originally posted by neomaximus2k
because it is a weapon not currently used, it isn't a TRUE sniper rifle as in you hit them one place and it only takes so much off, but you cant kill someone with it,
i guess you could call it a long range riffle but then wouldn't sound as good :P

what??

neomaximus2k 02-12-2002 02:42 PM

i guess you will have to wait and see

TDK_RC6 02-12-2002 08:03 PM

Quote:

Originally posted by neomaximus2k
i guess you will have to wait and see
cant wait,


All times are GMT +2. The time now is 06:49 PM.

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