Jump to content

hippyman

Members
  • Content Count

    48
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by hippyman

  1. You're basically on your own with this extension. The developer rarely responds and hasn't updated the repo in 8 months. Somebody is working on a new generic runtime that supports Spriter, Dragonbones and Spine. It's pure GML so it's compatible with every platform and it's being worked on fairly consistently with a developer you can actually get ahold of on the unofficial GM Discord. I highly recommend you check it out. https://github.com/NuxiiGit/GML2DSkeletalAnimation
  2. It's totally okay I'm just super excited to see the new and improved Spriter! I hope I don't come off as too entitled. I know you don't owe me anything. Just really excited.
  3. What the heck is going on with Spriter 2? I know I'm acting a bit entitled but you tease us with that 20 second video and then just go dark for four months with literally nothing on any platform. Is it even kind of close to anything being released? If not then what was the point of even showing that?
  4. I'm currently working on a project where I use the guidelines a lot to line up bone lengths and angles when creating skeletons. As well as lining up animations. But I've gotten to the point where when I duplicate an animation it carries over the guidelines also. Then when I need to put guidelines down for lining up animations I have to manually remove guidelines one-by-one and results in constant tedious clicking and dragging. I can't seem to find a way to clear all guidelines quickly so I was hoping there either is a way to do it and I just couldn't find it or at the very least you might consider adding it into a future release. It would be pretty easy to implement I think.
  5. I'm not entirely sure, but since RPG Maker MV is all javascript, couldn't you use the current javascript implementation?
  6. There is no image index with this. I'm not sure what the purpose of this function is, but it's what we have to use to apparently make animation transitions work properly. The documentation is really basic so it's kind of hard to tell what some of these are for.
  7. You need to use spriter_set_time_ratio (or something like that) thats what I did.
  8. Right now the blending is really just smooth transitioning between animations. Are there any plans for implementing blending two animations based on a weight value?
  9. Okay cool after knowing this I managed to get a readout of my skeleton and found the individual IDs of each image that I wanted to color. Thanks for you help Sorry when I was saying use id, I meant to use that where you're using self. But again like I stated, I haven't used boxes or points yet, so I was just assuming from the way the other scripts work.
  10. The object index is asking for index of the object that loaded the spriter model. For object index you generally want to use "id" which is the id of the instance that uses it. I haven't messed with boxes but I'm assuming box name is the name you give it inside Spriter. @GradusGL I'm having issues with one of the functions. spriter_GetObjectInfoName always returns an empty string. I'm trying to change the color only for certain parts of my skeleton object. In this case it's for the hair and eyes. My solution at first was to check the filename but that makes a huge switch statement as I continue adding more hair styles and other parts that can have their color changed. I'm trying to be able to go from if (name == "Path/To/Hair1.png" || name == "Path/To/Hair2.png" || name == "Path/To/Hair3.png") { color = SomeColor; } if (name == "Path/To/Eye.png) { color = SomeColor; } to something like if (name == "image_hair") { color = SomeColor; } if (name == "image_eye_left") { color = LeftEyeColor; } if (name == "image_eye_right") { color = RightEyeColor; } The downside of the first solution is it requires a bunch of OR operators or a large switch statement as I add more hairstyles and the eyes are stuck to only being a single color since it's going by the filename vs the object name. I print the result of spriter_GetObjectInfoName to the console output. I call it inside the spriter_render function within the loop that runs through all the objects. spriter_GetObjectInfoFileName and spriter_GetObjectInfoString both return what they're supposed to but I don't know why spriter_GetObjectInfoName isn't working.
  11. @GradusGL Hey there! I'm currently trying to add something to this for my project. I'm trying to add the ability to change a sprites color during runtime. I added a blend variable to the CGMObjectInfo class and I added setter/getter functions. Then I added the following to the exported functions double spriter_GetObjectInfoBlend(double ModelIndex, double InstanceIndex, double ObjectInfoIndex) { if (!CSpriterGM::GetSingleton()->IsObjectInfoValid(ModelIndex, InstanceIndex, ObjectInfoIndex)) return 0; return CSpriterGM::GetSingleton()->GetSpriterGMModel(ModelIndex).GetInstance(InstanceIndex).GetGMObjectInfo(ObjectInfoIndex).GetBlend(); } double spriter_SetObjectInfoBlend(double ModelIndex, double InstanceIndex, double ObjectInfoIndex, double newBlend) { if (!CSpriterGM::GetSingleton()->IsObjectInfoValid(ModelIndex, InstanceIndex, ObjectInfoIndex)) return 0; CSpriterGM::GetSingleton()->GetSpriterGMModel(ModelIndex).GetInstance(InstanceIndex).GetGMObjectInfo(ObjectInfoIndex).SetBlend(newBlend); } The project I'm testing this with doesn't have any bones, just sprites, so I thought that zero for the object info index would be the first image. But when I call the function spriter_SetObjectInfoBlend(modelIndex,instanceIndex,0,c_blue) in GM:S, I get an "ImageFile not valid" error. I'm just trying to add a color variable to each image being used so I can change the color at runtime. Colors in GM:S are just numbers so it's easy to pass them back and forth and I already know how to get the color on the sprites by changing one line in the spriter_render script. I'm hoping you might have an idea on why this isn't working. If you could help me better understand how the object info indices work, I think I can get this working relatively easy. Any help would be greatly appreciated. Update: I managed to find a solution without changing the source code. This is a great extension. I probably sound like a broken record, but thanks again for making this.
  12. Dude you are my freaking hero. Thank you for adding in bones and IK. You just made GM fun for me again.
  13. That is awesome to hear! They need to swap our member titles. I tried making Spriter work with only GML but ended up pushing it to the side because I was having issues with getting it working, then here you come out of nowhere with this! I'm the newbie, you're the advanced member for sure! Thanks again for making this.
  14. This works great! Is there any way to dynamically change animations at runtime? Like overriding a head bone so it always looks at the mouse.
  15. *Quick note - Sorry for the wall of text. I didn't expect to write this much. It just kind of happened....* Project GMZ file - Download this and import it into Gamemaker Studio if you'd like to see the whole project (be warned, it's a mess right now) Well I think I'm having either an issue with drawing bones or I'm referencing the wrong things because it didn't really change much. I think I need to take another stab at my entity instance object. I know that I have it working up to the point where I find a mainline key from time. After that, things get a little unsure. I pass the mainline key to a script that is supposed to update the frame data. Frame data follows this hierarchy FrameData - ds_map CurrentFrames - ds_list NextFrames - ds_list Frames - ds_map Type X,Y,Angle,ScaleX,ScaleY,Alpha,Spin (spatial info) CurrentFrames and NextFrames store a frame for each timeline. Next frames are obviously used for interpolating, but first I need to get the values right. Here's the actual mess of code that makes up the frame update script Quick note if you're not familiar with GML When you see [?"key"], that's an accessor to get a value from a map data structure. When you see [|number], that's an accessor to get a value from a list data structure. Link to official GMS documentation //Loop through bone refs in this mainline for (var i = 0; i < boneRefCount; ++i) { var boneRef = boneRefs[|i]; //get current bone ref var parent = boneRef[?"parent"]; //get bone ref parent id var timelineID = boneRef[?"timeline"]; //get bone ref timeline id var keyID = boneRef[?"key"]; //get bone ref key id var timeline = spriter_get_timeline_by_id(currAnim,timelineID); //get the actual timeline var currKey = spriter_get_timeline_key_by_id(timeline,keyID); //get actual current key var nextKey = spriter_get_timeline_key_by_id(timeline,++keyID); //try to get next key if (nextKey == noone) nextKey = spriter_get_timeline_key_by_id(timeline,0); //if current key is the last key get first key //I haven't started updating next key frames yet //I need to get current keys working first then I can do the same for next keys var currFrame = currFrameList[|timelineID];//get current frame from current frame list currFrame[?"type"] = timeline[?"type"];//set current frame type (bone,image,box,etc) //The reason I check if these exist is because, when parsing, sometimes the scml file doesn't have these values //If I don't I'm sure to get an undefined error if (ds_map_exists(currKey,"x")) currFrame[?"x"] = currKey[?"x"]; if (ds_map_exists(currKey,"y")) currFrame[?"y"] = currKey[?"y"]; if (ds_map_exists(currKey,"angle")) currFrame[?"angle"] = currKey[?"angle"]; if (ds_map_exists(currKey,"scale x")) currFrame[?"scale x"] = currKey[?"scale x"]; if (ds_map_exists(currKey,"scale y")) currFrame[?"scale y"] = currKey[?"scale y"]; if (ds_map_exists(currKey,"alpha")) currFrame[?"alpha"] = currKey[?"alpha"]; currFrame[?"spin"] = currKey[?"spin"]; var px,py,pscalex,pscaley,pangle,palpha; if (parent == noone) {//if this is the root bone, set parent spatial info to same as character info (stored in instance) px = characterInfo[?"x"] py = characterInfo[?"y"]; pscalex = characterInfo[?"scale x"] pscaley = characterInfo[?"scale y"]; pangle = characterInfo[?"angle"]; palpha = characterInfo[?"alpha"]; } else {//else if this is a child bone var parCurrFrame = currFrameList[|parent];//get the frame data from parent bone by parent id found in boneRef px = parCurrFrame[?"x"]//set parent spatial info to same as parent frame py = parCurrFrame[?"y"]; pscalex = parCurrFrame[?"scale x"] pscaley = parCurrFrame[?"scale y"]; pangle = parCurrFrame[?"angle"]; palpha = parCurrFrame[?"alpha"]; } //Then the code you gave me to map out the absolute values currFrame[?"scale x"] *= pscalex; currFrame[?"scale y"] *= pscaley; if (pscalex * pscaley < 0) { currFrame[?"angle"] *= -1; } currFrame[?"angle"] += pangle; var childScaledX = currFrame[?"x"]*pscalex; var childScaledY = currFrame[?"y"]*pscaley; var angleSin = sin(degtorad(pangle)); var angleCos = cos(degtorad(pangle)); currFrame[?"x"] = (childScaledX*angleCos)-(childScaledY*angleSin); currFrame[?"y"] = (childScaledX*angleSin)+(childScaledY*angleCos); currFrame[?"x"] += px; currFrame[?"y"] += py; } Am I possibly finding the incorrect parent or something? I updated the bone draw script to find the current bones length and now the gif looks like this. I went ahead and put it next to the actual Spriter project so you can see the game version in relation to what it should be. You may notice that the arms seem to be correct but they're switched and it also looks like the whole object is turned on it's side. Aside from a random bone that seems to go all over the place as I move the entity instance. Here's code that draws the bones out var bones = instance[?"bones"]//get entity bone info var characterInfo = instance[?"character info"]; var cx = characterInfo[?"x"]; var cy = characterInfo[?"y"]; var j = 0; for (var i = 0; i < currKeyCount; ++i) {//loop through all current frame list keys var currKey = currKeyList[|i];//get current key frame if (currKey[?"type"] == "bone") {//if this is a bone var bone = bones[|j++];//I use j since bones come after images in the timelines var x1 = currKey[?"x"]+cx; var y1 = currKey[?"y"]+cy; //lengthdir_* function equivalents /*These are GML functions lengthdir_x(len,dir) -- value = cos(degtorad(dir))*len lengthdir_y(len,dir) -- value = -sin(degtorad(dir))*len */ var x2 = x1+lengthdir_x(bone[?"width"],currKey[?"angle"]); var y2 = y1+lengthdir_y(bone[?"width"],currKey[?"angle"]); draw_circle(x1,y1,4,false); draw_line(x1,y1,x2,y2); } } Sorry the huge dump of code I'm just really note sure what I'm doing wrong. I'm just a little overwhelmed and could really use a second pair of eyes. If you need anymore info please let me know and I'll add it right away. If I'm over-complicating things then please tell me how I can simplify this a little bit.
  16. Small update.... I'm working on animations finally! Here's a boring GIF Things are moving, but something is terribly wrong! I just need to figure out how to map out the absolute values then we'll be up and running. Any advice on that actually?
  17. Not sure if this has been reported but I'm having an issue when renaming sounds. If you add a sound to an animation and rename it later, it creates two different sound references in the scml file and doesn't rename the soundline for the animation that the sound was previously added to. It looks like even if you remove all of the old named sounds it doesn't remove the old named reference in the files section of the scml. Every time you rename a sound, it creates a new reference. So basically, if I rename a sound 10 times, the scml file will have 10 references pointing to the previously named sound file (in theory) UPDATE: I'm not sure what happened but all the old references are gone now. Not sure what happened but everything seems to be fine now.
  18. Quick question about timelines. Would there ever be a case where timelines will have more than one bone or object in a key? For example <timeline id="18" obj="0" name="bone_groin" object_type="bone"> <key id="0" spin="0"> <bone x="7.594937" y="179.746835" angle="270"/> <bone x="25" y="150" angle="90"/> </key> </timeline> Or is it one bone/object per timeline? EDIT: Another quick question. When the spin variable is omitted from the key does that mean it should be a value of 1? I get really confused when variables are missing randomly. Is there any way to export without removing these random things?
  19. Sorry if this has been suggested before. I tried to check on the forum but couldn't find anything. But supporting OGG sound files would be really cool since WAV files are usually much larger than OGG (afaik). It would also specifically help me with the GM:S implementation I'm working on since it has a function that supports importing external OGG files. I'm going to be working on a importer for WAV files in the mean time but it would be super helpful
  20. Another huge thanks to you @Mike at BrashMonkey I'll make sure to run through these projects. One of these days it's going to just click. That's how it always works out for me. As long as I stick with it and keep studying the files, I'll figure it out.
  21. Hello?? Is anybody there?? I created a new project and now the SCML file only has bone objects and no sprites. Is grey guy like a really old project or something? It would be extremely helpful if you guys made an updated version of the SCML reference that shows every possible element you can find, since it seems like things that don't exist in a project are omitted from the SCML file. EDIT: On a side note... what would be the possibility of adding in support for OGG sound files? It would save me from having to make an external sound system also.
  22. I'm flip flopping again. I'm going to use SCML files instead of SCON. What are the <frame> elements for in between <obj_info> elements? EDIT: Sorry I should mention that I'm using the free Grey Guy project while working on this framework. Am I just making things more complicated than they need to be? I don't get how everybody else making implementations seems to just get how the SCML files work.
  23. Okay that makes sense. Unfortunately there is no current implementation in Gamemaker Language which is what I'm trying to do. I thought I could try making a DLL with the C++ implementation but I couldn't really wrap my head around it and it would also lock it to Windows. I'm trying to make it completely cross-platform with GML. I don't really understand what the flow should be if that makes any sense at all. My biggest issue I'm having is understanding how the mainline and timelines all work together? Do I even need the mainline? EDIT: I think I just noticed something. The .scon files are missing some data in the object references in mainline tags. They don't have any of the transform data. Object refs looks like this in the scon files object_ref": [ { "id": 0, "key": 8, "parent": 6, "timeline": "2", "z_index": "0" } While the .scml files look like this <object_ref id="0" parent="6" name="p_arm_idle_a" folder="2" file="0" abs_x="30" abs_y="114.999967" abs_pivot_x="0.388889" abs_pivot_y="0.487179" abs_angle="290.409883" abs_scale_x="0.999999" abs_scale_y="1" abs_a="1" timeline="2" key="0" z_index="0"/> Is this a bug or did I tick a setting that removes those properties when saving the .scon file?
  24. Aaah I see. What does that do? I enabled snapping but didn't really notice a difference other than the keys got all fat in the timeline. The animations didn't really seem to change. That would make sense as that is the file format I'm using to import the data. On a side note, I didn't know you could do that in Spriter. So that's pretty useful! It's taking me forever but I'm not going to give up on it. The people will get their GM:S implementation! I do have some more questions though. Since I'm having troubles wrapping my head around the other finished implementations, what should be my next step? At the moment I have a simple system where you just drag in your entire project folder into GM:S (you must have a .scon file) Then you create an object and call the script spriter_init and the arguments are the name of the .scon file and the name of the root folder that contains all the images and data files. All of the images are imported automatically and grouped onto their own texture pages. Basically I had no problem on the file end of things but I really don't know where to go from there. Any sort of guidance would be extremely helpful and if I'm being vague please let me know and I'll try my best to communicate better.
×
×
  • Create New...