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 08-20-2002, 07:38 AM
prozac424242 prozac424242 is offline
Registered User
prozac424242's Avatar
Join Date: May 2001
Location: Gone crazy: back soon
Posts: 356
prozac424242 is on a distinguished road
Send a message via ICQ to prozac424242 Send a message via AIM to prozac424242
shoot and setshootparams help...

Ok, I got this npc weapon that does the setshootparams.
then what i want it to shoot at, it reads the params like #p(0).
But what i want to happen: I want the amount that the player send in his shootparam to be passed on AND deducted from a string value.
ie:
NPC Code:

if (playerenters){toweapons working shooter;}
if (weaponfired)
{
//this.getpower will be gotten from a string
// with strtofloat(#s(string))
// but for the porposes of this test....

this.getpower=1.5;
setshootparams #v(this.getpower);
shoot playerx,playery,0,3.14/2,3.14/4,this.getpower,hatnpc,1;
}



and the object to shoot at (up, direction 0 for above code)
set a big gif for it like.. state.png or something

NPC Code:


if (created)
{
show;
this.stuffpower=100;
}

// when it gets shot...
if (actionprojectile)
{

// this is an error... how the &*@% do you read #p(0)
// for use in a real/int math operation?
this.what=#p(0);

this.stuffpower-=this.what;

// this works ok ... message code..
message #p(0) - #v(this.stonepower);

}




Any ideas how to get the variable #p(0)
passed on to do a math operation with????? anyone????
__________________

Useful links:
Graal Stats
Client Script Functions-GS1 to GS2
Serverside Script Functions-Gscript page
Particle Engine-Player Attributes
Server Options-Admin rights-Gmaps
Quote:
Originally Posted by Admins
Thanks for developing and improving playerworlds and such
Reply With Quote
  #2  
Old 08-20-2002, 07:42 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
you try this.what=strtofloat(#p(0));?
Reply With Quote
  #3  
Old 08-20-2002, 07:46 AM
prozac424242 prozac424242 is offline
Registered User
prozac424242's Avatar
Join Date: May 2001
Location: Gone crazy: back soon
Posts: 356
prozac424242 is on a distinguished road
Send a message via ICQ to prozac424242 Send a message via AIM to prozac424242
yee haw!

You are freakin amazing!
that worked - thanks.
darned string-integer conversion, heh
U R BE KEWL!
__________________

Useful links:
Graal Stats
Client Script Functions-GS1 to GS2
Serverside Script Functions-Gscript page
Particle Engine-Player Attributes
Server Options-Admin rights-Gmaps
Quote:
Originally Posted by Admins
Thanks for developing and improving playerworlds and such
Reply With Quote
  #4  
Old 08-20-2002, 09:52 AM
TLG_WL_mechman TLG_WL_mechman is offline
Banned
TLG_WL_mechman's Avatar
Join Date: Mar 2002
Location: Québec!
Posts: 661
TLG_WL_mechman is on a distinguished road
Send a message via AIM to TLG_WL_mechman
Isn't p(0) the param for the hats???
Reply With Quote
  #5  
Old 08-20-2002, 09:54 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally posted by TLG_WL_mechman
Isn't p(0) the param for the hats???
no... #p(index) is a parm in a triggeraction
#P<index> is a gani attribute
Reply With Quote
  #6  
Old 08-24-2002, 10:33 PM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
LOL, damn you Jagen! =P You beat me to it I wanted to be cool and answer this one XP. It doesn't necessarily READ it as a variable/number. strtofloat() will though if it already doesn't :P
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
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:17 AM.


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