mredge73
Member
MrEdge73's PluralSingle Item Converter
Plural Single Stand Alone Version: 20090608PSSAV
Alpha Version
Created by Justin Edge (mredge73)
This script only handles items, it does spend any adventures.
It is designed to be used as a supplement to another .ash script by using:
"import<MrEdge73's PluralSingle Item Converters.ash>"
It is used to convert:
a single item to a plural item string
a plural item to a single item string
get the item ID from plural item string
get the item ID from a single item string
Use:
This Script requires 2 files in your Script or Data Folder:
MrEdge's Item Plurals.txt
MrEdge's Item Singles.txt
These files can be built by running this script directly from main or by calling "BuildSinglePluralMaps();" from another script.
These files do not need to be built very often, only when itemdescs.txt is updated.
Warning: building these files takes a while, about 2-3 minutes so don't abort early.
After building the files you can:
Output:
Bjorn's Hammers Bjorn's Hammer 32
Bjorn's Hammer Bjorn's Hammers 32
Special thanks to Alhifar!
Version Update:
20090608-Input is return back if nothing can be done with it
20090605-Fixed the Version Check Link
20090604-Alpha Release!
Plural Single Stand Alone Version: 20090608PSSAV
Alpha Version
Created by Justin Edge (mredge73)
This script only handles items, it does spend any adventures.
It is designed to be used as a supplement to another .ash script by using:
"import<MrEdge73's PluralSingle Item Converters.ash>"
It is used to convert:
a single item to a plural item string
a plural item to a single item string
get the item ID from plural item string
get the item ID from a single item string
Use:
This Script requires 2 files in your Script or Data Folder:
MrEdge's Item Plurals.txt
MrEdge's Item Singles.txt
These files can be built by running this script directly from main or by calling "BuildSinglePluralMaps();" from another script.
These files do not need to be built very often, only when itemdescs.txt is updated.
Warning: building these files takes a while, about 2-3 minutes so don't abort early.
After building the files you can:
Code:
import<MrEdge73's PluralSingle Item Converter SAV.ash>
//To Single:
string item1="Bjorn's Hammers";
string single=MakeSingle(item1); //=> single= Bjorn's Hammer
int ID1=PluralID(item1); //=> ID1= 32
//To Plural:
string item2="Bjorn's Hammer";
string plural=MakePlural(item2); //=> plural= Bjorn's Hammers
int ID2=SingleID(item2); //=> ID2= 32
Print(item1+" "+single+" "+to_string(ID1),"blue");
Print(item2+" "+plural+" "+to_string(ID2),"blue");
Output:
Bjorn's Hammers Bjorn's Hammer 32
Bjorn's Hammer Bjorn's Hammers 32
Special thanks to Alhifar!
Version Update:
20090608-Input is return back if nothing can be done with it
20090605-Fixed the Version Check Link
20090604-Alpha Release!
Attachments
Last edited: