Grapjas Posted December 28, 2020 Author Report Share Posted December 28, 2020 @Stan` @badosu ive got a few new questions: Is it possible in js to simulate a keypress? e.g. at the start of the game the script presses "." for the player to select the first idle unit. To make the camera jump to a spot on the map? Quote Link to comment Share on other sites More sharing options...
badosu Posted January 3, 2021 Report Share Posted January 3, 2021 Both are possible in the session context. Not sure in map triggers. For camera search for camera on prodmod github. 1 Quote Link to comment Share on other sites More sharing options...
Grapjas Posted January 4, 2021 Author Report Share Posted January 4, 2021 @badosu Engine.CameraMoveTo(1000, 800); <-- should be correct, but doesnt work. Gives back 'CameraMoveTo is not a function' even though it's literally used this way in other scripts, like your monitor mod but also in vanilla. Must be a root level issue. QueryPlayerIDInterface(1).SetStartingCamera(1000, 0); <-- Throws no errors but doesnt do anything either. Do you maybe have ideas on how i could manipulate where i want the camera to be? It's my only issue left right now with this mod. Quote Link to comment Share on other sites More sharing options...
Stan` Posted January 4, 2021 Report Share Posted January 4, 2021 Camera is usually overriden by the map, it tries to locate the cc IIRC https://github.com/0ad/0ad/blob/965f7c7e0afdac1b83c3a31c4fe702cdc1be18cf/source/graphics/MapReader.cpp#L1112 1 Quote Link to comment Share on other sites More sharing options...
Grapjas Posted January 4, 2021 Author Report Share Posted January 4, 2021 21 minutes ago, Stan` said: Camera is usually overriden by the map, it tries to locate the cc IIRC https://github.com/0ad/0ad/blob/965f7c7e0afdac1b83c3a31c4fe702cdc1be18cf/source/graphics/MapReader.cpp#L1112 It does so correctly, but because i'm randomizing the positions of players it just takes the old spot where the player was. Quote Link to comment Share on other sites More sharing options...
Stan` Posted January 4, 2021 Report Share Posted January 4, 2021 I guess the randomnization happens too late Quote Link to comment Share on other sites More sharing options...
Grapjas Posted January 4, 2021 Author Report Share Posted January 4, 2021 (edited) Yeah i figured. Does this mean what i'm trying to do is impossible though? Repositioning the camera in whatever way? Kinda would make this entire project useless tbh.. Edited January 4, 2021 by Grapjas Quote Link to comment Share on other sites More sharing options...
smiley Posted January 4, 2021 Report Share Posted January 4, 2021 4 minutes ago, Grapjas said: Yeah i figured. Does this mean what i'm trying to do is impossible though? Repositioning the camera in whatever way? Kinda would make this entire project useless tbh.. No. What you want to do is entirely supported. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.