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.

  • Members
  • Real Name:Mitch
  • Gender:Male
  • Location:Alabama

Posted 22 November 2020 - 07: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
  • Gender:Female

Posted 22 November 2020 - 09: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.

  • Members
  • Real Name:Mitch
  • Gender:Male
  • Location:Alabama

Posted 22 November 2020 - 10: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
  • Gender:Male

Posted 23 November 2020 - 12:49 AM

i->Pickup |= IP_TIMEOUT;

 

That flag controls both properties, I think.


  • Mitchfork likes this

#5 Venrob

Venrob

    Scripter / Dev

  • ZC Developers
  • Real Name:Rob
  • Gender:Male

Posted 23 November 2020 - 10: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