• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

using an array to copy and replace multiple symbols into a file

Participant ,
Sep 27, 2024 Sep 27, 2024

Copy link to clipboard

Copied

trying to make a drop down box tjhat would allow some assets to join for preservation of petpet park avatar assets. this game has 400 color bottles, tons of catagories of clothes and etc and wondering and looking in the file, i'm finding three strings of assets for them under array and one under dictionary

 

 

i was given a script before that allowed me to load ONE symbol, how would this array be used to make this script go back until all pieces are loaded. not sure if the post is still here so i put a image of it as well, this code part was not easy to get figured out either 🙂

 

 

 

terryw30405050_1-1727446060723.png

 

this is what i'm trying to make a drop down box so i can get the images to a flash preservation site and not have it just die in a folder to speak....

 

terryw30405050_2-1727446288567.png

i do know each clothing piece also has a x and y coodinate too, is their an easier way to copy this than having to put x=number and y=number for each piece.

 

so far this is what i've figured 

 

array is going to load 0, 0 loads say arm_1 to both wireframe and new piece, places the piece, goes back and then gets 1, which should be arm_4, repeats.

 

this is one of those pieces of code that i'm assuming someone put on  wall and framed beause its so elegent yet well, look at how much stuff it loads esp when you diagram out the thing. this game has the most clothes i've erer seen in a game too. i got a small 2mb file of stuff that took 2 weeks to sort out and supposedly a nightmare cache was saved of this too that well, is in the hundreds of mb but their not sharing it, there trying to do this in unity and so far have not been able to get any of them to work so i guess im doing good so far with 66 base models working.

 

how this was done originally, theres two other pages for both the color of the pet and the species....

i'm just trying to get a simple text dropdown for now and well, this art deserves to be preserved and well,

its not really practical to do it how i have loaded it so far.

 

terryw30405050_4-1727446756084.png

the user would drag the image onto the avatar and per video breakdowns it would then load each piece to the avatar and it would appear in the image there.

 

Views

904

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 27, 2024 Sep 27, 2024

Copy link to clipboard

Copied

that's quite a request for a forum.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 27, 2024 Sep 27, 2024

Copy link to clipboard

Copied

the diagram is not all done at once though. it looks like what they did was if you dragged a shirt to the pet and lets say array 0 through 9 are the those symbols, it ran the script as "use array 0, place array 0, etc, and rather than ending the script, restarts at 1 to until it hits where it needs to. IF you want laughter another group is also working on this same problem in unity and well, is far less along then me on solving it. This is very much the namemake of the game and its

difficulty is reflecting it.

 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 27, 2024 Sep 27, 2024

Copy link to clipboard

Copied

unfortunately, that last message didn't clarify (let alone simplify) the issue.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 27, 2024 Sep 27, 2024

Copy link to clipboard

Copied

this is what i'm finding so far in the code :

private const SPECIESTYPES_DIRS:Array = ["HIFFOLO","PIXNY","DIPNI","DYRM","KASSGAT","OUKIN","BANDALU","PUXA","MUMBAT"];

