Home   Help Search Login Register  

Author Topic: Smoke trigger that loops continiously.  (Read 5270 times)

0 Members and 1 Guest are viewing this topic.

Offline Brandon

  • Members
  • *
Smoke trigger that loops continiously.
« on: 16 Jul 2009, 18:45:28 »
I'm trying to make a mission in which theres a landing pad that has smoke continuously going off signaling the person where to go. The color doesn't really matter.

I've looked at some missions but couldn't figure it out.. :(

Offline DMarkwick

  • Contributing Member
  • **
  • I'm a llama!
Re: Smoke trigger that loops continiously.
« Reply #1 on: 16 Jul 2009, 19:11:47 »
Something along the lines of:

while {true} do
{
   drop [parameters here];
   sleep 0.2;
};

The drop command being documented here:
http://community.bistudio.com/wiki/drop

and here:
http://community.bistudio.com/wiki/ParticleArray

Offline Brandon

  • Members
  • *
Re: Smoke trigger that loops continiously.
« Reply #2 on: 16 Jul 2009, 19:23:25 »
Alright thanks. I'll try and learn what all that stuff means.  :P

Do I put that stuff in the unit itself? Or do I need to do some kind of scripting thing?
« Last Edit: 16 Jul 2009, 19:25:58 by Brandon »

Offline DMarkwick

  • Contributing Member
  • **
  • I'm a llama!
Re: Smoke trigger that loops continiously.
« Reply #3 on: 16 Jul 2009, 19:47:47 »
The unit? If you mean the landing pad, then in it's init line you'll call a script:
Code: [Select]
nul = [this] execVM "LandingPadSmoke.sqf";
"this" is the reference to the landing pad, and you can use this to get the position of the landing pad in the LandingPadSmoke.sqf like this:

Code: [Select]
_thisLandingPad = _this select 0;
_ThisSmokePlace = getPos _thisLandingPad;

while {true} do
{
   drop [parameters here];
   sleep 0.2;
};

One of the parameters in the drop command is the coordinates for the particle to spawn, for which you'll use _thisSmokePlace instead of a positional array.

Offline Brandon

  • Members
  • *
Re: Smoke trigger that loops continiously.
« Reply #4 on: 17 Jul 2009, 15:50:10 »
Yea I have no idea what:
1. "nul" is.
2. "execVM is.
3. getPos is
4. parameters are.
5. sleep is.
6. drop command, assuming drop a smoke grenade...?
7. "particle to spawn", thought it was a smoke grenade?
8. "Positional Array", I dropped out of a programming class when we started arrays, so yea... if this game requires some advanced programming knowledge - I don't know why everyone encourages this editor as some easy thing to eventually get a knack for. This was just a bloody smoke grenade, not launching a rocket into space.

Those Wiki articles make no sense ether, they use the same... complicated terminology. There used to be hundreds of tutorials in a real long nice list on this website that had example scripts that were usable for reference that could be used to learn this editor... but I guess they were all taken down for some dumb reason.

Thanks for your time. I'm not going to be touching this editor anymore... its too damned complicated... The script wasn't that important anyway.
« Last Edit: 17 Jul 2009, 16:00:13 by Brandon »

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Smoke trigger that loops continiously.
« Reply #5 on: 17 Jul 2009, 16:17:50 »
Learning at OFPEC is not a one-way street. Although we can help you with things to an extent, we assume that you are prepared to make some efforts yourself. If you see a reference to a command that you don't understand, it is expected that you are able to at least look it up in the COMREF. If you don't understand the description, then that is another matter that you can bring up, but if you can't even make that effort, please do not expect the people to go out of their way to help you.

Many things which seem complex to the beginner are actually very simple and many things that appear simple are in fact very complex. This is always going to happen when you really know nothing about a subject. You are asking so we can guide you. What DMarkwick is suggesting is a continual smoke-generator, rather than a just using a smoke grenade, which will, as you've realised, run out of smoke after about 30 seconds.

The tutorials are still there. Telling us that we are dumb is probably not the best way to convince us to direct you to the correct page.

Quote from: Brandon
I dropped out of a programming class when we started arrays, so yea... if this game requires some advanced programming knowledge
You don't need any programming knowledge to use the in-game editor and create a great deal of things. Many people spend years in the editor making great missions without ever writing more than a line or two of code. However, by using scripts, you can do things the game editor was never specificall designed for. No-one needs to use scripts, but if you make the effort to learn, then the results can be quite satisfying, especially when you manage to add something to the game that even the game-developers never thought of! For your information, arrays are one of the most basic programming knowledges, not the most advanced.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re: Smoke trigger that loops continiously.
« Reply #6 on: 17 Jul 2009, 16:19:20 »
EDIT: I was still typing when Spooner posted, so most of my long rant is repetetive. But I'd go for the smoke grenade :D

Well, since you've given up I won't delve too deeply into the problem at hand. But I would simply have the looping script create a smoke grenade at the designated position. It's way easier than meddling with all the parameters required in a drop command.

Trust me Brandon: ArmA2 editing does not require any advanced knowledge at all. Take me as an example. I cannot even install a new keyboard driver on my home PC. I know where the powerswitch is located, and that's about it. But I can still make quite enjoyable missions in the ArmA2-editor with simple copy/paste techniques.

The script codes can look complicated when you see it for the first time. With a little practice the massive over dose of letters, brackets and curled bracers will eventually become understandable. And you don't have to learn to create these codes. A basic understanding of what a string of code does is perfectly adequate.

It's a little bit like the scene from the motion picture Matrix, where one of the veterans of the resistance watches a computer screen full of twinkling numbers, and tells the astonished Keanu Reaves that these figures are as clear as plain images to him. Except that ArmA2-scripting is much easier. And fun.

As a side note. Many missions does not require any scripting at all to work. Period. The Cold War Crisis campaign contained almost no scripting at all. It relied on waypoints and triggers. Cold War Crisis is still considered by many (including me) to be the most memorable gaming experience of all time. Then came Red Hammer. Again the scripting was close to non existant. The first series of official missions that really relied on scripting came with Resistance. Most of them would have been possible to create without resorting to scripts. They were often used as a way to show off: Look at the potential this game has!

Maybe it's this elitist approach to scripting that makes you feel reluctant. I know it affected me when I started to meddle with script snippets (that I copied from snypir, who wrote brilliantly simple scripts). Many mission designers use scripts as an excuse for not planning their missions in advance. If I were in your situation I would think along these lines...
... what purpose does the smoke signal really serve in my mission?
... can I achieve a similar effect by using something else as a signal?
... does this soemthing require scripting?

If so: You've found a non-scripting solution to your problem. But as I said before: scripting is fun if you approach it with an open mind and a playful heart. DMarkwick's suggestion is very good and if you ask nicely I bet someone in the forums will provide you with a premade drop-effect that looks as smoke in almost no time  ;)
« Last Edit: 17 Jul 2009, 16:23:18 by nominesine »
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Smoke trigger that loops continiously.
« Reply #7 on: 18 Jul 2009, 09:24:24 »
Since I'm so nice, I'll just give you the pre-made solution. :) This is a flare script I wrote for RUG Inventory back in the day, using a particle source I had stolen from some other mission (sadly, I don't remember where any more!). Anyway, the comments explain exactly how to use it, and it should be easy enough to edit to work indefinitely as well. I have no idea about MP compatibility etc:

Code: [Select]
//A simple use-and-drop flare script
//Creates a ground-based "flare" with the desired colour, position and duration.
//Also spawns smoke at the flare's location.
//The flare loses brightness and some smoke as time goes on, dying out slowly.
//Called : nul=[Position, [R, G, B], Number] execvm "flare.sqf";
//Position = position of the flare.
//[R, G, B] = array that determines the color of the flare/smoke in Red, Green, Blue.
//Example : [0, 1, 0] = a green flare.
//Number = number in seconds that the flare lasts.
//Will start losing potency after half this time, then 3/4ths in, then 4/4ths in before dying out (max lifetime of flare is Number + (random 10).  

_pos = _this select 0;
_color = _this select 1;
_duration = _this select 2;

_light = "#lightpoint" createVehicleLocal _pos;

_light setLightBrightness 0.05;

_light setLightAmbient _color;

_light setLightColor _color;

//_light lightAttachObject [_object, [0,0,0]];
_object = _light;

_PS = "#particlesource" createVehicleLocal _pos;


_smoke = "#particlesource" createVehicleLocal _pos;
sleep 0.1;
_smoke setParticleParams [["\Ca\Data\ParticleEffects\FireAndSmokeAnim\SmokeAnim.p3d", 8, 1, 8], "", "Billboard", 1, 10, [0, 0, -0.1], [0, 0, 0], 2, 10, 7.9, 0.066, [0.5, 1, 3], [(_color + [0.8]),(_color + [0.4]),(_color + [0.0])], [0.5], 1, 0.02, "", "", _object];
_smoke setDropInterval 0.2;

sleep (_duration / 2);
_light setLightBrightness 0.04;
_smoke setDropInterval 0.15;
sleep (_duration / 4);
_light setLightBrightness 0.03;
_smoke setDropInterval 0.12;
sleep (_duration / 4);
_light setLightBrightness 0.02;
_smoke setDropInterval 0.1;
sleep (random 10);

deleteVehicle _light;
deletevehicle _green;

In short, copy-paste the above text into a notepad document, save it as "flare.sqf" (careful so it doesn't turn into flare.sqf.txt!), put that into your mission folder (My Documents and settings/ArmA (other) Profiles/missions/yourmissionname.islandname), and then start the mission. You can now run the script in for instance a trigger or in the init field of the H-pad (for the below example, name the helipad HeliPad, will spawn a red flare which will last a lot of seconds).

Code: [Select]
nul = [position HeliPad, [1, 0, 0], 100000] execvm "flare.sqf"
If you like this solution, we can edit it to last forever as well, as you wish. :)

Good luck!

Wolfrug out.
« Last Edit: 18 Jul 2009, 09:26:15 by Wolfrug »
"When 900 years YOU reach, look as good you will not!"