Home   Help Search Login Register  

Author Topic: Activating game logic in a script  (Read 1892 times)

0 Members and 1 Guest are viewing this topic.

Offline Thomas G Vorm

  • Members
  • *
Activating game logic in a script
« on: 29 Jul 2007, 01:21:09 »
I'm trying to get a shot looking at the sky while rain clouds pour in. I have NIM Dynamic Weather, which is awesome, and I'm trying to activate it by a script.

I place the game logic on the map and under condition of presence I put 'clouds'.

then in the script, when I am ready for the clouds I write 'clouds=true', but in the cutscene nothing happens.

Can this be done? and if so, what am I missing?

Python1

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Activating game logic in a script
« Reply #1 on: 29 Jul 2007, 01:30:52 »
Sorry, no idea what NIM Dynamic Weather is/do.

Offline Thomas G Vorm

  • Members
  • *
Re: Activating game logic in a script
« Reply #2 on: 29 Jul 2007, 03:32:29 »
It's an addon here that let's you add weather to your mission (better than default weather that is). You can have blizzards, sandstorms, lightning etc, it makes your missions have an ambiance that is really nice. You place it as a unit, type game logic, and class is the type of weather you want. I'm placing it, but I do not want it to be present from the get go, I want it to trigger through the script of my cutscene as the post above describes. Any ideas?

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Activating game logic in a script
« Reply #3 on: 29 Jul 2007, 04:53:35 »
Are you creating the gamelogic with the correct class there?

Offline Thomas G Vorm

  • Members
  • *
Re: Activating game logic in a script
« Reply #4 on: 29 Jul 2007, 05:52:33 »
Roger,
 

Side-Game Logic
Class-NIM Forcasted weather
Unit-Clouds & Weather

Placing this will give me cloudy weather, which is what I want. However, if at all possible I would like to make it so that the cutscene starts with some clouds, then trigger NIM and put in some heavy-it's about to rain-clouds, with setacctime so you get that gloomy 'oh a storm is commin' kind of feeling. I just can't figure out how to activate it with a trigger is all.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Activating game logic in a script
« Reply #5 on: 29 Jul 2007, 09:53:56 »
Ah, I thought you were already creating that with the trigger:

weatherlogic = "classofthelogichere" createVehicle [0,0,0];

to find out the internal class name, put one of these logics in the map, name it "test" give it a single waypoint with a wait time of 2 secs and on the activation field put: hint format["type: %1", typeOf test]

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Activating game logic in a script
« Reply #6 on: 29 Jul 2007, 11:24:20 »
If you read the readme of NIM weather, I think it gives some pretty good pointers on how to time the weather with script calls and whatnot. Although I guess you need to unPBO the addon to get to the readme  ::) For ease of use, I've attached it to this post. Mandoble's suggestion also works, obviously.

Here's the relevant blurb:

Quote
3.F) # Forecasted Weather
====================

Version 1.5 enables to forecast weather. This is a bit complex method
done with additional command usually in init.sqs script.

To enable forecasted weather you need the appropriate logic from
NIM Forecasted Weather. For snow, you need the snow logic and so on.
You also need to add a line in init.sqs file (any initialization field
works also, so does triggers and waypoints for use in certain event).

The basic format for the code line is following:

[[<type1>,<time1>],[<type2>,<time2>]] exec "\NIM_Weather\NIM_Forecast<effect>.sqs"

<type1> and <type2> are either type definitions or density definitions. If you
use clouds and general weather, they are numbers from 0 to 4, 0 being clear and 4
being thunder. In snow and fog the type is number from 0 to 5 meaning the density
of effect (0 being no fog). <time1> and <time2> are the time in minutes since the
mission start for the desired effect to take place. <effect> is the effect you want
to use. Options are "Clouds", "Fog" and "Snow"

As example, if you want to change weather in 10 minutes to thunder and after 30 minutes
to clear again, you do following actions:

1) place forecast logic (NIM Forecasted Weather -> Clouds & Weather)
2) add following codeline in init.sqs file or in any initialization field:
[[4,10],[0,30]] exec "\NIM_Weather\NIM_ForecastClouds.sqs"

Nothing more is needed. Unlimited amount of changes in supported.

Hope that helps!

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Thomas G Vorm

  • Members
  • *
SOLVEDRe: Activating game logic in a script
« Reply #7 on: 30 Jul 2007, 16:57:53 »
Sorry guys, I was away for the weekend.

Mandoble/Wolfrug thanks so much for your help, it looks great and that wraps up everything I need. Thanks

Python1