private const SPECIESSKINS:Array = ["nova","bluecrystal",...

i am assuming the other parts of clothes work the same way to get them into the wireframe. 

 

what i know about these two arrays (server sends 0,0) the ressult was (domainname.com/hardsetpath/COLOR/color_SPECIES.swf was returned to the client.

the big difference is insread of running ONCE, whjen it gets to the end of the first load, its going back to teh top +1 until it hits a defined value

for instance outfit drag calls item 0 item 0 goes to the wireframe then vs ending it calls

item 1....item2...item3...until it hits whatever # stops it.

 

that seems to the smallest awnser to this problem as i don't see a big list anywhere else calling this to work.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 27, 2024 Sep 27, 2024

Copy link to clipboard

Copied

is this by necessity a complex issue or can you simplify the essence of the issue?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 27, 2024 Sep 27, 2024

Copy link to clipboard

Copied

it is somewhat complex as the script needs to do as your previous script does but 1. gets its names out of the array, and at the end of the first load, advances the array to the next item and has a means to told to stop at x #.

 

if this was a strait moviecliip playing on the stage  for insance, it would be a gotoandplay(1) at the end but with a new piece playing more or less each time .

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 27, 2024 Sep 27, 2024

Copy link to clipboard

Copied

this is what im seeing as a solution other than the x,y coordinate problem so far that looks like it could not take up a lot of space and do what i need to. the files have the same as3 name so in theory once it places the file into the wireframe, it should not have problems crossing content. the problem i see coming is how do i store the x and y data for each piece, another array?

terryw30405050_0-1727470286003.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 28, 2024 Sep 28, 2024

Copy link to clipboard

Copied

too complex for me to address in a forum

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 28, 2024 Sep 28, 2024

Copy link to clipboard

Copied

the thing thats causing most of the problem is instread of closing the script, how do i make it add one to the array number and go down the list until say 10 is reached. i know the arrays are accessed by number and clearly calenders do this....

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 28, 2024 Sep 28, 2024

Copy link to clipboard

Copied

i don't know what you mean by "closing the script".

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 28, 2024 Sep 28, 2024

Copy link to clipboard

Copied

so it would run  similar to this

user selects shirt 0 from the list and selectts "update" starting the script to place the shirt, 0 is passed to item, x and y arrays to load item)

load arm_1> item appears at x and y .....> goto array 1(does array equal under 13, rerun script current+1)

lather rince and repeat until 13 appears. i want to seriously advoid databases in this as the less extra stuff i have to deal with the better. i want this to run in a standalone flash, or ruffle player and not need a bunch of stuff loaded.

the binder here is the arrays all are keyed together, for item, placement and etc by the same #

and i'm not 100% sure on this but once that script closes for say arm_1 it should stay there correct or am i missing something?

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 29, 2024 Sep 29, 2024

Copy link to clipboard

Copied

"user selects shirt 0 from the list and selectts "update" starting the script to place the shirt, 0 is passed to item, x and y arrays to load item)"

 

i understand short 0 is selected from the list and then update is run.  then what happens?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 29, 2024 Sep 29, 2024

Copy link to clipboard

Copied

the shirt dropdown gives the filename to the script that you want to load, its not vital to showing this working once.

 

the first array will be front_arm1 to front_arm 12 (1,2,3etc) then back_arm_1 to 12 . yes all of do need to laod:)

the second array is the x coordiate for front_arm_1, then arm_2 as i did chart them and they are different for each arm.....

third array is y coordinates, also changing per piece.

 

 

the end of the file loading should have a if > array not x number, repeat (current one)+1

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 30, 2024 Sep 30, 2024

Copy link to clipboard

Copied

terryw30405050_0-1727698039866.png

this is what im looking to have the coding do....

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 30, 2024 Sep 30, 2024

Copy link to clipboard

Copied

sorry, i don't understand.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 30, 2024 Sep 30, 2024

Copy link to clipboard

Copied

i got the arrays and what they do(they hold information) i have the information keyed in them. what i'm having trouble with is a normally circular loop that has a defined  stoppoint. I can't use a basic repeat as thats going to load

the same PIECE each time it needs to add 1 to it for each pass.

 

this last piece of the script is whats killing me on this and i'm not sure why its hard to undersstand ?

 

 

load 0 _> load 1 ->load 2 -> load 3 if  defined 4 as my stop it woild end there....if not it would go to say 10(9) if i went there. recall that as3 counts from 0 if this is new to you reading.

 

where did i get this idea from? the way htey loaded color bottles itself as theirs a array set for color, one fdor species and the server just sent 0,1 and it pulled a complete file path to the client with some stuff defined in the file.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 01, 2024 Oct 01, 2024

Copy link to clipboard

Copied

you have an array.

you want to loop through some elements of it.  as an exmple of something causing a problem, which elements do you want to loop through?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 01, 2024 Oct 01, 2024

