getting webstorm to work



  • I just picked up screeps and im having some problems when using webstorm. Im not the most advance developer so i might be setting it up wrong.

    Below is my main.js code file, what I am having problems with is;

    * i get an error under the word require saying that it is an unresolved function or method
    * i get an error under the word method saying unresolved variable or type
    * let are not supported by the current java version

    my code works ingame as of now 🙂 so i know there is nothing wrong with it. Does anyone know what could be happening in the IDE? Ive followed thPionGaming youtube tutorials in setting everything up.

    ```javascript
    var roleHarvester = require('role.Harvester');
    var roleUpgrader = require('role.Upgrader');
    var roleBuilder = require('role.Builder');

    var buildingTower = require('building.Tower');

    var creepSpawn = require('creep.Spawner');

    module.exports.loop = function () {
    // Spawns creeps if needed
    creepSpawn.run();

    // Tower logic
    buildingTower.run();

    // Makes sure memory is clear of dead creeps
    for(let name in Memory.creeps) {
    if(!Game.creeps[name]) {
    delete Memory.creeps[name];
    console.log('Clearing non-existing creep memory:', name);
    }
    }

    // Letting the creeps do their jobs
    for(var name in Game.creeps) {
    var creep = Game.creeps[name];

    if(creep.memory.role == 'harvester') {
    roleHarvester.run(creep);
    }

    else if(creep.memory.role == 'upgrader') {
    roleUpgrader.run(creep);
    }

    else if(creep.memory.role == 'builder') {
    roleBuilder.run(creep);
    }
    }
    }
    ```

     



  • Did you set it to ECMAscript 6? I dont use Webstorm but I believe he explains how to do it in part 2