GabeOfThrones's Forum Posts

  • I ran into the need for a getObjectByName() a couple of days ago trying to store spawn point names with doors. I was able to work around it by approximating a point and then using "Pick nearest to" to get the UID. Breakable if I change my layout in any meaningful way, but workable.

    But now I'm in a spot where that won't work. I'm storing state data for my game in Dictionaries. 1 for each state/level (dialog lines, object positions, etc) with a naming convention. Since the dictionaries aren't physically in the layout, I can't think of anyway to detect them. Even if I could, I know the exact name of what I want and it seems like I should be able to just get that Dictionary by name.

    something like: getObjectByName("Level_010").spawnX

    I'm figuring that if there isn't a getObjectByName() function out there, that there must be an easy alternative to do this simple procedure. When I scraped the forums/manual/tutorials, all I could find was "no, you have to use the UID or IID". I'm not seeing how to do that in this particular case.

    How do I?! <img src="smileys/smiley4.gif" border="0" align="middle" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ramones! Thanks! UID was what I was looking for!

  • I just got my license and was excited about implementing families. Seems good for a lot of things, but I was kind of thinking about them like a class. I might be wrong about that though...

    I have a character that can pick up objects, so I put all the pickup objects in an "objects" family. Then instead of having a separate function for each object I created a generic function for "pickupObject". Woot! The problem I'm having is that it doesn't seem like you can reference your particular instance once you discover it. I want to pickup when I'm overlapping an object, but I don't want to pin all the objects in the layout to the player at the same time.

    Is there a way to get Objects.name or this.Object or something so I can pin just the object I'm overlapping with? I can't find anything like this...

  • What is pinning doing under the hood? I assume it is also some sort of every tick, set position sort of thing. Is it really less taxing?

  • I tried the pinning. Pretty sweet, but it's curious that it doesn't let you choose the preferred registration point. It just kinda gloms on wherever it happens to be. May have to rethink implementation...

  • Thanks for the quick reply, Rory! I was suspecting it was something about C2 that I wasn't realizing. The else did the trick. I mistakenly figured that once it found a true set of conditions that it would break out of the event after it ran the action. Wrong!

    Also, great advice RE: the pin. I wasn't aware of that functionality yet, but I'll give it a try!

  • This is my first post. Woo!

    I have something occurring that doesn't make sense. I've banged my head long enough and need some more eyes on it... Hopefully someone sees something obvious!

    I have a character and an object. I want to hit Space to pick up or put down the object. Super rudimentary right now. I have a boolean on my Player called "equipped". I check on every tick to see if it is true and set the position of the object to teh Player if so. Pickups worked just fine! Then when I added the put down, it just stopped working. There seems to be a conflict, but it's not obvious to me. Here's the event sheet:

    <img src="http://www.gabemiller.com/images/c2bug.jpg" border="0" />

    Event 11 works if 12 is disabled, but 12 overrides 11 if they are both enabled. This doesn't make sense to me since the condition for 12 is not true (i'm rendering the boolean to a text value to make sure)

    This is also running on Every Tick, but seems fine:

    <img src="http://www.gabemiller.com/images/c2bug2.jpg" border="0" />

    Thanks for any help!