Copy link to clipboard

Copied

i have not one but three arrays all tied to the same number for this to work currenetly.

 

array 1=the symbol name i need to replace it in

array 2=x coordiante

array3=y coordinate

 

i need all 3 to get the pieces in the right places. considering doing a single array with the x, y after the symbol name to make this easier but its a lot harder to update if new pieces appear.

 

so if i get array"0" it will have itemarray=front_arm_!

xrarray=(number here)

yarray-(number here)

the problem is getting the end to push the number of the array 1 or 3 spaces  if its one array and keep going as shirt,etc swf has the  the same number  of pieces. hats only have front_hat and back_hat..etc. 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 02, 2024 Oct 02, 2024

Copy link to clipboard

Copied

why would the shirt array influence the hat array?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 02, 2024 Oct 02, 2024

Copy link to clipboard

Copied

each branch of off the wireframe would have its own loading array . hat has two front_hat and back_hat for instance

each part that goes on a arm or leg will be almsot 22-24  since theirs 12 arms for the front and 11 for the back. so anything going on the arms....would have a similar number of pieces. Things that go on the head generally are just front and back...and are consistantly lableed.

 

this is the animation breakdown for the wireframe for arms and legs follow a similar pattern. :

terryw30405050_0-1727880660593.png

terryw30405050_1-1727880723533.png

theris also a front and back torso. this is why i want the array as its so much easier to COUNT then having to type all this stuff into code

 

what i need is almost like that script that changes the symbol names to as3 names  but i know its not quite teh same language for animate cc scripting and actionscript it looks like....perhaps they can chime in here and may see the solution?

tghats processing 300 plus changes without having to define the object by name  in code. i want to define 0 as technically 3 things here. 0(array1) first picks the symbol name, then at teh end with the addchild command i got two options i can go with, placing x and y in the same array or defining them seprately in their own arrays. this just needs a math problem added to 0+1) x axis or 0+2) y axis  to achieve if i recall correctly. i did 3 origianlly as its easier to read vs array=Front_arm_1, 47,55. front aRM_2, 49.57 ETC. kinda reads like a lotto ticket 😞

 

 

 

 

 

 the symbol name to as3 script

terryw30405050_2-1727881728539.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 03, 2024 Oct 03, 2024

Copy link to clipboard

Copied

so why is it a problem that different arrays have a different number of elements?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 03, 2024 Oct 03, 2024

Copy link to clipboard

Copied

if i write teh script to restart for the clothing like shirts or pants which have far more elements then say a mask or a shirt,id have to update the item counter clearly to stop the script at the end correct. i'm more used to non object based coding which a repeat x times would be needed to make this go....

a shirt if its one array would be something like 66(1=the symbol 2, the x locatoon 3 the y location ) the x and y are very  important or the pieces don't assemble correctly.

 

 

 

 

 

lets say i make it one array part 1 is the symbol, part 2 is the x placement, y is the y placement.

 

a simple front, back object is counting to 5

 

0=front_mask.

1=65

2=75

 

let me pull up the species and color loading arrays here from the gameas code base to show whats going on so far that makes this a facinataing coding method

