Outerra forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Download Outerra Tech Demo. Unofficial Outerra Discord server, MicroProse Discord server for OWS.

Pages: 1 [2]

Author Topic: [Released] Aliens Not Waterfalls  (Read 22238 times)

PytonPago

  • Hero Member
  • *****
  • Posts: 2284
  • It´s way too complex, dont let me try to explain !
Re: [Released] Aliens Not Waterfalls
« Reply #15 on: February 10, 2014, 01:57:34 pm »

obviously i am very new here  so i might have missed ability to set velocity and create vehicle /object via .js or maybe global variables from an objects .js can be applied to another object that would be dream stuff at this early stage

JSBSim uses shared values ...maybe there is a way ... but for wheels would be better, if one would be pawn there instead as a separate object to manipulate whyte it outside the main model - doe, deformation of the "Mafia I" style seems to be an possibility this way ... ??? Interesting indeed ...
Logged
We are still undeveloped as long as we don´t realize, that all our science is still descriptive, and than beyond that description lies a whole new world we just haven´t even started to fully understand.

PytonPago

  • Hero Member
  • *****
  • Posts: 2284
  • It´s way too complex, dont let me try to explain !
Re: [Released] Aliens Not Waterfalls
« Reply #16 on: February 24, 2014, 05:37:13 am »

Played a day around whyte counters and i have to say, it was a little weird to me finding out a little thing about it. FPS based counters are a pain for obvious reasons, so i tried to a classic time dependent function. As for the little SoundTestCar clock i used its time aspect:

Code: [Select]
    // clock
    var time = new Date();
    var hourrad = time.getHours() * HOURS2RAD;
    var minsrad = time.getMinutes() * MIN2RAD;
    var secsrad = time.getSeconds() * SEC2RAD;
    var hour = time.getHours();
    var mins = time.getMinutes();
    var secs = time.getSeconds();

    var vmin
    var SecTime
     
    vmin = 0
 
   //Fuel system script
 
   if (this.started) {  // Start counting when engine is on
     
     var secsEl = secs
     
    if ( secsEl = 59 ) {
       vmin = ( vmin + 1 )
      }
     
     SecTime = ( secs + ( vmin * 60 ) );
     
     ElSec = ( SecTime )
     
     secsS = ( 0 + ElSec );
     
     NeutralConsum = ( secsS * ( ( ( 1 / 300 ) ))) // * 35 ) / 360 ) );  // Consumption on neutral ( IDEAL consumption is about 35 l/h )
       
     IdealConsum = ( NeutralConsum * 1.2 );
       
     Fuel = ( FuelInitial - IdealConsum );       // Actual fuel load ( remember Ural has 300 l and needle rotation 1 !! )
     
     if ( Fuel < 0.034 ) {
         secsS = 0;
         Fuel = 0;
     }
     
    //Fuel needle
    this.geom.rotate_joint_orig(this.fuelmeter, Fuel, {x:0, y:1, z:0});
  }
 
  //End of fuel system script

 ... yes, i know the seconds correspond to the actual system state (so it wont go from zero up, but from actual time seconds and only to 59, periodically - so dont mind that little fact right now in there). My test was doe in other thing - wanted to use the vmin variable to change every time, the seconds hit 59 so i do an imaginary minute counter, doe it seems it just increasing the value once and only for the 59-th second. All this script is in the FPS part script ( function update_frame(dt, engine, brake, steering) ). Is it because the " vmin = 0" being there too, setting it allways to 0 again for every frame coming afterwards ? (that is, should i put it somewhere like the once for vehicle instance section, or have the whole thing rather in  function action(k,v,dt) section ?) Yes, i should probably use an "else" addition to the "if" too and in a little more thought order.

Also the puzzling part for me is time definition in java - There isnt a way to simply define a second time-frame, and you have to find a way to calculate a second (minute, hour etc.) trough actual time differences or make a counter like - ActualTime(in seconds) - SomeInitialTime(in seconds). Now you can set the actual time, but i cant find a way to take an "instant time" (just the static time of something happening - like engine start) to add it to that thing. Seen somewhere a way of "profiling" times in an pause-able counter (liked to use that for the engine-code to stop it every-time you turn off the engine and make some RPM and Gear dependent consumption functions there), doe some of the methods ("Calendar.", "long" etc) werent recognized. Im not sure if there has to be an other approach like the "Timer" discussed on the end here :
http://java.ittoolbox.com/groups/technical-functional/java-l/java-code-a-counter-which-increments-by-1-every-second-2675231 - where it seems i would have to add that to some folder in OT and load it at begining of the script just like Aircraft-scripts have it - if im not wrong.

Small time-chunks can be done whyte the clock-data too, but for something time-consuming as fuel consumption calculator its a little too short or odd ways done (just like a "freeze" type counter approach would need to have the freeze-milisecond sequence postponed the proces and waiting 120 secs to have enough counter-time for the script i need is something rather odd).

