Spriter/C2 4/5 bug fix

Discussion and feedback on Construct 2

Post » Sat Dec 24, 2016 6:28 am

@lucid Seems like my initialization time is also faster, and I don't even have a lot of instances (yet), though I didn't measure it or anything

Unfortunately I did come across a bit of an issue if you will... though I'm not sure this is something you'll want to solve.

Down to it: if you mirror the scml object, the width does not change to negative: what changes are the widths of the attached sprite objects. Thus if you try to use line of sight on the scml object, it will not work properly because the LoS behavior will not update the angle to reflect the mirroring. In other words, it will always detect line of sight in one direction, but not the other.

My expected response to this is "why are you using line of sight directly on the scml object? you should be mapping the scml object to a sprite first and doing everything on that"... or something, but let's just say I'm not for whatever reasons, since such an answer wouldn't really tackle the issue as I'd like (and I don't want to argue about the alleged usefulness of abstracting every scml object with a sprite object).

I'm going to think about how I can fix this—preferably without modding the line of sight plugin itself, since it's not really at fault here (I think I'll just change my general approach instead) but in the mean time, I thought I'd let you know to see what you think.
B
19
S
10
Posts: 51
Reputation: 1,675

Post » Sat Dec 24, 2016 4:10 pm

@BBaller1337, I came across the exact issue you describe and many others because I was applying my logic to directly to C2 sprites or SCML objects. I made the painful decision to redo everything and pin my sprite/spriter objects to a C2 sprite first and it makes everything much cleaner and eliminates many, many issues like this.

Trust me, the further you go down this route the more painful it will become.
B
12
S
2
G
1
Posts: 23
Reputation: 886

Post » Sun Dec 25, 2016 2:20 am

stricky wrote:@BBaller1337, I came across the exact issue you describe and many others because I was applying my logic to directly to C2 sprites or SCML objects. I made the painful decision to redo everything and pin my sprite/spriter objects to a C2 sprite first and it makes everything much cleaner and eliminates many, many issues like this.

Trust me, the further you go down this route the more painful it will become.


Hmm. Interesting response. And I am grateful for your post/indirect advice, but do you mind if I ask some questions?

By "directly to C2 sprites", you mean to the objects that Spriter creates?

Are you pinning every spriter/sprite object to a single Sprite object that you create? (Just trying to clarify what you meant)

Is having more objects as a result not a concern for you/is it just better than the alternative? What about the complications in logic and handling objects caused by abstraction?

Probably most importantly: what other issues do you have?


My current project is very far into development, the code works and it works well, and after some recent (much-needed) polish/optimizations/clean-up is at a point it's easy to understand, makes sense, is flexible, etc.

I quickly fixed the issue I shared above by making a mod of line of sight as I kind of needed to anyway because the default line of sight doesn't have all the functionality I would like anyway (e.g. sorry Ashley, but why can't we have line of sight in a direction different than the object angle? :( ). I could have maybe done something about it on the SCML side but I'm a little bit more intimidated by that code (i.e. afraid of breaking it) and I needed the LoS Mod anyway

But I'm curious what other concerns/issues there could be. Over 6 months back I did run into issues with things like... for instance, picking the hurtboxes (collision boxes) belonging to an SCML object when both objects are encapsulated by families, i.e.

PICK SCMLFAMILY | DO THING WITH HURTBOXES FAMILY

would not know to pick the hurtbox(es) that are in the container of the SCML object picked in the SCML family, but I resolved this ages ago as well. And I don't think abstraction through a sprite object would fix this anyway...

In other words, if you're willing to help, more information would help me make a more informed decision. Time is money and all that and trying to recode things would be an extreme setback that would kill both progress and motivation, but based on what you say it may be worth it anyway, haha. I guess I'm just skeptical because I've managed to get everything working pretty well so far, even if it took some working around things, and I don't think the abstraction would have helped with anything anyway--with the exception of this issue, but I can also see a lot of cons to it when I draft it up in my head...
B
19
S
10
Posts: 51
Reputation: 1,675

Post » Mon Dec 26, 2016 8:58 pm

12/26/2016 Download new version
  • Fixed a bug that would cause a javascript error when using the transitional old style version of the plugin (doesn't apply to most. If you have no idea what this means, it probably didn't/won't affect you)
  • Fixed a bug that would cause a javascript error when attempting to start a layout where scml objects had no scon or scml file set.

@BBaller1337 - so are you saying if scml returned negative width when it was set to mirror that would solve our issues? Or is it something more. If that's it, I'll see what I can do - I need to make sure that there aren't any unforeseen issues with changing that, but nothing immediately comes to mind.
Spriter Dev
B
99
S
21
G
12
Posts: 3,259
Reputation: 16,894

Post » Tue Dec 27, 2016 6:23 am

hi lucid,
thank you for this amazing plugin, its makes development much easier.

i have an issue where i have 2 scml objects and i want to attach them together.
obj 1 is a character.
obj 2 is a fireball.
each has a scml file.
i want to attach the fireball to the arm of the character.
i need actions that given a name of a spriter-object, it will be able to get / pin this properties:
x/y/angle/scaleX/scaleY/alpha/Visible(+which frames pin visible to)/z-order.
this way i can say: fireball.scml set (x,y) to the (x,y) of the character.scml "arm" spriter-object (+ some offset)
and then i can say: fireball.scml pin to character.scml spriter-object "arm" - properties: All.

if there is a better way to this, i would love to hear it.
another possible solution is to use the new Point system inside spriter (yet to try it).
(i already changed the javascript, and made pin for the visible,x,y,angle, it has some minor bugs and its far from perfect)
B
40
S
16
G
7
Posts: 54
Reputation: 6,471

Post » Tue Dec 27, 2016 6:44 am

lucid wrote:12/26/2016 Download new version
  • Fixed a bug that would cause a javascript error when using the transitional old style version of the plugin (doesn't apply to most. If you have no idea what this means, it probably didn't/won't affect you)
  • Fixed a bug that would cause a javascript error when attempting to start a layout where scml objects had no scon or scml file set.

@BBaller1337 - so are you saying if scml returned negative width when it was set to mirror that would solve our issues? Or is it something more. If that's it, I'll see what I can do - I need to make sure that there aren't any unforeseen issues with changing that, but nothing immediately comes to mind.


Yes, it almost certainly would :) (unless @stricky knows of something else/some complications)

@sagispin I think objectX/Y and objectAngle would come in handy here? I'm not sure for the other properties though, and I'm guessing there's some reason you want the fireball as its own SCML object and not as an object within the character project, huh? I guess I'm just having a hard time seeing what you're trying to do.

As far as attaching an object (e.g. a sprite) to one of an SCML's object though, it's possible, as I've done it: but I put the actual sprites/collision boxes I want to attach stuff to into their own family, then basically pin effects to that sprite family, and I know which sprites to pick because each one is associated with the SCML object that owns it... but it's a little complicated and my situation is a bit different I think, so eh. But a lot is possible with a bit of creativity :P

---

P.S.: I got a new error recently but I haven't been able to replicate it

Image

Since the game works even with it, I can't replicate it, and I don't have any real info besides the above (that it's trying to set the sound volume of a triggered Spriter sound to a float before returning it, I think, and somehow that's causing an error), I'm not going to worry about it too much, but if anyone somehow knows anything, feel free to let me know~
B
19
S
10
Posts: 51
Reputation: 1,675

Post » Tue Dec 27, 2016 7:09 am

@BBaller1337
fireball has looping animation that moves sprites around.
making a looping animation in spriter is a nightmare because the feature that puts spriter animation inside spirter animation - is still work in progress.
the new pin action plugin should also work with anytype of object. not just scml (also sprite and tiled background...)

the problem that you cannot directly "talk" to a sprite that is a part of the scml.
this is bad practice, because you have no control of how spriter exports.

as i understand it, you found a workaround using familys like charcterSpritesFamily.
now you can say fireBall pin to charcterSpritesFamily that has the tag "arm"
if the sprite gets deleted you just have to give another spirte the tag "arm"
thats a nice workaround, but you have to maintain it and keep it organized after each change scml change.
B
40
S
16
G
7
Posts: 54
Reputation: 6,471

Post » Tue Dec 27, 2016 8:17 am

I see I see. yeah, being able to completely manipulate every object could be useful/helpful here.

there's a tiny bit of maintenance work for me, but very little. I basically just import an object once, add it to a family, and I'm set, so long as the object names stay the same. It ultimately depends on your system and what you're trying to do though.

anyway, sorry I can't be of any help.
B
19
S
10
Posts: 51
Reputation: 1,675

Post » Tue Dec 27, 2016 9:35 pm

Hey Guys. I just saw Spriter Pro available in Steam:

For those who can't afford it, you can buy it here for a $1.00:

https://www.humblebundle.com/game-devel ... ero_image0
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
64
S
18
G
90
Posts: 1,118
Reputation: 59,565

Post » Wed Dec 28, 2016 8:02 am

chadorireborn wrote:Hey Guys. I just saw Spriter Pro available in Steam:

For those who can't afford it, you can buy it here for a $1.00:

https://www.humblebundle.com/game-devel ... ero_image0


Sweet deal, thanks!
B
40
S
16
G
7
Posts: 54
Reputation: 6,471

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 6 guests