In my code I'm just messing around with the values in tag defintions. Can anyone see what's wrong? I'm using scenery.hpp, generated by scythe's os_tool.
Quick rundown: The idea is for people to call the script by the name of the object, so I go to the name list, to get the index of the name, then go to the sceneries, and iterate through them, checking their scenery type, and checking the name index number to see if they're the same.
Then, using that, and getting the scenery type, I should be able to iterate through the list of scenery in the scenario tag, getting to the scenery in there.
After that, the idea is to iterate through the list, and getting a pointer to the desired scenario object. Guess it's not that simple. Or, I'm just overcomplicating it. Anyways, if I can't figure this out, I'm just going to stuff it and make my own tag for these kinds of things.
Code:cstring changeBitmapByObjName(cstring ObjName, cstring nextBMP) { //objname in the name list of scenario //nextBMP is more filler than anything right now bool found_object = false; int16 index = NULL; for (int i = 0; i < Scenarion->object_names.Count; i++) { if (strcmp (Scenarion->object_names[i].name, ObjName) == 0){ found_object = true; index = i; continue; } } if (found_object) { for (int i = 0; i < Scenarion->scenery.Count; i++) { if (Scenarion->scenery[i].name == index){ return getShaderPathScenery(Scenarion->scenery_palette[i].name.name); //it's always: players/cyborg/cyborg or whatever. NOT a scenery tag path like we want } } } cstring untrue = "false"; return untrue; } cstring getShaderPathScenery (cstring tagName) { cstring string; int x = 0; for (x = 0; x < Yelo::TagGroups::Index()->count; x++) { if(Yelo::TagGroups::Instances()[x].group_tag == 0x7363656E) //Scenery string = tagName; //if (strcmp (string, tagName) == 0) // return "true"; If It were working, the two if staments would be combined.... } return string; }





Bookmarks