Im stagged that there isnt something like a real simple time-definition. Doe, i also got an other approach idea - maybe i could use the OT time and date data - just need a way to get actual time (just like the clock up posted there ) and a fixed time in specific moment. This approach would be maybe more interesting, as the vehicle stuff could be synched to the OT time-flow and simulations in slower or faster time-flow as the real world could be done just by simple movement of the multiplier bar in the environment options. (would be also perfect to check if the consumption-calculations in script are consistent whyte reality easily too) Is there a wiki-page or a way to get those time-data from the engine ? (think it will be needed to mark specific in-Engine time-events for folks too - i might missed a talk about that or being just blind and scripting under-knowledged again)
« Last Edit: February 24, 2014, 05:45:36 am by PytonPago »
Logged
We are still undeveloped as long as we don´t realize, that all our science is still descriptive, and than beyond that description lies a whole new world we just haven´t even started to fully understand.

DeanosBeano

  • Full Member
  • ***
  • Posts: 106
  • newbie
Re: [Released] Aliens Not Waterfalls
« Reply #17 on: February 24, 2014, 11:21:15 am »


 Hi
  Great you looed at this :) , i did some experiments myself before the last patch and things and will go back to it now its stable , for me  i am new to java and learning how much Java this .JS recognises , is it limited  to only certain commands or full on Java ? i guess its limited  , i tried som loops with pauses and believe i got something  but then i lost thta .js with a sill reload press qand it overwritten .

 for time  its strange there is no counter  but  i guess we can creat something in the per frame section , i was thinking of a system on another game i mod with but we need timenow at least for consistency

 i am just testing Ship entity first then i have toyed with all enity :) , Can a killer whale ( Orca) be a ship ? hmm interesting to find out  lol
Logged

PytonPago

  • Hero Member
  • *****
  • Posts: 2284
  • It´s way too complex, dont let me try to explain !
Re: [Released] Aliens Not Waterfalls
« Reply #18 on: February 24, 2014, 04:04:30 pm »


 Hi
  Great you looed at this :) , i did some experiments myself before the last patch and things and will go back to it now its stable , for me  i am new to java and learning how much Java this .JS recognises , is it limited  to only certain commands or full on Java ? i guess its limited  , i tried som loops with pauses and believe i got something  but then i lost thta .js with a sill reload press qand it overwritten .

 for time  its strange there is no counter  but  i guess we can creat something in the per frame section , i was thinking of a system on another game i mod with but we need timenow at least for consistency

 i am just testing Ship entity first then i have toyed with all enity :) , Can a killer whale ( Orca) be a ship ? hmm interesting to find out  lol

I think its full on java, but certain modules (actually APIs - http://docs.oracle.com/javase/7/docs/api/) must be loaded (there are different java modules for specific actions and you need to let OT know to load them for the vehicle/object instance) to use their specific scripts - aircraft scripts are a good example. But im not sure witch there are present at OTs base-files now, where they should be put to be used if needed one. (maybe thats why some of the counter approaches i tried didnt work)

Heh, im new there in waters too, but i would like to pimp my vehicles to a nice level. It pushes me somehow. :D Doe, it takes me sometimes to get the point of certain things ... as for ships, would be interesting to try making the vehicle weight a variable to make Submarines work properly. I think the script could handle submersion if weight is proper to the "lift" space of it. The force-function could be used too for some fancy underwater movement.
« Last Edit: February 24, 2014, 04:11:58 pm by PytonPago »
Logged
We are still undeveloped as long as we don´t realize, that all our science is still descriptive, and than beyond that description lies a whole new world we just haven´t even started to fully understand.

giucam

  • Full Member
  • ***
  • Posts: 171
  • It's an ugly pile of bones... like me.
Re: [Released] Aliens Not Waterfalls
« Reply #19 on: February 24, 2014, 04:52:51 pm »

javascript has nothing to do with Java, it is an entirely different language with an unfortunate name. If you need some documentations on it look at http://www.w3schools.com/js/default.asp
Logged
ResidualVM 0.1.1 is OUT! www.residualvm.org

DeanosBeano

  • Full Member
  • ***
  • Posts: 106
  • newbie
Re: [Released] Aliens Not Waterfalls
« Reply #20 on: February 24, 2014, 05:37:03 pm »


Hi
 thats the very site i was learnign from :)
 I though Java because of the terminology was simular but thanks for the headsup .
 I have a back ground of programming these at school


http://upload.wikimedia.org/wikipedia/commons/8/8a/BBC_Micro_left.jpeg

Machine code in Commodore 64  in 1985 -6 haha  so steep learning code for me.

 
Logged

PytonPago

  • Hero Member
  • *****
  • Posts: 2284
  • It´s way too complex, dont let me try to explain !
Re: [Released] Aliens Not Waterfalls
« Reply #21 on: February 24, 2014, 05:55:01 pm »

 ... thanks! Will have to clear my head from some macaroni stuff there ...
Logged
We are still undeveloped as long as we don´t realize, that all our science is still descriptive, and than beyond that description lies a whole new world we just haven´t even started to fully understand.

Pages: 1 [2]