Graal Forums  

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

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-06-2004, 05:47 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Question Help!

In the following thread it is supposed to put an npc that puts explosions based on a players power(a custom string) but it always treats it as 0, can anyone see whats wrong?

______________________________________________
if (actionserverside) {;
putnpc2 strtofloat(#p(1)),strtofloat(#p(2)),{//creates the npc;
if (created||playerenters) {setimg shadoworb.png;//sets image as shadoworb.png

this.helth=1;//sets variable this.helth as 1;
setshape 1,50,50;//sets the size;
this.helth+=strtofloat(#p(0));//Problem 1:should add the amount of variable thing, but adds 0 instead;
for (i=0;this.helth>-1;i++) {
putexplosion2 10,strtofloat(#p(0))+1//Problem 2:explosion size should be the players power +1,x,y;
sleep 1;}}
if (wa****||wasshot) {this.helth-=1;
message #v(this.helth)}
if (this.helth<=-1) {putexplosion strtofloat(#p(0)),x,y;//Problem 3: when it dies, the explosion size should be players power, but it's 0;

destroy;//destroys the npc;}


}}
//#CLIENTSIDE
if (weaponfired) {
play shock.wav;
setplayerprop#c, Mine Power: #v(strtofloat(#s(client.playerpower)));//makes player say How powerful the mine will be based on their client.playerpower string
;thing=strtofloat(#s(client.playerpower));//creates variable thing with the value of the player's power;
triggeraction 0,0,serverside,Summoner,#v(thing),#v(playerx),#v(p layery);triggers the serverside action
}
__________________________________________________ __________

Last edited by falco10291029; 06-06-2004 at 07:42 PM..
  #2  
Old 06-06-2004, 06:23 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
I am certain it would help if you formatted your scripts like ~everybody else, and used a more informative thread title. Please do so.
  #3  
Old 06-06-2004, 07:38 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
I hardly have time for that, and you mean neaten and say what each part's supposed to do? fine ill edit it
  #4  
Old 06-06-2004, 08:15 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
Get the script redone by someone who's better and use the [CODE] tags please.
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
  #5  
Old 06-06-2004, 09:26 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
what [CODE] tags
  #6  
Old 06-06-2004, 09:43 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
By using [CODE]
NPC Code:
 and [\CODE] 

ofcourse. Except with a different slash.
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
  #7  
Old 06-07-2004, 02:08 AM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
I don't see where you're getting the parameters in the putnpc's script... not to mention that you're missing a parameter in your putnpc2, and some other issues I'll just assume are typos for simplicity's sake
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
  #8  
Old 06-08-2004, 01:37 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
er you cant use paramaters in putnpcs?
  #9  
Old 06-08-2004, 05:16 PM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
Quote:
Originally Posted by falco10291029
er you cant use paramaters in putnpcs?
syntax
putnpc2 imgname,x,y,{ script };

you only have two parameters before the script, and no you can't send parameters to the putnpc script, atleast not like that

hmm, I worded my other post kinda weird
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
  #10  
Old 06-09-2004, 12:56 AM
DarkShadows_Legend DarkShadows_Legend is offline
Cult of the Winky
DarkShadows_Legend's Avatar
Join Date: Apr 2003
Location: Florida
Posts: 614
DarkShadows_Legend is on a distinguished road
Send a message via AIM to DarkShadows_Legend
Check your spelling and semicolons. Also check to see if you put in everything necessary, like the putexplosion2 doesn't look complete.
__________________
- Criminal X

"I rather be hated for being myself, than be liked for being what you like best. I go above the influence, not under." - Me
  #11  
Old 06-10-2004, 05:48 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
actually the parameters was the only real problem, except, why dont shootarrow and shootfireblast ect work in putnpcs?
  #12  
Old 06-10-2004, 10:46 PM
VeX_RaT_Boy VeX_RaT_Boy is offline
WannaBe Scripter
VeX_RaT_Boy's Avatar
Join Date: Aug 2002
Location: Norway
Posts: 960
VeX_RaT_Boy is on a distinguished road
Send a message via ICQ to VeX_RaT_Boy Send a message via AIM to VeX_RaT_Boy Send a message via Yahoo to VeX_RaT_Boy
becasue putnpcs are serverside (unless it joins a class).
__________________
-Kjetil Valen
  #13  
Old 06-10-2004, 11:00 PM
darkreign3 darkreign3 is offline
Senior Member
darkreign3's Avatar
Join Date: Sep 2003
Location: Azeroth
Posts: 125
darkreign3 is on a distinguished road
Send a message via AIM to darkreign3
LOL you need help man
__________________

A staff member without his RC is like a fat kid wihtout cake!
  #14  
Old 06-10-2004, 11:00 PM
VeX_RaT_Boy VeX_RaT_Boy is offline
WannaBe Scripter
VeX_RaT_Boy's Avatar
Join Date: Aug 2002
Location: Norway
Posts: 960
VeX_RaT_Boy is on a distinguished road
Send a message via ICQ to VeX_RaT_Boy Send a message via AIM to VeX_RaT_Boy Send a message via Yahoo to VeX_RaT_Boy
Who needs help? me?
__________________
-Kjetil Valen
  #15  
Old 06-11-2004, 12:48 AM
darkreign3 darkreign3 is offline
Senior Member
darkreign3's Avatar
Join Date: Sep 2003
Location: Azeroth
Posts: 125
darkreign3 is on a distinguished road
Send a message via AIM to darkreign3
yup your right
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 01:26 AM.


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