Jump to content

Photo

Multiple characters with different dominant hands


  • Please log in to reply
64 replies to this topic

#31 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 10 January 2015 - 04:12 PM

So, I went ahead and set everything up, and placed it right before my waitframe() in my global,  set up all the dummy tiles, got it to compile and.... it froze the quest on startup, so obviously I did something wrong. Problem is, I'm not sure what. And the boards are saying the code is too long to post, here, probably to do with it being, like, 253 lines long. So, yeah....



#32 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 10 January 2015 - 04:14 PM

Just use Pastebin.



#33 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 10 January 2015 - 04:21 PM

oh, hey, didn't know that exists.

 

http://pastebin.com/q9Q4yvt1

 

Like that?



#34 justin

justin

    Adept

  • Members

Posted 10 January 2015 - 04:35 PM

which is, of course, why I'm using dummy items

 

but can't the dummy items still be selected on the subscreen?

 

the way i describe, the items show up on the subscreen, but you can't select them.  when its the player who has the item that is opening the subscreen it will be there, because the script has taken it from the scripted item array and put it in the LInk->Item array.



#35 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 10 January 2015 - 04:41 PM

They're set up on the subscreen to be unselectable, using a custom class for the dummy items and item overrides. In order to be able to select an item, you have to set certain attributes, namely it's position on the list of selectable items. Think of it like setting up any other passive equipment item on the subscreen.



#36 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 10 January 2015 - 05:05 PM

Could you pastebin the entire thing? I'm not sure what I'm looking at with just a segment.



#37 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 10 January 2015 - 05:06 PM

Try it now http://pastebin.com/q9Q4yvt1



#38 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 10 January 2015 - 05:41 PM

You've got mismatched braces. The closing brace for your while loop is just before "if (Link->Item[Bullhorn] == false)", which puts the Waitframe outside it, hence the freeze. Are you using a program like Notepad++ to edit this? It has features like showing how braces are paired, line numbers, and other helpful stuff.



#39 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 10 January 2015 - 06:18 PM

Yeah, I'm using a script editor, one I got from here, it's called... um.... ZScript Editor, with all those features, but the one I'm using doesn't show me any errors (right now). So which brace do I need to move to where? Is it just moving that brace to after the waitframe, or do I need that one, too and I need to add another? And wouldn't that mean needing to add another brace earlier on, if I do that?



Ok, yeah, I think I got it fixed, Haven't tested it fully, yet, but it isn't freezing the game anymore



Um... So, yeah, it seems to not be activating the if statements for the dummy items. It placed the harmonica item in my inventory when I picked the right character, but none of the songs were placed in the place of their dummy items. It seems I somehow screwed up the if statements.

 

EDIT: Also, I edited the pastebin thingy to show how it's currently written


Edited by Lineas, 10 January 2015 - 06:22 PM.


#40 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 10 January 2015 - 06:33 PM

I'm not seeing anything that sets the "SongxDummy" items to true, so that might be it. I don't know how you've set your dummy items up exactly, though. You can try placing Trace functions in various places to see if certain sections of code are being run. I'm also seeing stuff like this:

                if (Link->Item[Bullhorn] == true)
               
           
                if (Link->Item[BSong1Dummy] == true)
                {
                    Link->Item[BSong1] = true;
                }

which doesn't make a lot of sense, so your placement of braces might still be off.



#41 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 10 January 2015 - 06:42 PM

No, the dummy items are set properly,I was wrong, I had forgotten to set the bullhorn into the inventory. The problem I'm having now is that having the bullhorn is overriding the songs being taken away, in other words, maybe changing 

      if (Link->Item[Bullhorn] == true)
            {
                if (Link->Item[BSong1Dummy] == true)
                {
                    Link->Item[BSong1] = true;
                }
                if (Link->Item[BSong2Dummy] == true)
                {
                    Link->Item[BSong2] = true;
                }
                 if (Link->Item[BSong3Dummy] == true)
                {
                    Link->Item[BSong3] = true;
                }
                if (Link->Item[BSong4Dummy] == true)
                {
                    Link->Item[BSong4] = true;
                }    
                  if (Link->Item[BSong5Dummy] == true)
                {
                    Link->Item[BSong5] = true;
                }
                if (Link->Item[JSong1Dummy] == true)
                {
                    Link->Item[JSong1] = true;
                }
                if (Link->Item[JSong2Dummy] == true)
                {
                    Link->Item[JSong2] = true;
                }
                 if (Link->Item[JSong3Dummy] == true)
                {
                    Link->Item[JSong3] = true;
                }
                if (Link->Item[JSong4Dummy] == true)
                {
                    Link->Item[JSong4] = true;
                }    
                  if (Link->Item[JSong5Dummy] == true)
                {
                    Link->Item[JSong5] = true;
                }
                if (Link->Item[SSong1Dummy] == true)
                {
                    Link->Item[SSong1] = true;
                }
                if (Link->Item[SSong2Dummy] == true)
                {
                    Link->Item[SSong2] = true;
                }
                 if (Link->Item[SSong3Dummy] == true)
                {
                    Link->Item[SSong3] = true;
                }
                if (Link->Item[SSong4Dummy] == true)
                {
                    Link->Item[SSong4] = true;
                }    
                  if (Link->Item[SSong5Dummy] == true)
                {
                    Link->Item[SSong5] = true;
                }
            }

