Outerra forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Outerra Tech Demo download. Help with graphics driver issues

Author Topic: outerra ufo script  (Read 15317 times)

wayne57

  • Full Member
  • ***
  • Posts: 125
  • newbie
outerra ufo script
« on: May 25, 2014, 09:27:10 pm »

anyway of using this script for a model?



wayne57
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6651
  • Pegs is clever, but tae hain’t a touch sentimental
    • outerra.com
Re: outerra ufo script
« Reply #1 on: May 26, 2014, 02:08:52 am »

No, it's not a script but a camera controller. An easily controllable ufo-style vehicle physics mode is in the works.
Logged

patmarrnc

  • Full Member
  • ***
  • Posts: 136
Re: outerra ufo script
« Reply #2 on: November 28, 2017, 04:11:28 pm »

No, it's not a script but a camera controller. An easily controllable ufo-style vehicle physics mode is in the works.

did the easily controllable ufo-style physics mode ever come to fruition? Because that's exactly what I'm looking for... a simple flying script for an otherwise static model
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6651
  • Pegs is clever, but tae hain’t a touch sentimental
    • outerra.com
Re: outerra ufo script
« Reply #3 on: November 29, 2017, 03:31:25 am »

Hmm, the mode is there that allows the vehicle be controlled but with camera detached (and camera controlled with mouse?). But it has no script. I know we also wanted to include a way to script camera and create cinematic modes that way, but haven't got there yet. The script probably should not have to be defined per vehicle, there should be generic ones or specialized per vehicle class ...
Logged

patmarrnc

  • Full Member
  • ***
  • Posts: 136
Re: outerra ufo script
« Reply #4 on: November 29, 2017, 06:49:11 am »

Thanks for your quick reply. You have created an amazing product.. a truly awe-inspiring accomplishment.
Logged

fly77

  • Hero Member
  • *****
  • Posts: 606
Re: outerra ufo script
« Reply #5 on: April 03, 2019, 03:24:20 pm »

Any new development in regards to scripted ufo mode ? I'd like to use the ufo mode to control interaction with objects. I found that I can use the in-game-camera API (igc.h) to activate some "actions from a distance" in the ufo mode, for instance using the distance between  ufo-camera and the object to be activated (retrieved inside the javascript of the target object) as a parameter to trigger an action of the said object. I also thought about using the orientation of the ufo-camera as another parameter for controlling actions. So keys Q and E of ufo-mode can trigger other actions of the target dynamic object by checking the variations of in-game-camera roll. Similar for ufo-mode up and down  (keys R and F). 
Still it would be preferable to have more direct scripted actions control over the outerra world in ufo mode, instead of expressing commands by "body language" . Anything in sight in this regard ?
« Last Edit: April 03, 2019, 04:14:43 pm by fly77 »
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6651
  • Pegs is clever, but tae hain’t a touch sentimental
    • outerra.com
Re: outerra ufo script
« Reply #6 on: April 05, 2019, 04:25:28 pm »

I'm not sure it would be good to mix interactions and a camera control script, that has a big potential for unpredictable behavior later, and would make any sensible control or things impossible in multiplayer.

We want to add scriptable static objects, with functions invoked depending on the proximity of an observer, allowing it to run different simulation levels depending on whether there's anyone to see it. What you say sounds like the scriptable object could also see who approaches it and react accordingly?

Logged

fly77

  • Hero Member
  • *****
  • Posts: 606
Re: outerra ufo script
« Reply #7 on: April 05, 2019, 04:59:28 pm »

First of all thanks for answering.  :) Great news to hear that you plan scriptable static objects. That answers also my question on how to create more correctly animated buildings. In the meantime I guess we can only use dynamic object scripts if we want animated buildings and by some trick keep them "Glued" to the ground in their starting position, despite their collision boxes interact with the environment creating some problem in case of a building which should not move in any way even if the kitchen sink is thrown at it.  I am working on animating a building created by revolver. Thanks also for "forwarning" me about possible issues that might arise in the future by using in-game-camera to activate animated objects from a distance. I guess another way could be by using some global variables, which the interacting objects could both access. Andfly told me that I could create an array of such global variables by writing a dll plugin but that's beyond my present skills. If there were a ready made one to use I could try to use it maybe. About the object seeing who approaches it I don't know. It was not my aim as for the moment there can be only one "player" in outerra. 
« Last Edit: April 05, 2019, 05:09:52 pm by fly77 »
Logged

fly77

  • Hero Member
  • *****
  • Posts: 606
Re: outerra ufo script
« Reply #8 on: April 06, 2019, 11:59:49 am »

Ah I found I can "attach" the in-game-camera to my "wanderer" animated character (using vehicle script) by using the code below. In this way I can use $igc.pos() in the target object's scripts to determine wether my wanderer is near enough to trigger any animation. Then I encode some keyboard controlled "action info" in my character's script ..(by the way I could also encode some "identity info" of the character so that the target object recognizes who is aproaching it) using the last digits of  weather parameters through  $environment.set_weather_params(weather) and then retrieve this info inside the target object's script by  $environment.get_weather_params() decoding the last digits.

The only problem is that I don't know at the moment how to "detach" the in-game camera from the character and return it back to normal mouse controlled ufo mode once I exit the character - as the camera remains controlled by the character's vehicle script. Would be useful if I want to transfer the control of the in-game camera from one vehicle to another vehicle.

Code: [Select]

function init_vehicle(){
...
   $igc = this.$query_interface("ot::js::igc.get");
}


function update_frame(dt, engine, brake, steering)
{
...
$igc.set_pos( this.geom.get_pos(), this.geom.get_rot());
}

« Last Edit: April 06, 2019, 01:57:19 pm by fly77 »
Logged

fly77

  • Hero Member
  • *****
  • Posts: 606
Re: outerra ufo script
« Reply #9 on: April 06, 2019, 01:53:55 pm »

Again me..actually now I found how to return back the control of in-game-camera from vehicle script to outerra ufo-mode: The solution was so simple that I didn't think of it : do not assign igc to the vehicle when camera is in Free Camera Mode (ufo.mode). Sometimes asking a question helps by itself in finding the answer  ;)

Code: [Select]
if (this.get_camera_mode() !=256){ 
 $igc.set_pos( this.geom.get_pos(), this.geom.get_rot());
}
Logged