Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-10-2002, 04:22 AM
lordhelmut lordhelmut is offline
Registered User
lordhelmut's Avatar
Join Date: Aug 2001
Posts: 710
lordhelmut is on a distinguished road
Send a message via ICQ to lordhelmut Send a message via AIM to lordhelmut Send a message via Yahoo to lordhelmut
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?
__________________

Check out the development at:
http://razza.org/lordhelmut/FantasyTales/index
Reply With Quote
  #2  
Old 02-10-2002, 08:07 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
callnpc index,event;

i guess that would work
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #3  
Old 02-11-2002, 08:29 AM
royce royce is offline
Banned
royce's Avatar
Join Date: Sep 2001
Location: Yakitinzen, China
Posts: 2,271
royce is on a distinguished road
Send a message via AIM to 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?
Reply With Quote
  #4  
Old 02-11-2002, 08:36 AM
zallus-k zallus-k is offline
Registered User
Join Date: Sep 2001
Location: AC0265, Zaroke
Posts: 122
zallus-k is on a distinguished road
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.
__________________

Solemn Destiny - Owner
Reply With Quote
  #5  
Old 02-11-2002, 09:09 AM
lordhelmut lordhelmut is offline
Registered User
lordhelmut's Avatar
Join Date: Aug 2001
Posts: 710
lordhelmut is on a distinguished road
Send a message via ICQ to lordhelmut Send a message via AIM to lordhelmut Send a message via Yahoo to lordhelmut
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
__________________

Check out the development at:
http://razza.org/lordhelmut/FantasyTales/index
Reply With Quote
  #6  
Old 02-11-2002, 10:39 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
im confused

first off, what was your ? lordhelmut

second, callnpc isn't only for p2p is it??
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #7  
Old 02-11-2002, 06:54 PM
TDO2000 TDO2000 is offline
Registered User
TDO2000's Avatar
Join Date: Jul 2001
Location: Germany
Posts: 655
TDO2000 is on a distinguished road
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...
__________________
No Webhost at the moment
Reply With Quote
  #8  
Old 02-11-2002, 08:18 PM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
Quote:
Originally posted by TDO2000


You probably mean getnpc...
lets hope so
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #9  
Old 02-11-2002, 11:38 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
timereverywhere;
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #10  
Old 02-11-2002, 11:42 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to 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.
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #11  
Old 02-12-2002, 01:28 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
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
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #12  
Old 02-12-2002, 02:53 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
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
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #13  
Old 02-12-2002, 04:10 AM
neomaximus2k neomaximus2k is offline
Registered User
Join Date: Feb 2002
Location: UK
Posts: 324
neomaximus2k is on a distinguished road
Send a message via ICQ to neomaximus2k
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,
__________________
Beware of thy Inner self
NPC Code:

_.,.__
((o\\o\))
.-. ` \\``
__( )___.o"".,___
=== ~~~~~~~~
==
= Neo

Reply With Quote
  #14  
Old 02-12-2002, 04:37 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
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
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #15  
Old 02-12-2002, 05:24 AM
neomaximus2k neomaximus2k is offline
Registered User
Join Date: Feb 2002
Location: UK
Posts: 324
neomaximus2k is on a distinguished road
Send a message via ICQ to 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
__________________
Beware of thy Inner self
NPC Code:

_.,.__
((o\\o\))
.-. ` \\``
__( )___.o"".,___
=== ~~~~~~~~
==
= Neo

Reply With Quote
  #16  
Old 02-12-2002, 09:14 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
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??
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #17  
Old 02-12-2002, 02:42 PM
neomaximus2k neomaximus2k is offline
Registered User
Join Date: Feb 2002
Location: UK
Posts: 324
neomaximus2k is on a distinguished road
Send a message via ICQ to neomaximus2k
i guess you will have to wait and see
__________________
Beware of thy Inner self
NPC Code:

_.,.__
((o\\o\))
.-. ` \\``
__( )___.o"".,___
=== ~~~~~~~~
==
= Neo

Reply With Quote
  #18  
Old 02-12-2002, 08:03 PM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
Quote:
Originally posted by neomaximus2k
i guess you will have to wait and see
cant wait,
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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