Jump to content

Photo

One map for multiple Level Numbers.


  • Please log in to reply
6 replies to this topic

#1 ShadowTiger

ShadowTiger

    The Doctor Is In

  • Members

Posted 08 July 2013 - 02:03 PM

Background: I'm working with a dungeon that has nine+ floors, and each one is a different level number. Hence the problem here. There really ought not to be nine+ maps, because that's just excessive. (Every floor is a 3x3 arrangement. It's a tower.)

So it would be mighty convenient to only need to collect a single map to show the entire tower.

So yeah, this is a strange one. I don't think it can really be done with an item script. A single script would either have to assume the level numbers to toggle the map for are all adjacent to one another, or would only be able to accommodate fewer than 9 level numbers. Plus, an item script would be hard-coded to the item itself.

So what I was thinking would be a better idea would be an FFC script that, upon collecting the map item (Item #21 by default I believe.) it would give the player the map item for every Level Number specified in its D0->D7 values.

The benefit of doing it this way is that you can have two scripts on the same screen with different values in their D slots. So with only two FFCs running the same script, you could get 16 floors mapped out with a single map. Pretty neat.

------------------

So first it would check to see if item (#21) is collected or not. When it is, it goes through all the D values, setting Game->LItems[const int LI_MAP] to 1.


It's quite the useful script, I'd wager.

#2 justin

justin

    Adept

  • Members

Posted 08 July 2013 - 02:28 PM

reading your post, i had a cool idea, but its divergent of what you want to do...

 

since each floor is a different level number, you could have a collectible map item for each floor.  gaining individual maps for the same shape 3x3 tower floor might not be so necessary, but for other multifloor dungeons it could be cool.  especially if combined with your script idea, have a couple different maps located through the dungeon that give you multiple floors at a time.



#3 ShadowTiger

ShadowTiger

    The Doctor Is In

  • Members

Posted 08 July 2013 - 03:37 PM

Right... though one of the reasons In inquiring is that the mechanisms powering this particular dungeon require several of the stories to share a level number, meaning when you get the map in the basement, suddenly level 4 has a map, even though you never got it. But not level 3 or 5. Just 4. How arbitrary that must seem.

#4 Theryan

Theryan

    Burrito

  • Members

Posted 08 July 2013 - 03:52 PM

If the map level numbers are all in order without any breaks(ex. Levels 3, 4, 5, 6 , 7, 8, 9, 10, 11, and 12) you could just specify the first and last map number in the ffc's d-values and setup a loop to activate the map item for each level number so that you don't waste all your d-values on individual level numbers.

#5 ShadowTiger

ShadowTiger

    The Doctor Is In

  • Members

Posted 08 July 2013 - 03:54 PM

I'd love to do that, if they were in order. Not something I'm willing to mess with though.

It's okay if all the D slots are used, though. Two of the same FFC scripts with different D values probably wouldn't interfere with each other, would they?

#6 Theryan

Theryan

    Burrito

  • Members

Posted 08 July 2013 - 04:13 PM

As long as the ffcs don't share any level numbers in their d-values, I can't imagine it could cause any issues; in fact, i doubt they would cause any issues even if they did share some values. But I'm probably not nearly experienced enough with zscript to say for sure.

#7 grayswandir

grayswandir

    semi-genius

  • Members

Posted 08 July 2013 - 06:46 PM

Completely Untested.

item script MultiMap {
  void run() {
    if (Screen->D[0] != 0) {Game->LItems[Screen->D[0]] |= LI_MAP;}
    if (Screen->D[1] != 0) {Game->LItems[Screen->D[1]] |= LI_MAP;}
    if (Screen->D[2] != 0) {Game->LItems[Screen->D[2]] |= LI_MAP;}
    if (Screen->D[3] != 0) {Game->LItems[Screen->D[3]] |= LI_MAP;}
    if (Screen->D[4] != 0) {Game->LItems[Screen->D[4]] |= LI_MAP;}
    if (Screen->D[5] != 0) {Game->LItems[Screen->D[5]] |= LI_MAP;}
    if (Screen->D[6] != 0) {Game->LItems[Screen->D[6]] |= LI_MAP;}
    if (Screen->D[7] != 0) {Game->LItems[Screen->D[7]] |= LI_MAP;}}}

Put it as a pickup script for a custom item, set the D values of the screen the map is on to what levels you want to get the map for.

 

 

Edit: Oh wait, you can't set those in the editor. Hold on a minute...

 

ffc script SetD {
  void run (d0, d1, d2, d3, d4, d5, d6, d7) {
    Screen->D[0] = d0;
    Screen->D[1] = d1;
    Screen->D[2] = d2;
    Screen->D[3] = d3;
    Screen->D[4] = d4;
    Screen->D[5] = d5;
    Screen->D[6] = d6;
    Screen->D[7] = d7;}}

 

You could probably get away without using the Screen D by checking for a specific FFC, but this is probably the simplest .


Edited by grayswandir, 08 July 2013 - 06:52 PM.



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users