[SOLVED] Project not opening. Author.Mood=Embarrassed

Niekitty
28 Sept 2016, 22:00

Okay. This one is entirely my fault, and I know what went wrong, and pretty much why, but I have NO clue how to fix it. I realized (after a few days of hammering my head against it) that the wearables library i was using in one of my two projects was just NOT going to cooperate without my editing IT as well. I figured that I didn't need that much complication anyway, so I set about trying to carefully remove the wearables library from the project file.
This appears to have been idiotic of me.
As of now, any attempt to load the project file at all causes an error, so I can't even poke in to fix it. I must have forgotten to remove some of the attributes (knowing me: probably a lot of them).

So, how bad did I screw up?
Is there a way to wrench the project open and lop out the offending attributes manually, or am I starting over?

Also: feel free to dopesmack me; I think I deserve it.

EDIT: SOLVED
[trudges out the worm-riddled door of Notepad, spattered in the ochre gore of dozens of attributes]
Alright... FIXED! But the GUI had better not send me off on some dumb fetch quest after this!


Anonynn
29 Sept 2016, 01:56

Just to make sure this doesn't happen again. Make sure that when you stop using a library, that you uncheck all aspects, erase anything having to do with the library and then you go through the tree of stuff and remove it from your game. Just ask for help if you need it for those steps.

What I mean is...let's say you have some clothing. A torso item, you have to go into the wearables tab and delete the torso thing, remove all the code from it regarding the wearables library, otherwise if you try to just uninstall the library, your game in the next boot will come across an error because of wearables code that you had left over on that one shirt item. Make sure to do this for any libraries you're wanting to uninstall. Be thorough!


Anonynn
29 Sept 2016, 01:57

Notepad ++ is your friend :)


hegemonkhan
29 Sept 2016, 06:48

also, have a good system of file backup'ing, always backup your game file, before you try doing any serious/major messing with it. Anytime you're trying to do something new, add some new system/feature/etc to your game... create a new game file, copy your game code to it, and then mess around with testing/trying what you want to do with it, so you don't mess up your actual game file. etc etc etc. While messing stuff up, can usually be fixed... that doesn't mean that it's not a pain in the bum... so, avoiding this annoyance is preferrable, obviously.

And since, Anonynn, already beat me to advocating downloading and using notepad++, I'll add in my support of this instead, lol.

color coding is extremely helpful (select the 'xml' choice within the 'language' option from the horizontal menu bar at the top of the notepad++ window when you got it downlaoded, installed, and opened up)... not to mention all the really useful editing/etc features/abilities of notepad++, that I've yet to learn/utililize, lol


The Pixie
29 Sept 2016, 07:39

What are/were you trying to do with wearables? I have an updated version that might be more flexible:
https://github.com/ThePix/quest/wiki/Clothing-Library

If it is something that sounds like it would be generally useful, I could look at updating it to cover your needs too.


Niekitty
29 Sept 2016, 22:03

I missed a few of the auto-generated attributes on a coat and a pair of slippers. XD
I'm NOT much of a coder most of the time, but I am learning. That said, digging through that much code in Notepad, looking for a handful of misshapen, mutant attributes was Not Fun, but not terribly difficult once I pinned down where they were hiding.

And yeah, I do need to keep more backups. I've been doing a lot of my coding at work (nothing. else. to. doooooo.), so I spent a shift working the wearables in, only to have it not work as intended/wanted. I am going to start keeping a LOT more backups, because that was horrifying.

I was using Chase's wearables library. The problem was that it was creating a massively cluttered mess of the inventory pane. I sorted the pane into sections to clean it up (Items, Clothes, Keyring), but as soon as the clothes objects were not stored on the player object itself, they no longer responded to the Wear and Remove commands. On top of that, anything that got worn by script instead of player choice (like the protagonists starting clothes, cursed items, etc) were all losing their aliases entirely as soon as they were Removed, if I did leave them on the Player object instead of sorting them.
On top of all that fun, I realized that I just didn't need all the extra complication. So far, aside my own idiotic typos, it seems to be working. Just takes a bit of testing every time I create new clothes to make sure they're working (like the pendant I was beating my head on for 4 hours this morning before noticing I had "cloNeckRaePendant" instead of "cloNeck_RaePendant".
Much headdesking ensued.

...Pixie, I may have to look more at your wearables library some time; this looks good.


hegemonkhan
29 Sept 2016, 22:25

if you want a more simple equipment system (if you're not going to use Pixie's):

(no multiple layers/levels for the same equipment slot/body part-location though)

create/add Object Attributes inside of your 'player' Player Object, for each equipment slot/body part-location, for example:

<object name="player">
  <attr name="left_hand" type="object">unarmed</attr>
  <attr name="right_hand" type="object">unarmed</attr>
  <attr name="head" type="object">unarmed</attr>
  <attr name="torso" type="object">unarmed</attr>
  <attr name="waist" type="object">unarmed</attr>
  <attr name="legs" type="object">unarmed</attr>
  <attr name="feet" type="object">unarmed</attr>
  <attr name="arms" type="object">unarmed</attr>
  <attr name="hands" type="object">unarmed</attr>
</object>

<object name="unarmed">
  <attr name="damage" type="int">1</attr>
  <attr name="defense" type="int">0</attr>
</object>

<object name="katana">
  <attr name="damage" type="int">50</attr>
  <attr name="equip" type="script">
    player.right_hand = katana
  </attr>
  <attr name="unequip" type="script">
    player.right_hand = unarmed
  </attr>
</object>

<verb>
  <property>equip</property>
  <pattern>equip</pattern>
  <defaultexpression>You can't equipt that!</defaultexpression>
</verb>

<verb>
  <property>unequip</property>
  <pattern>unequip</pattern>
  <defaultexpression>You can't equipt that!</defaultexpression>
</verb>

// and if you want to display/see your equipment, a "equipment screen", via using a Command:

(you'd just type in during game play, let's say: 'e' or 'equipment')

<command name="equipment_screen_commmand">
  <pattern>e; equipment</pattern>
  <script>
    ClearScreen
    msg ("Right Hand: " + player.right_hand.name)
    msg ("Left Hand: " + player.left_hand.name_
    msg ("Head: " + player.head.name)
    msg ("Torso: " + player.torso.name)
    msg ("Waist: " + player.waist.name)
    msg ("Legs: " + player.legs.name)
    msg ("Feet: " + player.feet.name)
    msg ("Arms: " + player.arms.name)
    // and you can do more too (like displaying each equipment item's 'damage/defense' and etc, this is just a quick-brief example
    wait {
      ClearScreen
    }
  </script>
</command>

// then you can do such stuff in scripting:

'fight' scripting:

orc.current_life = orc.current_life - player.right_hand.damage
// if player.right_hand = unarmed, conceptually: orc.current_life = orc.current_life - 1
// if player.right_hand = katana, conceptually: orc.current_life = orc.current_life - 50

and of course, you can expand upon this stuff, such as using Object Types / Types, to reduce the amount of work you got to do, and etc other stuff.


Niekitty
29 Sept 2016, 22:50

Actually, Hegemon, if I'm reading this code right, it isn't too far from what I did stick in for the moment.
Admittedly this is likely a bit cleaner (and more compact)... you would all cringe and start marching with pitchforks and torches if you actually saw what my coding looks like. :D


The Pixie
30 Sept 2016, 12:15

What Anonynn did was to create a container on the player object called Worn Clothing, and all items that are worn go in there. The player can close the item to hide what she is wearing. My library has the capability to do that built-in, and I have added instructions on how to do it to the tutorial page.


Niekitty
30 Sept 2016, 22:28

Well, Pixie, you sold me on it, and this IS working much better and smoother!
Thank you!!

Had a minor issue for a couple of minutes, but found it and it was - as usual - my fault.