Magistross's Recent Forum Activity

  • Sorry if it was ambiguous, len here was a variable (from the Game Maker Docs). Here's what it look like with the value 90 for "dir" and 1 for "len".

    lengthdir_x(1, 90) = 0

    cos(90)*1 = 0

    lengthdir_y(1, 90) = 1

    sin(90)*1 = 1

  • From the look of it, it seems that lengthdir_x(len, dir) and lengthdir_y(len, dir) are basically cos(dir)*len and sin(dir)*len.

  • LittleStain That's a pretty clever way to deal with multiple lightsources not getting shadowcast over each others.

  • Dug out, tidied up and commented. This might be a terrible way of doing it because of looping through the code until it finds the correct member of the family but in my tests it appears to work quite well and saves quite a lot of code.

    https://goo.gl/GJSPIR

    In an Utopian world of infinite memory and processing power, this would be the best solution. However, we're not quite there yet, so in the meantime it's better to limit the memory allocation to a minimum when you can. <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">

    It could still be functional if the family has very few object types, but with each new type, the odds of NOT instantiating the wanted one increase drastically.

  • The condition can never be true. Logical expression only ever equals 0 or 1, not 384. Also, after testing out your capx, it seems the "|" operator is not evaluated in the order it should, so I could only make it work by adding parenthesis.

    (Sprite.X = 256 & Sprite.Y = 96) | (Sprite.X = 640 & Sprite.Y = 96) | (Sprite.X = 256 & Sprite.Y = 384) | (Sprite.X = 640 & Sprite.Y = 384)[/code:92sg8y76]
    equals to 1.
    
    This, together with a for each should make your capx work.
  • The plugin being made by rexrainbow you can safely assume it will never break, and even if it does, it'll get fixed in no time. So no worry there.

  • The nickname plugin might help you.

    There are however some tricks you could do if you prefer the vanilla way. You could create a function named "CreateShip" that receive a string parameter, and using a long list of "if else if...", create the correct ship, and set the return value to the newly created ship. Whenever you want to create a ship, use that function, and use a "Pick by UID" on the ShipFamily with the return value to change its family instance variables.

    I once did an example of something similar.

    And as for the "On created" issue, the trigger is indeed called before the remaining actions. This is by design, so you will have to take that into account when you use this event.

  • You are missing a "Pick all Critter" somewhere along the way. The "For Each" essentially limit the SOL to a single Critter, to test against all critters in a sub-event, you have to include a "Pick all".

  • Magistross , yes that is very interesting/insightful! Using a dictionary for each sprite is something I was thinking about already, but now it makes more sense. I assume the dictionaries for the sprites should have the global value turned off, otherwise they'd continue to spawn new dictionaries if layout is reset? Thanks!

    ep, I didn't think of changing it to non-global, you're absolutely right on that account. Although, I believe that the fact that the sprites Dictionaries are tied to a non-global object makes them non-global too in the end.

  • I went with the idea of using solely dictionaries. Might interest you.

    https://dl.dropboxusercontent.com/u/700 ... Regex.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Replacing with values from a dictionary is quite easy and straightforward. However, it is not really possible to retrieve instance variables by name, unless you hard-code them all.

  • I never dabbled with multiplayer myself but if I were to implement a "multi-level" "multi-player" game, I wouldn't ever change the layout and stick to loading levels dynamically.

Magistross's avatar

Magistross

Member since 4 Jul, 2011

Twitter
Magistross has 14 followers

Trophy Case

  • 13-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
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

20/44
How to earn trophies