Jump to content

Photo

Secrets -> Item?


  • Please log in to reply
11 replies to this topic

#1 Shane

Shane

    🩶

  • Moderators
  • Location:South Australia

Posted 30 June 2021 - 10:03 PM

I'd like to see a Screen Data flag for items appearing when you activate a secret. Fairly simple request. :)


  • Anthus, Mitchfork, Mani Kanina and 3 others like this

#2 Anthus

Anthus

    Deified

  • Members
  • Location:Dark Ohio

Posted 30 June 2021 - 11:29 PM

I second this. It's one of those things that feels like it should have been there since the beginning in hindsight. Enemies -> Item exists, so it could work like that basically, I'd think.


  • Shane likes this

#3 Emily

Emily

    Scripter / Dev

  • ZC Developers
  • Pronouns:She / Her

Posted 30 June 2021 - 11:56 PM

While it does sound simple on the surface, I immediately note that every single BIT added to the mapscr struct counts a large amount against the memory used by the program, and quest file size. Not absurdly so, but enough that ANY addition to screens must not be done lightly. (FFCs are 32 times worse to add to).

 

That aside, this does sound like a worthwhile addition.


  • Anthus and Shane like this

#4 Orithan

Orithan

    Studying Scientist - Commission from Silvixen

  • Members
  • Location:Australia

Posted 01 July 2021 - 01:15 AM

According to my calculations each bit adds 17 bytes of memory per map (128+8 screens), to a max of 4.352 KB for 256 maps which must be loaded at once. This is significantly taxing insofar as ZC goes and especially large quests like Yuurand are butting right up against the 32bit memory limit as it is.



#5 Matthew

Matthew

  • Administrators
  • Pronouns:He / Him
  • Location:Ohio

Posted 01 July 2021 - 01:49 AM

Am I crazy or does 4.352 KB seem... manageable? Also, I'm not sure that an extremely ambitious outlier quest such as Yuurand should be a major consideration in adding engine features.


  • Shane likes this

#6 Emily

Emily

    Scripter / Dev

  • ZC Developers
  • Pronouns:She / Her

Posted 01 July 2021 - 02:52 AM

Am I crazy or does 4.352 KB seem... manageable? Also, I'm not sure that an extremely ambitious outlier quest such as Yuurand should be a major consideration in adding engine features.

4.352 KB *for a single boolean*. Also, keep in mind that ZC still has the 32-bit memory cap, and will for quite some time.

Adding a boolean to enemies, is not a big deal. There are only so many enemies, so it adds very little overall. We can sit and add a few hundred booleans to enemies without a single worry. For screens, if we just did that, we'd quickly run into issues.

The point here not being that adding this is particularly taxing in itself, but that everything added to screens piles up MUCH faster than things added elsewhere, so we need to be far more careful in considering each addition.


  • Mani Kanina and Orithan like this

#7 Shane

Shane

    🩶

  • Moderators
  • Location:South Australia

Posted 01 July 2021 - 03:17 AM

So is it being added or not? I'd like to have a more clearer answer, please. :)

 

That aside, this does sound like a worthwhile addition.



#8 Mani Kanina

Mani Kanina

    Rabbits!

  • Members

Posted 01 July 2021 - 05:02 AM

I keep thinking this already exists, because it's something I kinda need in most projects and end up scripting an FFC script for repeatedly.


  • Shane and Emily like this

#9 Emily

Emily

    Scripter / Dev

  • ZC Developers
  • Pronouns:She / Her

Posted 05 July 2021 - 10:03 PM

So is it being added or not? I'd like to have a more clearer answer, please. :)

As I said it'd probably be a worthwhile addition, that would mean I support it being added; that doesn't mean it's being added immediately, or that I'm the one that'll add it, though. We have plenty on our list to work on, with plenty of big features, and trying to finish 2.55 as quickly as we can.

 

So, in otherwords, it'll be added to the giant pile of things to add.


  • Twilight Knight, Mani Kanina and Shane like this

#10 Shane

Shane

    🩶

  • Moderators
  • Location:South Australia

Posted 06 July 2021 - 03:19 AM

Fair enough, good luck with the other things! Looking forward to seeing what's in store. :)


  • Twilight Knight, Mani Kanina and Emily like this

#11 P-Tux7

P-Tux7

    💛

  • Members

Posted 25 July 2021 - 08:54 PM

I keep thinking this already exists, because it's something I kinda need in most projects and end up scripting an FFC script for repeatedly.

I'd appreciate if you posted this to the database for the contest you are hosting.



#12 Mani Kanina

Mani Kanina

    Rabbits!

  • Members

Posted 26 July 2021 - 01:19 PM

I'd appreciate if you posted this to the database for the contest you are hosting.

I submitted it to the database, but in the mean time you can get it here:

 
ffc script SecretItem{
	void run(int ItemID){
		
		if(ItemID == 0) ItemID = Screen->RoomData;
		
		while(!Screen->State[ST_SECRET]){
			
			Waitframe();
		}
		
		if(!Screen->State[ST_ITEM]){
			
			item THE_ITEM = Screen->CreateItem(ItemID);
			THE_ITEM->X = this->X;
			THE_ITEM->Y = this->Y;
			THE_ITEM->Pickup = IP_ST_ITEM;
			
		}
		
	}
}
It's now in the database: https://www.purezc.n...=scripts&id=396

Edited by Mani Kanina, 26 July 2021 - 05:41 PM.



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users