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????