peacemaker109's Forum Posts

  • 2 posts
  • while i can see how to, i also see how much longer it takes to do, instead of quick types i have to right click, add event, double click cond. click add event, double click action, type the parts, rinse and repeat, takes me 2-5mins to write the script, far more time to manual click in events, just assumed there was a means of adding code sniplets or something

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So I am new, and sure this is already somewhere but after awhile searching, cant find it.

    I see I can create JS 'Plugins' but what if I just want a JavaScript or something in a particular project?

    I am trying to redo a fairly simple script I am using with another engine, to get the same results here, but without scripting it, well, the events system is just slow for me, lots of clicking adding events sub events trying to get things to run in a certain way or order, that I can do in a few mins with a script.

    So I am wondering can I use accual scripts at all on a per project basis or do I have to find a means of making them as plug ins that i would really only use in a single project?

    A example, I am making a array/grid based layout, 1 layer deep, I make the array, and do all my basic stuff with the code below, but trying to do that in the events system for me is seeming not doable. Maybe for more experienced users with the event system and knowing how to do it properly, but from a scripters view dosent work so well.

    Something like this I dont think a plugin would do a good job, as it is set up to work on a particular set of params for a certain project.

    	void Start ()
    	{
    		MapArray = new ushort[100, 100];
    		MapArrayRes = new ushort[100, 100];
    		for(int x = 0; x < 100; x++)
    		{
    			for(int y = 0; y < 100; y++)
    			{
    				MapArray[x,y] = 0;
    			}
    		}
    		// create random areas of diffrent materials
    		int numOfSandAreas = Random.Range(3,50);
    		int numOfRockAreas = Random.Range(3,50);
    		int numOfStoneAreas = Random.Range(3,50);
    		for(int sandX = 0; sandX < numOfSandAreas; sandX++)
    		{
    			int sizeofarea = Random.Range(1,2);
    			int areasize = 0;
    			if(sizeofarea == 1) { areasize = Random.Range(0,5); }
    			if(sizeofarea == 2) { areasize = Random.Range(5,10); }
    			if(areasize > 0)
    			{
    				int startX = Random.Range(0,100);
    				int startY = Random.Range(0,100);
    				for(int x = 0; x < areasize; x++)
    				{
    					for(int y = 0; y < areasize; y++)
    					{
    						int tempX = startX + x;
    						int tempY = startY + y;
    						if((tempX < 100) && (tempY < 100)) { MapArray[tempX,tempY] = 2; }
    					}
    				}
    			}
    		}
    		for(int rockX = 0; rockX < numOfRockAreas; rockX++)
    		{
    			int sizeofarea = Random.Range(1,2);
    			int areasize = 0;
    			if(sizeofarea == 1) { areasize = Random.Range(0,5); }
    			if(sizeofarea == 2) { areasize = Random.Range(5,10); }
    			if(areasize > 0)
    			{
    				int startX = Random.Range(0,100);
    				int startY = Random.Range(0,100);
    				for(int x = 0; x < areasize; x++)
    				{
    					for(int y = 0; y < areasize; y++)
    					{
    						int tempX = startX + x;
    						int tempY = startY + y;
    						if((tempX < 100) && (tempY < 100)) { MapArray[tempX,tempY] = 1; }
    					}
    				}
    			}
    		}
    		for(int stoneX = 0; stoneX < numOfStoneAreas; stoneX++)
    		{
    			// num 2
    			int sizeofarea = Random.Range(1,2);
    			int areasize = 0;
    			if(sizeofarea == 1) { areasize = Random.Range(0,5); }
    			if(sizeofarea == 2) { areasize = Random.Range(5,10); }
    			if(areasize > 0)
    			{
    				int startX = Random.Range(0,100);
    				int startY = Random.Range(0,100);
    				for(int x = 0; x < areasize; x++)
    				{
    					for(int y = 0; y < areasize; y++)
    					{
    						int tempX = startX + x;
    						int tempY = startY + y;
    						if((tempX < 100) && (tempY < 100)) { MapArray[tempX,tempY] = 3; }
    					}
    					
    				}
    			}
    		}
    		for(int x = 0; x < 100; x++)
    		{
    			for(int y = 0; y < 100; y++)
    			{
    // draw the arrays information
    			}
    		}[/code:2ujbvb9u]
  • 2 posts