Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

Detecting where a program run was called from.

Discussion in 'Programming (In-game)' started by Wolfsbane, Jun 30, 2020.

  1. Wolfsbane Trainee Engineer

    Is it possible to know where a programmable block was called from in the script?

    So in this case I have a sensor named "assignment A" and it calls the pb with the argument "OpenDoor" a generic call for all sensors with the same function on the grid.

    I then want to search for a door with name contains "assignment A" taken in this case from the name of the sensor that sent the run command.

    So in this case I only need to setup the names of sensors and doors to match without having to also set up a unique argument for each sensor to send the pb.
  2. Malware Master Engineer

    I'm afraid not. You need to use arguments, that's what it's for.
  3. Wolfsbane Trainee Engineer

    Thanks for taking the time to answer, shame about that.
  4. Mollymawk Apprentice Engineer

    could the op not write his script to list all entities in range of each sensor? so the sensors do not have actions at all, the pb just polls sensors to list enteritis and decides what to do.
    ive done this to make spot lights on rotas to track my movements.
    it means code is running all the time. you need to make full use of the state machine thing, to keep ticks short.