Author Topic: New bow errors.  (Read 1941 times)

Why did you add the parenthesees back :o

Why did you add the parenthesees back :o
DOH! I just copied/pasted. Is that going to work if I remove the pernthsees though?

if you change projectiledata to whatever you projectile datablock is yes

Code: [Select]
package iceBow
{
function ProjectileData::damage(%this,%obj,%col,%fade,%pos,%normal)
{
   parent::damage(%this,%obj,%col,%fade,%pos,%normal);
   %col.lastDatablock = %col.getDatablock(); 
   %col.setDatablock(Icebowarmor);
   %col.schedule(3000,setDatablock,%col.lastDatablock);     
}
};
activatePackage(iceBow)

That will freeze them for 3 seconds. Then you could do some other cool stuff like make an ice model, and then mount it on the player, but I don't know if you would want to do that.

Why dont you do like the Tranq make them stun like the skis

Then it would just be another stun-gunbow.

Why dont you do like the Tranq make them stun like the skis
Not only would it be
Then it would just be another stun-gunbow.
Itwouldn't be like being frozen.

Errors.

Code: [Select]
Loading Add-On: Heed_Medieval (CRC:689026227)
Add-Ons/Heed_Medieval/Icebow.cs Line: 489 - Syntax error.
>>> Some error context, with ## on sides of error halt:
function Icebowprojectile::damage(%this,%obj,%col,%fade,%pos,%normal)

^{

   parent::damage(%this,%obj,%col,%fade,%pos,%normal);

   %col.lastDatablock = %col.getDatablock(); 

   %col.setDatablock(Icebowarmor);

   %col.schedule(3000,setDatablock,%col.lastDatablock);     

^}

};

activatePackage(iceBow)









##
>>> Error report complete.

ADD-ON "Heed_Medieval" CONTAINS SYNTAX ERRORS

You forgot the ";" on the activatepackage(blah);

%col.setTempColor("0.66 0.75 1 1",3000); will colour the player a light blue for the three seconds.

You should change ProjectileData to Icebowprojectile or every weapon will freeze players.

You should check if the player is a standard player type (uses m.dts), so the various types of turret and Horses cannot be frozen.

Ok, thanks for all of your help! I think I learned a bit more about scripting and now I got the bow to work. Now I want to know what the function would be to make players take damage over time like burning. Also, how could I mount a burning emitter without using an image to a player alongside with the burning

To sum it up:
I need help making a fire bow burn players and mount a smoke emitter to them without using images/states or whatever.

In order to mount an emitter on a player, you must use images, and states. That's what emotes do. But you could use the built in Burn function As for the burning, you could do something like:

Code: [Select]
package Burnbabyburn
{
   function FireBowProjectile::damage(%this,%obj,%col,%fade,%pos,%normal)
   {
      Parent::damage(%this,%obj,%col,%fade,%pos,%normal);
      if(%col.getType() & $Typemasks::PlayerObjectType)
      {
         %col.burn(10000);
         burndamage(%col);
      }
   }
};
activatePackage(Burnbabyburn);

function burndamage(%obj)
{
   %obj.damage(%obj, %obj, 5);
   schedule(1000,burndamage,%obj);
}
Or something like that, I don't feel like writing that right now. It prolly won't work completely well, there are some errors with it.

@Glass. What would be wrong with it?

I think the schedule would continue even after they die.

Ok Glass, it chars them but it doesn't burn them over time. Is there something I could do with scedules to simulate burning by making it do damage every 2 seconds?