Jump to content

Photo

[NOT]Script-created Fairies have bad properties


  • This topic is locked This topic is locked
4 replies to this topic

#1 Mitchfork

Mitchfork

    no fun. not ever.

  • Contributors
  • Real Name:Mitch
  • Location:Alabama

Posted 22 November 2020 - 08:07 PM

If you create a Fairy (Moving) via a script function, e.g.

 

CreateItemAt(34,x,y);

 

It will appear, move correctly, and heal correctly.

 

However, they have no duration (exist infinitely on-screen) and cannot be picked up with the boomerang, unlike regular fairies.



#2 Mani Kanina

Mani Kanina

    Rabbits!

  • Members

Posted 22 November 2020 - 10:33 PM

...I'm pretty sure items you create with scripts, you yourself will have to define with the modifier flag if you want them to time out.



#3 Mitchfork

Mitchfork

    no fun. not ever.

  • Contributors
  • Real Name:Mitch
  • Location:Alabama

Posted 22 November 2020 - 11:13 PM

...I'm pretty sure items you create with scripts, you yourself will have to define with the modifier flag if you want them to time out.

 

I couldn't find any relevant settings for this in zscript.txt or the additions document - and the item editor itself doesn't seem to have any options for this either.



#4 Saffith

Saffith

    IPv7 user

  • ZC Developers

Posted 23 November 2020 - 01:49 AM

i->Pickup |= IP_TIMEOUT;

 

That flag controls both properties, I think.


  • Mitchfork likes this

#5 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 23 November 2020 - 11:09 AM

i->Pickup |= IP_TIMEOUT;

 

That flag controls both properties, I think.

^ This would be correct. When working with ZScript, be sure to not only read zscript.txt, but 'std_constants.zh', as that documents a lot relating to constants, including the IP_ constants which define item pickup rules such as this. Items with the 'IP_TIMEOUT' flag will expire after a time, and are able to be picked up by boomerangs and the like.


  • Mitchfork likes this


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users