nimos100's Recent Forum Activity

  • For those that cares.

    The first example i did in the beta release r110, and couldnt get it to work.

    I now downloaded the lastest stable version r108.somthing i think. And now it works.

    So guess there might be a bug in the beta release or something.

  • i just tried it, but it stills just return 0 :(

  • Hi

    Have a probably simple question regarding arrays, as i started looking at them and how to use them.

    So i read the manual part about it and some tutorials about how to add values to them. But no matter what i do, i cant seem to get anything but 0's out of it. Even when i try other peoples examples of how they did it, when trying to help someone else, there examples still just return 0.

    So maybe someone can explain it for me.

    I made a 1 dim array with 10 width.

    I use:

    for each X element

    • Array | Array set value at Array.CurX to 1
    • Text | Append Array.At(Array.CurValue)

    It returns 0 for all.

    I have also tried using CurX in the append text, but it still returns 0.

    Anyone know what im doing wrong?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ahh ok i see.

    Thanks for clearing it up for me :)

  • So if i understand you correct it just doesnt work in a subevent, due to that?

    I have no clue how the overlapping check is done, but thought that it was done by taking each instance, in this case only the newly created one and just go through each of the elements that its told to check for overlapping and see if its true or not.

    But if i understand you correct its done in some way where it picks 2 instances that are overlapping and then return true, and since it only picks one instance in my subevent it will always return false?

  • For those that cares :)

    I did some more testing of this, trying to figure it out. And based on the article - "Understand the picking of newly created/spawn instances since R101" I cant see why it shouldnt work as its pretty much an exact copy of that. But for some reason the newly created instances doesnt seem to work with the overlapping test, when its added as a subevent. As im setting lots of other values as part of these subevents which works fine.

    However if you move the overlapping test into its own event it works fine, and do some workaround, i think you can get it to work kinda the same way.

    The purpose of this is to make a part of a random map generator that add X amount of different graphic elements to a map, but at the same time makes sure that if these elements are not overlapping, they are destroyed and a new one is made.

  • Hi

    Think you can do it several ways.

    If you give all your weapons an ID, so pistol = 1, Rifle = 2 etc. Or just strings whatever you prefer. And then store that value as a global variable, like "Player_active_weapon", then you could simply check on layout startup, what value is in "Player_active_weapon". And set that weapon to active on the new layout.

    A way that would work i think, is if you make an empty event sheet and call it "Player stats" or whatever, then you can add all the player stats like health, weapons, ammunition or whatever you need in there. These values can be used in any layout you have. That way you can simply update that event sheets variables everytime the player interact with the surrounding.

  • Have a quick question about overlapping, that i hope someone can explain to me.

    So i have this event:

    X = 10

    Event:

    For 1 to X

    Spawn family1 at random(1000), random(1000)

    subevent:

    family1 is overlapping family1

    family1 destroy

    add 1 to X

                  

    However they are still ending up overlapping at some point.

    I read in the tutorial section about picking newly created instances, and i cant see why this shouldnt work, as the newly created family instances are within the scope. Anyone know what im doing wrong?

  • Hi got this while copy/pasting an action. It was a System -> Set value action that set the value of a local variable, if that helps.

    ---------------------------

    Construct 2 Check failure

    ---------------------------

    Check failure! This is probably a bug:

    Creating deleted status undo point with no elements

    Condition: !project_elements.empty()

    File: Undo.cpp

    Line: 62

    Function: __cdecl ModifyDeletedStatus::ModifyDeletedStatus(const class std::vector<class ProjectElement *,class std::allocator<class ProjectElement *> > &,bool,const class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &)

    Build: release 105 (64-bit) checked

    Component: Construct 2 IDE

    (Last Win32 error: 0)

    You are using a 'checked' release of Construct 2, intended for testing, which causes certain errors to be reported this way. Hit Ctrl+C to copy this messagebox - it's useful information for the developers, so please include it with any bug reports! Click 'Abort' to quit (unsaved data will be lost!),'Retry' to turn off messages for this session and continue, or 'Ignore' to continue normally.

  • Yeah but each family can have X number of objects which have an variable called the same but with a different default value.

    If you make an instance of an object it should get the default values of its parent.

    So if:

    object A: I = 10

    object B: I = 15

    and are in the same family.

    so if you make an instance of object A as far as i know, it should inheritance its I value.

    So if you change object A I value, newly created children of that object should get that value as well.

    As far as i see it, its no different in construct 2, there is just not a function that allows you to specify what "family member" you want to create.

    But i might be wrong, but i cant see why there should be a problem in changing a parent object default value, just because its part of a family.

  • Its a bit weird, anyone that works with families must run into this problem at some point, if they ever want change a value in that family, before creating them?

    It would be nice with a create family object, where you could specify which object in the family you wanted to create. That way you would be able to do it, as far as i see.

    I can set the value if i use pick nth instance i want when assigning a new cost, but it doesnt work with the create object unfortunately.

    I think i might run into a lot of problem later on if i use an array like you did, and it will make the project really messy, with so many buildings array which i cant keep track off.

    Ill try to see if i can make a work around for it.

    But thanks for the help.

  • Hi Kaisirak

    They are familiy variables.

    I tried your building.capx and modified it so it matches my situation.

    Modified buildings

    if you press "1" it will just spawn a goblin at 100,100 and then subtract its cost from credit.

    which works fine.

    If you press "I" it will now just set cost of all buildings to 5. But when you press "1" it will correctly check for the new cost value, but it will still subtract 10 from the credit.

nimos100's avatar

nimos100

Member since 23 Sep, 2012

None one is following nimos100 yet!

Trophy Case

  • 12-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

16/44
How to earn trophies