piranha305's Recent Forum Activity

  • the folder thing is nice, i did not think of that, i have been merging all my js into one file in the order i needed. but that get really tiring when you have more than 1000 lines in one file. thanks.

  • is there a way to control the order in which scripts are loaded on the page? if i have serveral js files how can i ensure they are loaded in a specific order.

  • you can also wrap each of your functions in a class

    class gun
    {
    	constructor() {}
    	show() {
    		alert("gun");
    	}	
    }
    
    class laser
    {
    	constructor() {}
    	show() {
    		alert("laser");
    	}	
    }
    

    then you would need to create instances of each of those classes

    const gunInst = new gun();
    const laserInst = new laser();
    

    then on your button click you can do

    gunInst.show();
    
  • here is the link to the issue

    https://github.com/Scirra/Construct-3-bugs/issues/3104

  • so something interesting that happens is if you have chart.js and chart.css these guys get nested togetehr

    now depending on what you imported first it will get nested in the scripts folder or the project folder.

    not sure if this is bug or intentional.

    drive.google.com/open

    i have attached a gif of the behavior. it does not seem to have any major impact that i am aware of.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • that is great stuff to know, some of these charting libraries also require you to attach a css file as well. just including the css file in the project does not attach it to the page. in a case like what is the recommended approach?

    should we append to the head element when the pages loads up? or does construct have a way to include any css file import as a style tag?

  • You can't collapse a whole event sheet script block at the moment but I think this is something we will do in future.

    That would be very awesome, thanks!

  • construct3.ideas.aha.io/ideas/C3-I-967

    code folding will be invaluable for long javascript files!!!!

    this is not really important, but i hope you guys consider it for the future!

    Tagged:

  • i was able to solve this by mixing both events and js

    the way i solved this was by having a function whose condition picked object by using is on screen in system. that function executed sciprtInEvents, where it would iterate the picked instances and and push them to my queue.

    var instances = runtime.objects.Moveable.getPickedInstances();
    for(let i of instances){
    	//queue up instances that appear on screen 
    	turnSystem.queue.enqueue(i);
    }
    

    then from my turn system class. i execute this function at the start of every turn cycle. you need to have a different mindset when trying to reason about events and java script together. but so far it's turned out to be really powerful.

  • Using the scripting API, do we have access to the view port coordinates? I want to create a filter like the system condition is on screen for the instance. Is that possible with properties exposed now (did i miss it) or is that something that is coming in the future?

    Tagged:

  • okay thanks, just making sure you guys did not have a better way!

  • instances have a tesOverlap(wi) and testOverlapSolid() would it be possible to include these same functions with an overload for offset?

    as of now the way to achieve this is to manually alter the position of you object, check for overlap then revert the position back. is that how the check is performed for the equivalent actions in events? if it is, then it's not really a big deal, and just running that logic manually will be sufficient, but if you guys are doing something extra that might be faster, then the addition to this in the scripting api would be pretty helpful.

    Tagged:

piranha305's avatar

piranha305

Early Adopter

Member since 26 Apr, 2016

Twitter
piranha305 has 37 followers

Connect with piranha305

Trophy Case

  • 10-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • x12
    Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • x13
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x4
    Lightning Draw First person to up-vote a new Construct 3 release
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

20/44
How to earn trophies