timcs's Forum Posts

  • [quote:udk3m9am]Hey brunopalermo would this variable be assigned to the spawnpoint object ? and then if it was true e.g. used then don't use that spawnpoint ?

    Exactly. Using instance variables with spawnpoints you can do lots of things - mark them as used, temporary enable/disable them, keep track or set limit of how many objects (let's say enemies) they spawned, specify which type of enemies each spawnpoint can produce, set an order in which they will be selected for spawning etc.

    Instance variables is a powerful stuff

    In your case, if you have 24 spawnpoint and would like, for example, half of them to spawn zombies and half to spawn vampires, you can add an instance variable EnemyType, set EnemyType="z" for 12 spawnpoint and EnemyType="v" for the remaining 12 and then do something like this:

    So in your example is the enemytype set against the enemy object or the spawnpoint or both?

  • Hey timcs!

    Not a big fan of Wait actions... I'd stick to dop2000 's second solution, having a variable that tells which spawn points were used...

    Cheers!

    Hey brunopalermo would this variable be assigned to the spawnpoint object ? and then if it was true e.g. used then don't use that spawnpoint ?

    ** EDIT **

    I think I have got this to work, my only problem now is that there are 24 spawnpoints and if I specify 12 for each of the objects to repeat over, it does not always pick them all or if I do spawnpoint.count/2 it still misses some out.

    Any ideas the best way to do this ?

  • When do you call the second function? Is it immediately after the first one? Try inserting Wait 0.1 before calling the second one.

    As far as I remember, object instances are not destroyed straight away, it happens on the next tick.

    As another workaround you can add an instance variable SpawnEnabled to your spawnpoint and use it for enabling/disabling spawning at each location.

    Thanks for the reply dop2000, the second one is called after the first had finished via a blank sub event so I will add a wait before hand and try that

  • Hi

    It seems a while since I did this before but I cannot for the life of me remember how. So in my scene or level, I have created spawn points around the area, I then have two other objects which I want to spawn randomly at these spawn points but for the two objects not to spawn at the same place.

    So far my logic is called from the on start layout as a function called "spawnobject1" which does the following :

    System->repeat x times

    System->Pick a random Spawnpoint instance-> Spawnpoint ->spawn object 1 on layer 0 (imagepoint 0)

    Spawnpoint->destroy

    When this has finished from this function I have a blank sub event which calls the second objects function and that does the same as above with that object, however even though I am destroying the spawn point used, the second object stills ends up at the same position as the first

  • dropbox.com/s/qg2hgaxm9rtuoru/bond-eye.capx

    Thanks brunopalermo very helpful

  • Hey timcs!

    Something like this?

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

    Here's the step-by-step:

    1. Put your bg in a layer.

    2. Create another layer over it (mask layer) and set the following layer attributes:

    Transparent: No

    Force own texture: Yes

    3. Create the "eye" sprite (it may have any shape you want) on the mask layer and set Effects>Blend Mode: Destination out.

    4. Move the sprite around using your favorit method. In this example I gave the "eye" sprite a Bullet behavior and added a "Every x seconds" event that randomly chooses the Sprite.Bullet.AngleOfMotion among 360 degrees.

    Hope it helps. Cheers!

    Thanks brunopalermo , for coming back to me, however I do not seem to be able to download your capx as it states that it is not there.

    ** EDIT **

    No need for the capx file now, I just followed your instructions and it looks good ! thanks again, just need to get the behaviour of the moving sprite to work a bit better now.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi all

    l am looking to create a circle which moves around the game area and when an object appears in its "sights" the play has to click on it if it is the correct type of object.

    My question is how to create this effect ? also the movement of this circle can either be a controlled path or random.

    I hope I have explained this well enough but if I have not think of the 007 intro where bond is walking across the screen and a circle or eye is following him. It is that type of effect

    Thanks

  • Hi again

    I have now figured out what I was doing wrong when reading in the data and writing to it from and to the dictionary and local storage. I have then read the data into a listbox object and used that to hold and allow me to move between records. However if I want to edit an existing record on clicking on an entry from the listbox I can read that into two edit boxes. However once I have changed the data, I worked out how to update the existing entry in the listbox but my problem is then to update the dictionary and localstorage afterwards.

    I noticed that the listbox has a json option and I tried that with the dictionary but this just clears the dictionary meaning to me that the data from the listbox is not held in json format as well.

    Any help on reading this data back would be appreciated

    ** EDIT **

    Worked this out now , ended up clearing the dictionary and re-adding the values updated from the listbox each time the entry was amended.

  • Hi again

    So the main question is, can the built in data objects handle what I am trying to do, as I do not want to try and work this out if they cannot. Sadly I also bought a plugin SQL lite database but this does not work with phonegap so that ended up as a waste of time (and a small amount of money ).

    Please can someone help me with this as it will really help me move forward with this project

  • Hi

    I am not sure if I am going about the whole process correctly so I have attached my capx file here

    https://drive.google.com/file/d/0B5zCtsJ4bwwOQVRyQWNmZ0dIY1E/view?usp=sharing

    So I am trying to load the data, if it exists, when saving it then should exist , however I am struggling to load the data into two text files and move between the records. Also how does the data get stored once the application is closed ?

  • Scrap my last post, I think I have figured this out, what I am struggling with , is how to move between the records with next an previous buttons

  • Hi again

    Trying to get my head around how to put the check in to see if the save data is there and if so to load it. I do not see the part where I can place the whole condition check if "magicname" exists then load it , as one hole condition.

  • 1) it's all about the dictionnary

    let's admit that we have two textbox

    <one> you write the english word I am

    <two> you write the french word Je suis

    Create a button that do:

    On clicked do: dictionnary -> add key -> key name = texboxone.text and value = textboxtwo.text

    With this you get

    I am = Je suis

    I need = J'ai besoin

    Or whatever you want.

    2) It's where is became easely it's a simple matcher

    If every list.selectedText = good value in dictionnary so "WIN"

    Because of the language barrier if you dont understand what i say or you thinks i dont understand what you say, you can retry to ask in another way.

    Thanks for this again, on the matter of loading the saved data back to the screen, how is this done, so it is saved using local storage , how then do I load this back when the app is started?

    Sorry for the last question was not reading your first post fully due to be very tired . Thanks again for your help hopefully this will do the trick. My only issue is to now get all of the data from my text files into this format.

  • Ok i understand your problem i struggled too the first time.

    1_ Create a dictionnary for storing your verb

    key: Manger Value: Eat

    2_ For saving the dictionnary use localstorage so

    any condition -> set item "magicname" to 'dictionaryasjson' (it's an expression)

    Now save is complete

    For loading

    1-on start of layout -> local storage check if item 'magicname' exist and get item "magicname"

    2- localstorage on item "magicname" get -> dictionnary load -> LocalStorage.ItemValue

    Not sure if it's the best method but it worked for me !

    Sorry for my english im French

    Have a nice Day !

    Casimir

    Thank you for your reply . Your English is much better than my French !!. Some questions on this and I hope that you understand where I am coming from with these .

    1) how do I store both English and French in one record ? so for instance how would I store Je suis and I am within the same record? If I cannot do this how would I go about "linking" these ?

    2) I am also building a phrase building section which currently holds a list of phrases in English and then the various versions in French . The screen currently has a series of list boxes and the idea is to select the correct section of the phrase from each of these to make up the phrase asked. So I would need to be able to hold the sections of the phrases as well as the English version and the various French versions.

    Currently all of this data in held in various text files that are part of the project and so these would eventually need to be converted over somehow.

  • Hi all

    Sorry to post a question that has been asked before , it is just that all of the posts I have read I have struggled to understand and when trying the various methods struggled to see the results.

    So my current project that I keep adding to is mainly one that I use for myself, This is an app more than a game as it is more of an educational app but you could treat it as an educational game app in some places. The part that I find long winded at the moment is adding new data to it each time. This app is used to help me learn French which I use in line with the "homework" I get from my tutor.

    This is currently done by editing a text file outside of the project, adding into the project and then having to re-compile the project each time. So the data consists of verbs both regular and irregular which are help in separate text files and hold the French and English data . Then I have other text files that hold other data for this app.

    My aim would be able to add the data to the app by creating a form entry for each section that allows me to enter e.g. new verbs both their French and English counterparts and this is for the Android platform and I would like to be able to store the data locally on the device or within the app whichever is possible. This means that I can use the app offline without having to keep connecting to a remote server.

    I have looked at the various options e.g. XML , dictionary and arrays plus localstorage and some external plugins as well but I am not seeing an obvious way to do this.

    Can someone please guide me on how to do this please. I did read through some of the tutorials but some are based on remote servers and one goes through using a web storage which I believe no longer exists.