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.

Error: 'IMyProjector' does not contain a definition for 'LoadBlueprint'

Discussion in 'Programming Questions and Suggestions' started by 64PBRB, Mar 31, 2020.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. 64PBRB Trainee Engineer

    Messages:
    7
    Long story short, I'm making a 3D projector minimap and I'm trying to get the markers to change colours based on detected entities' relationships, through changing the blueprint to a different-coloured ball. The full error is as follows:
    Here is a snippet of my code:
    Code:
    static string bpPath = "C:\\Users\\User\\AppData\\Roaming\\SpaceEngineers\\Blueprints\\local\\";
    static string bpNeutral = "Single ball (Green)";
    static string bpOwned = "Single ball (Blue)";
    static string bpEnemy = "Single ball (Red)";
    static string bpUnowned = "Single ball (White)";
    static string bpExt = "\\bp.sbc";
    
    //Bit of code in between...
    
    void updateColour (MyRelationsBetweenPlayerAndBlock r, IMyProjector p) {
    	string blueprint;
    	switch (r) {
    		case MyRelationsBetweenPlayerAndBlock.FactionShare:
    			blueprint = bpOwned;
    			break;
    		case MyRelationsBetweenPlayerAndBlock.Owner:
    			blueprint = bpOwned;
    			break;
    		case MyRelationsBetweenPlayerAndBlock.Neutral:
    			blueprint = bpNeutral;
    			break;
    		case MyRelationsBetweenPlayerAndBlock.Enemies:
    			blueprint = bpEnemy;
    			break;
    		default:
    			blueprint = bpUnowned;
    			break;
    	}
    
    	string completePath = bpPath + blueprint + bpExt;
    	p.LoadBlueprint(completePath);
    }
    There are a couple reasons this may have happened that I can think of... One is Keen didn't update their IMyProjector reference, which isn't that unlikely.

    More likely though is that the Projector Preview mod I'm using to make the markers smaller is messing with the function.
    EDIT: I just tested the code in a world without the mod any mods and it doesn't work... not sure whether to be relieved or disappointed.

    Is there a workaround to using this function, something like p.ApplyAction("LoadBlueprint", completePath);?
    If not, is there maybe a function similar to GetProperties() and GetActions() that returns interface functions, so it'd be possible to find it if it's renamed?

    Thanks!
     
    Last edited: Mar 31, 2020
  2. Malware Master Engineer

    Messages:
    9,862
    That's not Keen's reference. Keen doesn't have a reference. And that document was last updated in 2017.

    You're looking at the programmable block variant of that interface (Ingame namespace), but it seems like you're making a mod...? I only know that method in terms of the programmable block. It was removed because it should never have been available there. It was a mistake, nothing requiring a real disk path should be available for the PB.
     
  3. 64PBRB Trainee Engineer

    Messages:
    7
    Great... maybe their game would be more popular if they told people how to play it.

    I am trying to do a PB script actually... Sorry, probably should've clarified, considering this forum is also for mods.
    I did find it weird that a path is required, but I found forum posts on Steam and various other websites so I thought it would've worked (as long as the owner is online? :?). So, in conclusion, isn't there any way to load blueprints...? Not even by copying the data from existing projectors, or defining blocks individually, or something obscure?
     
  4. Malware Master Engineer

    Messages:
    9,862
    The programmable block is technically not a supported feature as such. It has absolutely no priority with Keen.
    Up-to-date ingame API listing is here: https://github.com/malware-dev/MDK-SE/wiki/Api-Index

    You're currently in the modding section. Ingame scripts are here: https://forum.keenswh.com/forums/programming-in-game.410940/
    But even better, to go to Keen's Discord server. There's a dedicated channel (programming-in-game) there for ingame programming.

    Blueprints are quite simply not accessible. Sorry.
     
  5. 64PBRB Trainee Engineer

    Messages:
    7
    But they made it... it's not a mod!

    Ah. I thought that was for showing off scripts, since this one says "Programming Questions and Suggestions".
    I mean, I guess I'm suggesting the implementation of blueprints...?

    Damn. Well, thanks anyway... I'll have to make do with putting spotlights on rotors to aim at the white orbs in order to colour them :p
     
  6. Malware Master Engineer

    Messages:
    9,862
    Yes. Well. These things happen with early access games. Not all features survive. The PB has three major problems. 1. It's user base is way too small. There are only a small fraction of the player base who are even interested in writing scripts. 2. It has performance issues. Well; technically not the PB itself, but you need to know what you're doing when you write scripts, or you'll drag game performance to its knees on a server. 3. It has security issues. I can crash a server with a single line of code.

    Neither 2 nor 3 are trivial to solve, and when taking 1 into consideration - it's simply not worth it, from a business standpoint.


    Note that I have pushed a lot of hours into getting the programmable block to work. There's more of my code in the guts of the PB than Keen code now, if we ignore the actual API. So I do not say these things lightly.


    From my point of view, while the PB will not die completely - and we do have at least one dev at Keen who keeps it alive (maybe two) - in his own spare time no less - it is a failed feature.

    I don't say that lightly either...
     
    • Informative Informative x 1
  7. Stardriver907 Master Engineer

    Messages:
    3,368
    It has some redeeming qualities, though :)
     
  8. mojomann71 Senior Engineer

    Messages:
    2,005
    That is why my friends and I stayed in experimental mode. We got to where relied on a couple of scripts and the game would just not be the same if we did not have them.
     
    • Like Like x 1
    • Agree Agree x 1
  9. Stardriver907 Master Engineer

    Messages:
    3,368
    Thanks, @Malware :tu:
     
    • Like Like x 1
    • Agree Agree x 1
Thread Status:
This last post in this thread was made more than 31 days old.