Jump to content

Photo

I am under the faulty impression that this is possible.


  • Please log in to reply
5 replies to this topic

#1 ShadowTiger

ShadowTiger

    The Doctor Is In

  • Members

Posted 13 January 2017 - 09:53 PM

For some reason, I have the strangest impression that this is a thing that is possible to do.

I'd like to have it possible that the player can explore the names of the items they have by moving the selection thing over any item when they're in the subscreen, but they can't exit the subscreen and have, say, the wallet assigned to the B button.

So basically, you're moving the subscreen selector around the subscreen, checking out all the names of the items, but you'll never be able to have that item assigned to B to "use" any of the Equipment items except the items we normally use, like the Hookshot or potions.

#2 kurt91

kurt91

    Follower of Destiny

  • Members
  • Real Name:Kurtis
  • Location:Eastern Washington University

Posted 13 January 2017 - 11:32 PM

You mean possible with scripting, or possible without? Without scripting, I'm not sure. With scripting, I would guess something like making the buttons to leave the Subscreen no longer work while on an incompatible item, or storing the items currently equipped in a variable when you open the Subscreen, and then the game swapping back to those if you leave the Subscreen on an incompatible item.

 

Then again, if we're talking without scripting, I would guess that the "equippable A and B items" rule might be a hint on how to do this, since that means that you have to actually press the button to equip to in order to move the item to the slot, and you can't just highlight the item and close the Subscreen to equip it.


  • ShadowTiger likes this

#3 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 14 January 2017 - 09:10 AM

It is not possible using the internal subscreen, at all. You can do this, only with a fully-scripted subscreen, as drawing to he active subscreen by script is not possible; and on the internal subscreen, an object that is to be used passively must have a position of '-1'.

 

The selector cannot move to such items.

 

You could half-fake it using item override, but that could still set the dummy item to a slot, too. There is no good way to intercept button presses on the active subscreen, either; if any.

 

My apologies, if this ruins your plans, here. :(


Edited by ZoriaRPG, 14 January 2017 - 09:16 AM.

  • ShadowTiger likes this

#4 Deedee

Deedee

    Bug Frog Dragon Girl

  • Moderators
  • Real Name:Deedee
  • Pronouns:She / Her, They / Them
  • Location:Canada

Posted 14 January 2017 - 06:08 PM

I know of 2 ways to do this, both requiring scripting:

Easier way: Let the unusable items be "equippable", but if you exit the subscreen with them equipped, your equipped item will automatically change to something usable.

Harder way: Scripted Subscreen.

The hardest part about a scripted subscreen isn't making it work, but the visual design (basically, same problem as vanilla subscreen editor) and making sure said subscreen plays nicely with other things. 


  • ShadowTiger likes this

#5 Old-Skool

Old-Skool

    Hero of Time

  • Members
  • Location:Missouri

Posted 14 January 2017 - 08:48 PM

that seems more than possible. Just requires a little scripting. Heck I feel like I might have seen someone do it


  • ShadowTiger likes this

#6 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 15 January 2017 - 03:10 PM

that seems more than possible. Just requires a little scripting. Heck I feel like I might have seen someone do it


I seem to recall that Moosh did it on his scripted subscreens in his newer sidescrolling games.
 

I know of 2 ways to do this, both requiring scripting:

Easier way: Let the unusable items be "equippable", but if you exit the subscreen with them equipped, your equipped item will automatically change to something usable.

Harder way: Scripted Subscreen.

The hardest part about a scripted subscreen isn't making it work, but the visual design (basically, same problem as vanilla subscreen editor) and making sure said subscreen plays nicely with other things.


Store GetEquipment*() when the Link->PressStart, and set a flag 'saveditems' somewhere, so that when exiting the subscreen, the new items are not saved, and if the items are illegal, change them back after the subscreen fully exits.
 
//inside global active script's run function
bool subscreenActivated; int buttonItems[2];

//inside the while loop prior to waitdraw
if ( Link->PressStart && !subscreenActivated ){
    SubscreenActivated = true;
    buttonItems[0] = GetEquipmentA();
    buttonItems[1] = GetEquipmentB();
}

if ( Link->PressStart && subscreenActivated ){
    //might need extra code and a timer.
    SubscreenActivated = false;
    
    if ( IllegalItemA() ) __SetLinkItemA(buttonItems[0]);
    if ( IllegalItemB() ) __SetLinkItemB(buttonItems[1]);
}

//At file scope or at script scope
bool IllegalItemA(){
    int listillegal[]={0}; //Populate with ilegal items.
    int itmA = GetEquipmentA();
    for ( int q = SizeOfArray(listillegal); q >=0; q-- ) {
        if ( itmA == listillegal[q] ) return true; 
    }
    return false;
}

bool IllegalItemB(){
    int listillegal[]={0}; //Populate with ilegal items.
    int itmB = GetEquipmentB();
    for ( int q = SizeOfArray(listillegal); q >=0; q-- ) {
        if ( itmB == listillegal[q] ) return true; 
    }
    return false;
}

When doing this, the passive subscreen may briefly may show the improper items.

Edited by ZoriaRPG, 15 January 2017 - 03:21 PM.



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users