dop2000's Recent Forum Activity

  • Not sure if this advice will be helpful..

    In my game, which is also quite a big project, I have lots of separate event sheets for different things - Audio, Background, Enemies, Shop, Coins etc.

    Almost all of them have "Init()" function, which resets static variables, enables/disables groups and does other things like that.

    On start of each level I call these functions - BackgroundInit(), EnemiesInit() etc.

    This helps to keep things organized.

    Changing state for several hundreds of groups at once doesn't seem like a good idea.

    If you think it's the only way, you can try this:

    Make a list of all groups. (to automate this task you can search for "event-group" tag in .xml files of the project using software like Notepad+)

    On start of the game, loop through this list and save the initial state of each group in an array or dictionary.

    Then you can use this data to reset all groups to their initial state.

    Or you can include the default state into each group's name. For example "Player controls #D", where "#D" at the end means "disabled by default".

  • I made this demo for another post recently:

    https://www.dropbox.com/s/0ex32akdcl7s2 ... .capx?dl=0

    You'll need CSV plugin to open it:

    plugin-csv-csv2array-csv2dictionary_t64326

    As for the button, you can change its appearance with CSS, but I prefer using sprites.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Can you try this -

    Create a new empty layout, set it as first layout in project properties. Then preview your project on mobile. Will it still take 4 minutes?

  • I don't have an answer for you, just curious - how slow is it?

    My capx is 15Mb and takes about 5 seconds to load when previewing on my Android phone.

  • Put A and B on the same layer, B above A.

    Set blend mode for B to "Source in"

  • Uglypenguin

    I forgot one thing - in the first two events you need to add "For each enemy":

    Enemy NOT overlapping NoticeRange   
    and Enemy isSearching=false   
        For each enemy                    Function call "StartSearch" (parameter: Enemy.UID)
    [/code:10fox8yi]
  • Is the function on the same event sheet? If it's on a different event sheet, you need to Include this event sheet.

    If this doesn't help, could you share your capx?

  • You can use Browser.Log -> Array.AsJSON to get the correctly formatted JSON string. All you need to change is to double all quotation marks.

  • Try this:

    Array Load from JSON   
    Copy/paste this string:
    "{""c2array"":true,""size"":[10,2,1],""data"":[[[60],[150]],[[60],[265]],[[60],[380]],[[0],[0]],[[0],[0]],[[0],[0]],[[0],[0]],[[0],[0]],[[0],[0]],[[0],[0]]]}"
    
    [/code:2ecaytek]
  • I'm trying to reply to a post and keep getting "SORRY YOU HAVE BEEN BLOCKED" error.

    Here is my comment:

    After many attempts and edits the forum finally allowed me to post it.

  • There are many issues with your code..

    If enemy is not in range or has no LOS, all highlighted events are executed on every tick. This is clearly wrong.

    Also, you need to pick the correct enemy instance in your function, otherwise you are assigning isSearching=true for all enemies.

    "Wait 5 seconds" inside an event which is triggered on every tick also makes little sense.

    I would add a Timer behavior to enemy and do this:

    Enemy NOT overlapping NoticeRange   Function call "StartSearch" (parameter: Enemy.UID)
    and Enemy isSearching=false        
    
    Enemy NOT has LOS to Player   Function call "StartSearch"  (parameter: Enemy.UID)
    and Enemy isSearching=false        
    
    On function "StartSearch"
      Enemy pick by Unique ID = Function.Param(0)
         Enemy set isSearhing=true
         Enemy start timer "StopSearch" for 5 seconds (once)
         Enemy start timer "SearchForPlayer" for 0.3 seconds (recurring)
    
    Enemy On Timer "SearchForPlayer"
        For each Enemy   // as Timer may be triggered for several enemies at the same moment
              ............... find path etc.
    
    Enemy On Timer "StopSearch"
       Enemy set isSearching=false
       Enemy stop timer "SearchPlayer" 
    [/code:1j18ux2j]
  • Sorry, I still don't understand your question.

    You need to populate this array? Should these locations be predefined on each level? Or are they generated on random?

    If predefined, you can read them from a file, say, using CSV plugin.

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 279 followers

Connect with dop2000

Trophy Case

  • 10-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • 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
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x14
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

30/44
How to earn trophies