lucid's Recent Forum Activity

  • yeah, you only needed a few files from the common folder, but that's probably easier

    happy plugging

  • yeah, links right

    i was thinking of the 360-0 gap, when i did the adding thing, but thats at 3oclock not 12 oclock

  • dont give up...that art is beautiful.

    ok, the equation you need is as follows

    get the angle of absolute red, and get the angle of absolute blue

    to get the arrow to point to the correct level of health:

    (lerp(0,(blueAngle-redAngle),currenthealth/100))+redAngle

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • thank you, alspal, i edited it after you posted your first post, did you see I responded to your question about the crashed cap?

    <img src="http://dl.getdropbox.com/u/1013446/s/s.png">

    things are about start coming together, the next tutorial I have planned is on object arrays, as opposed to objecttype arrays. This post is not the full tutorial. It is a description of the problem we are going to solve with object arrays, and the example cap to do so. You may be able to figure most or all of it even without the tutorial.

    so here's the problem.

    create a weapon for an overhead shooter. You can left click on enemy ships to make them targets. Click the right mouse button to fire out drone missiles. The drone missiles should attack the targets one by one in the order you clicked them. if you fire more than one missile at a time, the missiles should take over the next target in line. No two missiles should ever attack the same target at the same time. After all targets are either destroyed, or currently being pursued by another drone missile, the drone missile should return to the mothership.

    This can be accomplished in relatively few events, using s.

    http://dl.getdropbox.com/u/1013446/s/objectarray3.cap

    there's the cap, tutorial coming soon

    have fun

    a note on crashes: if you click the same target twice you can make it crash. These are not random stability problems, I understand where the crash is coming from. I am working on ideal solution that will both maintain the power s and usability . The default system is the solution to the problem of trying to access values outside the array. This used to cause a crash, but I didn't want to return a meaningless value either. It turned out to be useful in another ways. The following problems also require solutions that both prevent the crash, but also make it obvious where something is going wrong, instead of just being a silent bug in your code. In the meantime, there are a few things that make s crash that can be avoided if you are aware of them. 1. typos. misspelling a name, forgetting an element to an address, or doing "this" instead of {"this"} 2. destroying an object, and then trying to do something with an object variable that pointed to it. 3. destroying an array, and then trying to access it. please report any other crashes also, everywhere you're expected to type an array address should begin like this {""} so the brackets are already there when you start, this goes the same for expressions. Please let me know if you discover them missing anywhere. Also, anywhere you can type in an object address, you should be able to use the name "in quotes" of any picked object. Please let me know if you discover anywhere this does not work. thanks everyone who's helping me test this.

  • thanks for this.

    I get a runtime error when clicking in the last .cap and it closes?

    sorry, change the loopname on createtext to numloop instead of nummy

    I changed the names at the last minute, and forgot to change it there...also, you can just redownload the cap at the same link, I fixed it

    <img src="http://dl.getdropbox.com/u/1013446/s/s.png">

    ok, for this tutorial you will need to redownload the plugin, if you downloaded it before this tutorial was up.

    This is a simple objecttype tutorial, to introduce objecttype arrays.

    http://dl.getdropbox.com/u/1013446/s/objecttypetutorial.cap

    in this little game thing, you have a default green thing as your attack (space bar)

    as you pick up items they are put in a queue, and each time you press space you use the first item in the queue, when you run out of special items, you fire your default again.

    at the beginning you see I deactivated bullet movement...this was just so the objects would sit there until you picked them up.

    on collision with blue I inserted tt("blue") into the array

    tt stands for true type, you can of course choose a normal type, or a family to be added to the array. In this case, we don't want the type "blue" inserted into the array, we want the "true type" of the object, not the family type. this expression only works if there is an actual object, because of course there is no true type for the family itself.

    so we insert the type at the "end"

    and destroy the "blue" object

    on "space bar" pressed

    spawn the type at {"types"} (which is {"types",0})

    and delete that entry in "types"

    try out the cap, and try to understand the events.

    now we are going to change it a little bit

    we want to make lightning the new basic weapon, if we pick that up.

    http://dl.getdropbox.com/u/1013446/s/objecttypetutorial2.cap

    on collision with "blue"

    we use a condition from s

    "is of object type"

    we check if "blue" is of the lightning type. in this condition, you can also type in an arrayaddress for an object type or even the array address of an object using the o expression o({"objectarrayaddress"})

    if it is of lightning type, we use the "new default value for array" action to make lightning the new default, and then we destroy the object we picked up

    else, if it is not lightning type, we add it to the array the same as in the previous version

    The next topic will be object arrays, then super arrays. then we will start to see full examples of complex projects, like inventory systems, and level editors, and we will see how s works to make these types of projects simple, and with few events.

  • you should be able to use set and get controlstate. make sure you have the latest version of the sdk from this board. if it does not have those functions, reply back for instructions on how to update your sdk

  • click here to download latest version (10/14)

    <img src="http://dl.getdropbox.com/u/1013446/s/s.png">

    ok, I apologize for the delay, but there is a silver lining. The superstructure portion of the plugin for download above is much closer to complete.

    We are going to have a different type of tutorial today, that will be a crash course in everything s over a wide array (get it?) of ideas and syntax. I won't be walking through every detail, but there should be enough information to get you on your way. Anything anyone needs help on, or can't get to work properly, we'll delve more deeply into those areas in the tutorials that follow.

    OK, so this tutorial assumes you've read, and understand, the first two tutorials.

    We've created string arrays, and added values, and deleted values.

    Number arrays are used in the same ways, and we will be looking at primarily numerical examples as we complete the remainder of the basic array features. The examples in this tutorial require features from the new version of the plugin linked above.

    First we will learn 2 new math expressions included in s

    Get T

    abbreviated t(min,max,amount)

    this will generate a value between 0 and 1 that represents the ratio between min and max that amount is.

    it would return 0 if amount was equal to min,

    1 if amount was equal to max. and 0.5 if amount was halfway between the two.

    this t value has many uses.

    here's a simple example

    First we will see an example of an energy bar that shows how far across the screen we are

    http://dl.getdropbox.com/u/1013446/s/energybar.cap

    the t value is also the value t in many equations, such as interpolating functions, and trigonometric functions. (ie. lerp and cosine)

    there is a special version of this lt, short for loop t, we will use later in this tutorial

    another math expression in s is

    ranged seeded random.

    the expression is s.rand(min,max) and returns a random number between min and max

    there is an action to Seed Random

    if you will need to repeat the exact same sequence of random numbers again

    seed the random with a known value (this can be a random number that you save in a variable for later use)

    after seeding once you generate random numbers as normal

    if you needed the randomness to reset you could reseed the random with the numbervariable you created. this will start the same exact random sequence you had the first time. you can do things like generate the same random starfield each time a game loads up, or have a rewinded scene generate the same randomized values for ai decisions, or in a custom particle generator.

    Next we will move onto one feature of arrays we didn't cover in the last lesson. the 'last element expression'

    you will find it as Number Array size -1, String Array Size -1, etc when you double click s for the expression list

    These expressions return the index of the last element in an array, Since s is 0 indexed, this is the array size-1

    the expressions are:

    ole({"object array address"}) index of last element in an object array

    otle({"objecttype array address"}) index of last element in an objecttype array

    sle({"string array address"}) index of last element in an string array

    nle({"number array address"}) index of last element in an number array

    sule({"super array address"}) index of last element in an super array

    now that we've covered the basic expressions for arrays,

    let's move on to actions and conditions.

    First the other basic actions we haven't learned yet that apply to every type of array.

    One of them is rotate array. This will shift every member of the array the specified amount of times forward or backward, and have anything that shifts off the end of the array wraparound to the other side, for instance:

    A B C D

    if you rotated this 1 it would become

    D A B C

    if you rotated ABCD -1 it would become

    BCDA

    swap array values swaps two values with eachother

    given ABCD, if you were to swap 0 and 3, you would get:

    DBCA

    Delete Array destroys the entire named array, you cannot add to the array again, because it no longer exists

    Clear Array deletes all the elements in an array, but not the array itself.

    Now onto conditions,

    Is Contained in allows you to specify a value. if that value is in any of the elements of the array, the condition is true,

    now, we are moving onto the For Each conditions

    These are similar to other For Each conditions in construct. They loop once for each elements in the specified array.

    There are a few important things to know unique to S's for each conditions.

    The first is, these are named loops, and you can nest them within eachother.

    you can use the name of the loop for several things

    you can do

    lle("loopname")

    loop last element

    this gives you the largest index the loop will loop to. It is the size - 1 of the array the loop is looping through

    li("loopname")

    loop index, this gives you the current index in the loop

    also when addressing something from the loop, you can use a special key character "l" to automatically specify the array the loop refers to. for instance

    loopname: "myloop" For Each Number in {"this","that","number"}

    if you wanted to get the number contained at the 0 index of "number" while in the loop, instead of:

    n({"this","that","number",0})

    you could just write n({"l","myloop"})

    we haven't worked with addresses longer than one word, but this will come in handy as you construct larger and more complex structures. Also, these work recursively, you can specify the array to loop through using the {"l","loopname"} notation.

    here is an example of a simple app that uses the ranged random function, and loop t function (s.lt("loopname") - this is the equivalent of t(0,lle("loopname"),li("loopname")), basically a t value for the progress of the current loop)

    this example also uses the rotate array action, you can toggle that off, and try the swap array function as well

    to use this cap simply press the left mouse button to add extra random numbesr to the array.

    right mouse button rotates the array.

    http://dl.getdropbox.com/u/1013446/s/randrotgetloopt.cap

    sorry for the delay in tutorials. I'm beginning work on the object and objecttype array tutorials, and that's where you'll start to see some of the real power of s

    after that will be the super tutorial, and at that point you will have enough information to use 's's superstructure functionality to the fullest, and I will move on to complete the rest of the plugin

  • understandable

    and do you mean earlier versions of spritefont, or earlier versions of construct?

  • i couldn't get passed the first level

  • it shouldnt be too slow konjak, i think the main time event slowness as compared to plugin speed matters is when youre doing hundreds or thousands of events per tick. i think the array problem youre having might be fixed by using a different type of container, such as those provided in the new s plugin. also, if you plan on making an event based text writer, the s plugin may be useful for that as well. however, other than the issues with the arrays, what other features are missing, that i might add to a future version. what form of control? i still havent documented this plug, so its possible its actually already in there

  • k, turns out tutorials take longer to write than software

    I'm working feverishly to get a complete crash course on the rest of the current feature set

    also, since the last post, I've completed most of the superstructure portion of the plug

    you will be learning on a much more streamlined version than had I released the tuts a few days ago

    bear with me. There's some really good stuff coming your way.

  • I think that the construct ui is built using that library, not the games and apps you produce with construct

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