to

 if (Link->Item[Bullhorn] == true)
            {
                if ((Link->Item[BSong1Dummy] == true) && (Link->Item[Brian] == true))
                {
                    Link->Item[BSong1] = true;
                }
                if ((Link->Item[BSong2Dummy] == true) && (Link->Item[Brian] == true))
                {
                    Link->Item[BSong2] = true;
                }
                 if ((Link->Item[BSong3Dummy] == true) && (Link->Item[Brian] == true))
                {
                    Link->Item[BSong3] = true;
                }
                if ((Link->Item[BSong4Dummy] == true) && (Link->Item[Brian] == true))
                {
                    Link->Item[BSong4] = true;
                }    
                  if ((Link->Item[BSong5Dummy] == true) && (Link->Item[Brian] == true))
                {
                    Link->Item[BSong5] = true;
                }
                if ((Link->Item[JSong1Dummy] == true) && (Link->Item[Justin] == true))
                {
                    Link->Item[JSong1] = true;
                }
                if ((Link->Item[JSong2Dummy] == true) && (Link->Item[Justin] == true))
                {
                    Link->Item[JSong2] = true;
                }
                 if ((Link->Item[JSong3Dummy] == true) && (Link->Item[Justin] == true))
                {
                    Link->Item[JSong3] = true;
                }
                if ((Link->Item[JSong4Dummy] == true) && (Link->Item[Justin] == true))
                {
                    Link->Item[JSong4] = true;
                }    
                  if ((Link->Item[JSong5Dummy] == true) && (Link->Item[Justin] == true))
                {
                    Link->Item[JSong5] = true;
                }
                if (Link->Item[SSong1Dummy] == true)
                {
                    Link->Item[SSong1] = true;
                }
                if (Link->Item[SSong2Dummy] == true)
                {
                    Link->Item[SSong2] = true;
                }
                 if (Link->Item[SSong3Dummy] == true)
                {
                    Link->Item[SSong3] = true;
                }
                if (Link->Item[SSong4Dummy] == true)
                {
                    Link->Item[SSong4] = true;
                }    
                  if (Link->Item[SSong5Dummy] == true)
                {
                    Link->Item[SSong5] = true;
                }
            } 

Would that fix it?

 

EDIT: Answered my own question, it works, now.


Edited by Lineas, 10 January 2015 - 06:49 PM.


#42 justin

justin

    Adept

  • Members

Posted 10 January 2015 - 07:04 PM

That's a lot of similar if statements. Could make a function to do that easier. And could make it even easier if you had the items grouped into sets and numbered in order, item1 (dummy) becomes item 2 (usable), item3 becomes 4, etc. Then you could use a for loop.

Frankly I'd just ditch the dummy items entirely. I'd create two smaller arrays for each character, the size of those arrays would be the max number of items for each character. Switching characters cycles through their array and gives those items, and takes away anything that isn't those items from the link array. Gaining items would have their pickup script set to add to the character array. Heck, each character could have their own hp,mp, rupees, heart containers, arrows, whatever. You wouldn't be able to do your subscreen method obviously, but i'm still not exactly clear on how that works.

#43 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 10 January 2015 - 07:11 PM

Yeah.... But I have no idea how to do all that. This script may be bulky and a pain to set up, but it works, I already set it up and I knew how to write it (mostly), lol, anyways, as far as the subscreen setup is concerned, it's as simple as setting the dummy item's position to -1, then it can't be selected on the subscreen. But by all means, if you want to write a better version for the database (which I'm sure could be very useful, especially for quests that will use the tileset I'm working on, especially being able to keep track of multiple characters' HP, MP and counters), you should definitely do that. But this definitely serves my purpose, nicely. And really, it's not that hard, at all to set up, just very time consuming, since you need to make dummies for every item on the inventory, place the dummy item underneath the main item tile (so  it should be invisible when you have the actual item) then attach a pickup script for the dummy items to be placed into your inventory. Your way would probably do a much cleaner job of it, though. EDIT: I don't intend to submit this one, anyways, since it's pretty much completely tailored to this specific quest.

 

FURTHER EDIT: Also, as long as there were separate inventory boxes, I could still do my little subscreen trickery with your method, by the way. But, from how it sounds, you could almost do it all in one inventory box,using your method, which would make all my subscreen trickery unnecessary.


Edited by Lineas, 10 January 2015 - 07:25 PM.


#44 justin

justin

    Adept

  • Members

Posted 10 January 2015 - 07:53 PM

the script isn't actually too hard to write, maybe i'll sit down and do it later tonight.  i'm actually working on a climbing item script - so link can "climb" solid tiles with the specific flag set.

 

you mind sending me a copy of your quest file?  i'd like to see how you did the subscreen, i was trying to do something similar, but couldn't get it to work for me.



#45 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 10 January 2015 - 08:01 PM

I suppose it wouldn't hurt.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users