this is how this game pulled its color bottles into the game, i have not found  the pieces loader yet but im finding this all over the game code for maps, clothes etc and if you break that color and species bottle list down to a file list(don;'t do all 400 if you want to remain sane) its clear why i want to know how this works. its a BIG list.

---from the code off archive.org for the game ----

 

  private const SPECIESTYPES_DIRS:Array = ["HIFFOLO","PIXNY","DIPNI","DYRM","KASSGAT","OUKIN","BANDALU","PUXA","MUMBAT"];

private const SPECIESSKINS:Array = ["nova","bluecrystal","mermaid","autropolis","chocoeasterbunny","gold","luckyclover","green","blue","red","yellow","pink","brown","candycane","tan","purple","zombie","skeleton","pinkblackskeleton","snowflake","gingerbread","candyhearts","shimmeringheart","fire","shimmeringgreen","pastelplaid","rainbow","wish","birthdaycake","stainedglass","sunset","tiki","wave","lava","alien","pirate","cloud","black","twilight","werewolf","magic","nutcracker","holiday","faeriecloud","stormy","grimsbyheart","pinkhearts","chocoeasterbunny","candy","candycorn","pinata","pinksupernova"];

this._speciesUrl = _loc1_.species_url + _loc1_.color.toUpperCase() + "_" + _loc1_.species + ".swf";

 

lets say you have set list species as dipni and for sake of clarity here "blue"

you get <filesstart here.com>/assets/ItemSwfs/Newspecies/SPECIES/COLOR_Species.swf

 

this is the clothing one that seems to match that screenshot

 

var _loc2_:String = null;
switch(param1)
{
case "all":
_loc2_ = "Show All";
break;
case "backpack":
_loc2_ = "Back Packs";
break;
case "bottoms":
_loc2_ = "Bottoms";
break;
case "bracelet":
_loc2_ = "Bracelets";
break;
case "collar":
_loc2_ = "Collars";
break;
case "dress":
_loc2_ = "Dresses";
break;
case "earring":
_loc2_ = "Earrings";
break;
case "glasses":
_loc2_ = "Glasses";
break;
case "glove":
_loc2_ = "Gloves";
break;
case "hat":
_loc2_ = "Hats";
break;
case "jacket":
_loc2_ = "Jackets";
break;
case "pants":
_loc2_ = "Bottoms";
break;
case "shirt":
_loc2_ = "Tops";
break;
case "shoe":
_loc2_ = "Shoes";
break;
case "wand":
_loc2_ = "Handhelds";
break;
case "mask":
_loc2_ = "Masks";
break;
case "eyepatch":
_loc2_ = "Eye Patches";
break;
case "wig":
_loc2_ = "Wigs";
break;
case "wings":
_loc2_ = "Wings";
break;
case "head_tatoo":
_loc2_ = "Head Tattoo";
break;
default:
_loc2_ = param1;


private static const ORDER_OF_TABS_ARRAY:Array = ["hat","shirt","bottoms","dress","jacket","shoe","Accessories","wand"];

this._speciesUrl = _loc1_.species_url + _loc1_.color.toUpperCase() + "_" + _loc1_.species + ".swf";

case "backpack":
case "mask":
case "wings":
case "eyepatch":
case "collar":
case "bracelet":
case "glasses":
case "glove":
case "earring":
case "head_tatoo":
_loc2_ = "Accessories";
break;
case "pants":
case "bottoms":
_loc2_ = "bottoms";

 

hopefully this helps in what im trying to solve here as the clothing list is even MORE nightmareish than the species and color list.

i also don't have all the color bottles and well, would like to put a "item not preserved" logo on ones im lacking for now, as another apparently does have themand is having even more problems trying to load this nightmare(Theri using unity).

 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 03, 2024 Oct 03, 2024

Copy link to clipboard

Copied

you're doing something wrong but there's way too much (for me)  for a forum.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 03, 2024 Oct 03, 2024

Copy link to clipboard

Copied

note:only putting concept of what i see this working under here to see if this clarifies solving this  the script works if i manually type the filename and symbol and etc in on the file, theris just too many  symbols to swap . i've figured out what the "case " and "break" commands  do, they split the loading screen into those catagories and the user dragged the piece onto the avatar, then the swf loads, it gets broke down itto arm_1, arm4,5 etc etc and then it apears on the avatar in a idle state.  you could not run more than 1 section at at time. unlesss i need the counting function in its own object and then it calls the function to swap assets

 

(counting container)

 

<change cltothing piece here>

<end change clothing container>

<read number for counting container if under item count go back to <change number plus 1>and retun

if number matches counter unload script 

is this what im needing?

 

 

 

 

terryw30405050_1-1727982451288.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines