Ergebnis 1 bis 1 von 1

Thema: HeroAccess-Plugin für Power Patch v0.3/0.4x

Hybrid-Darstellung

Vorheriger Beitrag Vorheriger Beitrag   Nächster Beitrag Nächster Beitrag
  1. #1

    HeroAccess-Plugin für Power Patch v0.3/0.4x

    Dieses Plugin erlaubt euch, auf Heldennamen, -rang, -charset und -faceset zuzugreifen. Damit kann man tollige Sachen machen, z.B. eine Art "Run Script"-Befehl bauen, Strings per Lua und StdLib-Plugin schön formatieren und nacher per \n[...] ausgeben, etc.!

    Zitat Zitat von readme.txt
    HERO ACCESS PLUGIN POWER PATCH v0.3/0.4x
    ========================================

    (C) 2011 by Cherry
    www.cherrytree.at

    This plug-in allows you read a hero's name, degree, charset and faceset and write his name and degree with Power Patch.

    To install the plug-in, just copy it into your "Plugin" folder and enable it using the Power Patch Configurator.
    Then, open your init.lua file and add one of the following lines:

    For RPG Maker 2000 version 1.07 add:
    InitHeroAccess(0x49ACE8, 0x48)

    For RPG Maker 2003 version 1.08 add:
    InitHeroAccess(0x4CDDC8, 0xD8)

    If you have a different version, please ask me.

    After that, you can use the following functions:

    hero_name = GetHeroName(hero_id)
    ... will store the "hero_id"-th hero's name in "hero_name".

    hero_degree = GetHeroDegree(hero_id)
    ... will store the "hero_id"-th hero's degree in "hero_degree".

    hero_charset, hero_charset_id, hero_charset_transparency = GetHeroCharset(hero_id)
    ... will store the "hero_id"-th hero's charset filename (without extension), ID (which sprite of the charset is used) and transparency value in "hero_charset", "hero_charset_id" and "hero_charset_transparency".

    hero_faceset, hero_faceset_id = GetHeroFaceset(hero_id)
    ... will store the "hero_id"-th hero's faceset filename (without extension), and ID (which sprite of the faceset is used) in "hero_faceset" and "hero_faceset_id".

    SetHeroName(hero_id, hero_name)
    ... will set the "hero_id"-th hero's name to the string provided in "hero_name".

    SetHeroDegree(hero_id, hero_degree)
    ... will set the "hero_id"-th hero's degree to the string provided in "hero_degree".

    IMPORTANT NOTES:
    1) All functions won't work if the name/degree/charset/faceset hasn't been changed at least once. So, for example, if you start a new project and try to get the hero name, you will get nothing meaningful. Use "Change Hero Name" at least once.
    2) If you set a hero's name or degree, the name can't be longer than the space provided for the string. If you set the hero's name or degree with the RPG Maker (with "Change Hero Name" or "Change Hero Degree"), there is exactly as much space provided as needed for the new name/degree. Power Patch can't change this space. This means: If you want to set a new name with Power Patch which has, let's say, 10 characters, the old name (which was set using the RPG Maker) must have been AT LEAST 10 CHARACTERS too. So, it's good to set a very long name/degree using the RPG Maker before using SetHeroName/SetHeroDegree.

    BUT: Power Patch won't REDUCE the space provided if you set a very short name/degree using SetHeroName/SetHeroDegree!

    Example:

    RPG Maker's Change Hero Name => ABCDEFGHI (9 characters - provided space is now 9 characters)
    Power Patch's SetHeroName => ABCDEF (6 characters - okay, but provided space is STILL 9 characters)
    Power Patch's SetHeroName => ABCDEFGH (8 characters - STILL OKAY)
    ========
    RPG Maker's Change Hero Name => ABCDEFGI (9 characters - provided space is now 9 characters)
    RPG Maker's Change Hero Name => ABCDEF (6 characters - provided space is now 6 characters)
    Power Patch's SetHeroName => ABCDEFGH (8 characters - WON'T WORK, because there is not enough space now!)

    ADDITIONAL TIPS:
    1) If you want to use hero names to exchange strings between the RPG Maker and the Power Patch, you probably need longer names than 12 characters (which is the default). To be able to use longer names and degrees in "Change Hero Name" and "Change Hero Degree" (up to 1000 characters), download RPG Maker 2009 Ultimate (http://cherrytree.at/ultimate) if you aren't using it already, then install the UIMod file "longheroname.ini" which is included in this package.
    2) There is a useful thing you could use GetHeroName for! You can actually create a feature similiar to RMXP/VX's "Run Script" command. In mainloop.lua, create a new message branch and put the following line in it:

    loadstring(GetHeroName(1))()

    ...where 1 is the ID of the hero you want to use. You can then write a line of Lua code in this hero's name and call your new message branch from the RPG Maker and it will run the code!
    Download: http://share.cherrytree.at/showfile-2501/heroaccess.rar

    mfG Cherry

    Geändert von Cherry (21.03.2011 um 17:37 Uhr)

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •