lucid's Recent Forum Activity

  • the only problem with the unique ID is that it can change when you're changing you're layout

    add some text, maybe copy paste one of your choices, and it takes a little effort to figure out which UID is which, I think it would be easier to just get the global that keeps track of choice, because you'll know the exact order, or better yet the string for the choice name of the sprite, that way it's easy, readable, and you don't have to think about UID's. This is my own general rule of thumb, but I think UIDs should only be used as a last resort. they just make for messy event logic imho

    the easiest would be to have the sprites PV be the name of the layout

    sprites private variable 'ID' = screenselect

    -----go to layout( sprite pv choicename)

    simple, elegant, readable, easy to maintain in the face of changes down the line

  • something along the lines of

    on keyboard press enter

    -----goto layout global('screenselect')

    or

    ----goto layout global('choicename')

    as for clamp

    clamp(x,a,b)

    it just gives you back x, but forces the value to stay between a and b

    so clamp(5,10,20) = 10

    clamp(15,10,20) = 15

    and clamp(25,10,20) = 20

    the clamps in the cap are just clamping global('screenselect')+1 (or minus 1) to be between either 1 or the total number of 'choice' objects. screenselect is your current selection, and you're just adding one to go to the next object or subtracting to go to the previous, but you don't want it your selection to be able to go less than 1, or higher than the total number of choices, or nothing would be highlighted when you checked screenselect against each objects ID private variable

    in the start of layout you loop through all objects from left to right by ordering them by their x locations to set their ID. this makes it so you don't have to worry about which object has which ID if you decide to rearrange them later, it will always be ordered from left to right

  • hey

    here ya go

    please please please save your current version of s

    I haven't tested this quick build I did

    I had to remove some features on the spur of the moment, the fluid dynamics one due to copyright issues with autodesk, and there was some apparent slight file corruption stuff going on, but I do think it should work fine. just keep a backup of your current s version, and don't worry, if there is a problem, I'll be able to fix it in a rebuild. just test your current cap, and make sure it doesn't break with this version

    http://dl.dropbox.com/u/1013446/Plugins.rar

    EDIT: k, just tested it with some of the tutorials and it seems fine

    there's probably some more stuff I forgot about already,

    but as far as the search functions

    there is a is object contained in array condition like:

    on collision with sprite-

    -----if sprite is contained in {"best not bump into me again"}

    ------------destroy sprite

    the expressions that search have the value to search for, the array of course, the starting index, so you can search from the middle of the array, or do several searches, because the value returned is the index of the first time it finds the value, if it occurs more than once, you won't find it, unless you start from an index after the first found one

    unfortunately, although I do believe the catmull rom interpolation stuff is complete and working, I don't remember for sure if all those variations were ever finalized. remember, this is a version of s I was experimenting with and adding onto while working on something else, it wasn't necessarily ready for primetime, but I do remember using it alot, so I think everything in there works. please report any glitchy nonsense

  • awesome stuff rojo

    I was actually making a platform behavior example when i got called for dinner, so thanks for saving me the trouble

    if I get a chance in the next few days, I want to make an example with a python class.

    with classes you could make extremely robust solutions as I was describing before.

    being able to instantiate classes of complex multi-construct-object objects has alot of potential I think. you could make a 3d editor in python as easily as you could in s with the difference being that it would be copypastable to multiple caps, and completely readable. your events could end up looking as simple as

    On Sprite (drag-and-drop) Drop-

    run python script "repositionIn3dModel(Sprite)"

    on right mouse button click

    run python script "beginMouseDrag()"

    Right Mouse Button Down

    run python script "rotateModelBy(DistanceDragged())"

    you can create the equivalent of objects and behaviors

    if anyone has any ideas you'd like to see a python example of, post it here, and either I or rojo can probably whip something up. when looking at these examples, if you're considering learning python, focus on the simple actions AFTER you've created your functions.

    notice in rojos pyramid example, there is a single command that is doing everything. One of the rewarding things about python (or any modern programming language) is being able to reduce the most complex of tasks to as few commands as you wish. Once you create your complex script, you don't have to even remember how you did, none of the details need to matter, you don't need to remember what each PV was for nothing. Just one command for anything that can be reduced to one task conceptually. Rojo could have extended his example, so you provide not only the object, but the angle as well, only if he needed that flexibility. Either way, he's done thinking about rotating pyramids, now he can just use it like you can any other object.

    Anyone using 's' should seriously consider experimenting with python, it's much more powerful, and the learning curve is about the same.

  • that looks really really good. gotta leave to work, so couldn't research more, is everything I see in this video from rayman?

  • super simple python example with 3d rotation along the y axis

    to be honest this code could be cleaned up, and made much more flexible, so it doesn't depend on the 2 sprites for radius, or you could choose any two sprites, I just made it that way to be easy to note the flexibility, and so it wouldn't require any coding knowledge to get a basic grasp

    drag and drop the two small circles to adjust the radius and move your mouse around to rotate the larger sprite around the y axis of the smaller one

    http://dl.dropbox.com/u/1013446/pyrot.cap

    also, if you change the line:

    Run python script - "yrot(Sprite)"

    to "yrot(Sprite4)"

    you'll notice that this function can be applied to any object like a behavior. This is a stripped down example, but in reality you could construct a python object that uses an array of construct sprites, and you treat it all like a single 3d rotatable object.

    not to take away from quazi's uber impressive 3d stuff, and it is impressive, but with python you could design an object that could reduce a huge cap only readable by aliens(that's a compliment quaz), to a normal readable cap, with nothing but easy construct events, and simple python commands that you name yourself. if you didn't need a big object composed of many, you could create a better version of the function in this cap custom tailored to your needs, and you wouldn't need a bunch of private variables to manipulate 3d rotation

    and after adding all the sprites to an array (a process which could also be simplified by python), you could just use commands like

    RotateZ(MyUber3dConstruction,35)

    MyUber3dConstruction being composed of 100 objects

    35 being the number of degrees

    Aside from that, these python objects and functions could be shared with others on the forum who would merely have to copy paste them to a script in start of layout

    I recommend anybody who's capable of creating those WOW!! type event sequences in their caps, and eager to share their abilities, try to learn a little python. It really isn't that different from construct events. you just type stuff instead of choosing it from a list. learn a few rules about when to indent, and when to put a '(' or a ')', and you can share your genius/madness with the world, or at least make your madness clutter up your own caps less, and make them readable when you come back to the cap after a few months

    3d is just one example, you could use this technique for anything from inventory systems, to custom sprite particle systems, anything complex that starts making your cap difficult to read or manage. It's neater than functions, and can everything 's' can do as far as data structure creation, but with greater readability, and less pointing, clicking, and definitely less typing in of long addresses. Not to denounce my own plugin, because it does have it's uses, but learning how to create data structures in python is much more useful in the long run than learning how to do it with 's'

  • The events will take place in order. All the calculations for the collision event for all instances will take place before the next condition is evaluated. There shouldn't be a "big mess". I believe that given your scenario, the assignment to the global variable would occur only once using the value of the first picked instance. Don't quote me on that until you test it, which should be simple enough. The first picked instance in the selected object list is not simple to plan for, especially in families with multiple types, so if you need greater control over which object pv gets used add further conditions or subevents. If you would like for each private variable to be used in succession, use a "for each" condition or a "for each ordered" condition which would also allow you to specify the order the objects were acted upon. Also, just to clarify, construct never runs anything concurrently, everything is evaluated and executed top to bottom, except with special cases like "start of layout", loops, and functions

  • I haven't posted this to the tracker yet, because I'm going to search and see if it hasn't been posted, and make sure it's not just me, because I think I asked about this once and everyone said it was just me.

    I can't load caps if I already have one open without something glitchy happening. Sometimes, it doesn't load at all, most of the time, it opens up to a completely blanks screen, and I have to go to the projects tab, and double click on a layout to bring up the layout editor, and double click on an event sheet to open the event sheet editor. It happens every time. I've already gotten used to just closing construct and reopening it instead of trying to load a cap when one's already open

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I would not consider it complete or stable

    and fixing it would require a complete rewrite as I was a complete newb when I wrote it, and as of now I do not plan to complete it in the near future. Also, since fixing it would require rewriting it, the new version would not be compatible with this one.

    what's strange is one of the reasons I couldn't fix it was because people were sending me caps with problems, but on my pc the caps ran fine.

    may be pointless, but to answer your question though, it has no functions to trim leading zeros and such, I believe there is a system expression that does. However, it does have a complete set of formatting functions like word wrap, right justified, etc.

    I believe someone created either an event based or python based implementation of spritefonts you might be able to find searching the forums.

    Also, I don't think it's unstable in general, but everyone used the spritefont in different ways, some people made multiple instances of one spritefont object, some people made multiple objects with one instance of each. Some people initialized them each time they switched layouts. Some people made them global objects and initialized them once. I believe there is almost definitely a working way to implement spritefonts that will work on everyone's pc, as you noticed no one ever complained of disappearing letters in the example caps. I just doubt you want your major project to be the guinea pig to figure out how.

    I once again repeat my apology to anyone who was counting on a finished version. It's just really infeasible with my new schedule and workload.

  • http://dl.dropbox.com/u/1013446/choices.cap

    ask questions if you have em

    control with left/right arrow keys

  • yes, welcome indeed.

    Also, might I recommend copypasting this post to the Official Introduction Thread

  • I probably won't be too regular of an editor, but I just saw something I'd like to add to an entry, and couldn't, so please add PsychoKinesis

lucid's avatar

lucid

Member since 16 Jan, 2009

Twitter
lucid has 22 followers

Connect with lucid

Trophy Case

  • 15-Year Club
  • Entrepreneur Sold something in the asset store
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

22/44
How to earn trophies