Home   Help Search Login Register  

Author Topic: CTI_SectorLink Help  (Read 9056 times)

0 Members and 1 Guest are viewing this topic.

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: CTI_SectorLink Help
« Reply #45 on: 01 Oct 2008, 18:09:06 »
As i said before: Spooner rocks! *headbanging*

As a sidenote to the smoker.sqf changes given by Spooner:
As in the script there's no use for _weapon, _muzzle and _mode, these lines can be left out completely:
Code: ((smoker.sqf (extract))) [Select]
_unit = _this select 0;
_roundClass = _this select 4;
if (roundClass  == "SmokeShell") then

It doesn't mess up anything if it's there and surely if you start a script it's good to have all properly written down but i guess at the end, eliminating lines that aren't for any use keeps the scripts as short as possible.


@Spooner
Gimme more of this headbanging sound, mate.  :clap: :good:

Offline USM-CPT.Dyson

  • Members
  • *
Re: CTI_SectorLink Help
« Reply #46 on: 01 Oct 2008, 22:03:14 »
I musta done something wrong when changing the script how you set it Spooner. It doesn't work :(
CTI SectorLink
Version: Beta 7
http://hosted.filefront.com/Spyder001/

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: CTI_SectorLink Help
« Reply #47 on: 01 Oct 2008, 23:48:20 »
Hmmm....at one "roundclass" there's a missing underline.

Code: [Select]
_unit = _this select 0;
_roundClass = _this select 4;
if (_roundClass  == "SmokeShell") then
As you say "It doesn't work" maybe this solves the problem. Else try to be more descriptive. A way to see if a script at least runs, adding hints here and there (best inside if then statements) can track if the script runs and if it runs correct way.

I use most often
Code: [Select]
hint "duh";
if it's only to see if it reaches certain positions. Using
Code: [Select]
hint format ["%1", _a_variable_you_need_to_check];
often helps to check if certain variables have the value they supposed to have there.

Offline USM-CPT.Dyson

  • Members
  • *
Re: CTI_SectorLink Help
« Reply #48 on: 01 Oct 2008, 23:56:44 »
Yeah Im sorry I sound like an idiot "Derr, it does not wurk"...

Lol, okay so I added the _ before round class. Works great, except the smoke from the regular grenade deploys before being deleted. Also, my particle effects don't start. Ill try adding in hints.
CTI SectorLink
Version: Beta 7
http://hosted.filefront.com/Spyder001/

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: CTI_SectorLink Help
« Reply #49 on: 02 Oct 2008, 01:07:39 »
Here is a shortcut from using format, which can be a bit fiddly:
Code: [Select]
hint str [_a_variable_you_need_to_check, _othervalue, andAnother];

Yeah, sorry, when you accept code fragments, you have to assume I can't type properly and I haven't tested it ;P There were several other problems with the script though, which is why it still won't work; I was just pushing you in the right direction, not doing it all for you.

However, something I did double-check is that the speed of a grenade doesn't always go below 0.1mps, so 0.5mps seems like a better minimum speed:
Code: [Select]
waitUntil { ((velocity _shell) distance [0, 0, 0]) < 0.5 };

EDIT: OK, I relented!

Code: (smoke_init.sqf) [Select]
// Run this from init.sqf with:
//   [] execVM "smoke_init.sqf"

if (isServer && (isNull player)) exitWith {}; // Don't run anything on dedicated server

// Precompile functions.
glt_smoker = compile preprocessFileLineNumbers "smoker.sqf";
glt_smoker_updater = compile preprocessFileLineNumbers "smoker_updater.sqf";

// Wait until dedicated clients have spawned the player object.
waitUntil { alive player };

// Do something every time the local player fires.
player addEventHandler ["FIRED", glt_smoker];

// Be informed every time a non-local player throws smoke.
"glt_smoker_position" addPublicVariableEventHandler
{
(_this select 1) spawn glt_smoker_updater;
};

Code: (smoker.sqf) [Select]
_unit = _this select 0;
_ammoClass = _this select 4;

if (_ammoClass == "SmokeShell") then
{
_shell = nearestObject [_unit, _ammoClass];

[_shell] spawn
{
_shell = _this select 0;

// Wait until the grenade comes to a standstill.
waitUntil { ((velocity _shell) distance [0, 0, 0]) < 0.5 };

// Tell all other machines to show smoke.
glt_smoker_position = [getPos _shell];
publicVariable "glt_smoker_position";

// Show smoke on the local machine.
glt_smoker_position spawn glt_smoker_updater;

deleteVehicle _shell;
};
};

Not sure what smoke effect you were trying to achieve, but there were several problems with the stuff you were trying to do. At least here you can move from something that does work:
Code: (smoker_updater.sqf) [Select]
_pos = _this select 0;

_particleSource = "#ParticleSource" createVehicleLocal _pos;
_particleSource setParticleRandom [0, [1, 1, 0], [0.54, 0.54, 0], 0, 0.25, [0, 0, 0, 0.2], 0, 0];

_logic = "Logic" createVehicleLocal _pos;
_logic setPos _pos;

_particleSource setParticleParams [
["\Ca\Data\ParticleEffects\FireAndSmokeAnim\SmokeAnim.p3d", 8, 5, 8],
"", "Billboard", 1000, 15, [0, 0, 0], [0, 0, 0], 1, 12.75, 10, 2, [2, 4, 7],
[[0.9, 0.9, 0.9, 0.4], [0.9, 0.9, 0.9, 0.2], [0.8, 0.8, 0.8, 0.1]],
[0.5, 0.5, 0.5], 0, 0, "", "", _logic];
_particleSource setDropInterval 0.08;

// Keep the particles flowing for a while, but stop them after 60 seconds.
sleep 60;

deleteVehicle _particleSource;
deleteVehicle _logic;

NOTE: Tested in SP only, since I'm not currently using a PC that could run 2 clients without falling in a heap ;P Reasonably sure it would be fine in MP though (but I could be wrong).

EDIT: [] should have been ()...sorry
« Last Edit: 20 Oct 2008, 19:22:27 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: CTI_SectorLink Help
« Reply #50 on: 02 Oct 2008, 02:09:18 »
Quote
Yeah Im sorry I sound like an idiot "Derr, it does not wurk"...
Sorry, didn't want to name you an idiot. Just trying to get as much info as possible to see where it hangs, thats all.
You see the smoke from the real smokeshell sometimes because in Spooners version the timecheck is removed. I've added it exactly because of this behaviour. Smokeshells start to smoke (not only on the water) 2 seconds after being thrown. Sometimes the shell bumps a few time off the ground so it takes more than 2 seconds before it comes to a rest. And thats why you sometimes see the smoke from the shell.
Maybe for this case, implementing the old code in this part is best workaround, although still not perfect. Basically it started your smoke if a). the smokeshell came to a rest or b). after 2 seconds, whatever happened first.
This is a bit of downgrade in realism as the smokeshell won't bump off as much as "untouched". So it's kinda less accurate. It's up to you what you prefer: downgrade in accuracy (but i guess this isn't the major point with smokeshells) or bits of "original smoke" as the smokeshell is still humping around.

I'm off now, looking for my Deep Purple CD...somehow i want to listen to "Smoke on the water" really hard.

Offline USM-CPT.Dyson

  • Members
  • *
Re: CTI_SectorLink Help
« Reply #51 on: 02 Oct 2008, 03:03:50 »
Thanks Spooner holy crap your my hero! Yeah the effect I created before looked pretty good from a distance. But, it appears that when you zoom in you can see through a lot of the random smoke. So what you saw was the very 1st smoke effect I created. The newest one is much better. I basically just added a East to West wind and lengthened the lifetime. Thus creating a really realistic and obstructing smoke effect. Like I said those a few problems:

- Zooming with with binoculars is even worse (you see none of the random smoke effects)
- If your in the smoke, just like BIS smoke grenades, you can see see through really well in some instances.

I did a pretty good job with what I have no. The only solution I can think of is adding a "white" effect to players near the smoke. Any suggestions guys?

As far as the script I'll get some guys to MP test tomorrow. But yes the smoke shell will deploy BIS smoke for ~ .5 seconds. So should some variables be tweaked?

Edit: Holy crap using
Code: [Select]
["\Ca\Data\ParticleEffects\FireAndSmokeAnim\SmokeAnim.p3d", 8, 5, 8] made it look way better thanks spooner. Also blocks view MUCH better/ :clap:



Edit 2: Okay last revision lol. I added more to "Alpha". When doing this I need to be careful, to much makes it look really blotchy. Also, Spooner and Myke you guys are awesome. That you so much for helping me I really do appreciate it guys (and Myke you do rock).
« Last Edit: 02 Oct 2008, 04:14:05 by USM-CPT.Dyson »
CTI SectorLink
Version: Beta 7
http://hosted.filefront.com/Spyder001/

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: CTI_SectorLink Help
« Reply #52 on: 03 Oct 2008, 00:20:02 »
You really don't want to add any drift to the smoke, since it might not coincide with the actual wind direction in the game. I increased the rubbing (a bad translation of "friction") factor of the particles to make them travel sideways, being pushed by the ArmA wind. Your original particles had very low rubbing, so they were not affected by the wind to any degree.

Yes, Myke, I saw that you had the 2s limit for smoke generation, but I removed it because I think it is better to get a second of "wrong" smoke while the grenade is flying or bouncing, than having the "right" smoke appear mid-air when the grenade is still flying or bouncing. Well, Dyson can decide which is a bigger problem.

As far as seeing through smoke, I think it is intentional decision by BIS. If you are looking through at any distance  smoke you can't see too well, but if you are close to it or inside it then it is barely visible. That is a fundamental trait of using BIS particles, not easily fixable.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline USM-CPT.Dyson

  • Members
  • *
Re: CTI_SectorLink Help
« Reply #53 on: 03 Oct 2008, 18:37:49 »
I will stick with Spooner's method. That little bit of BIS smoke is fine plus you get more range with your throw. Thanks guys, again, I really appreciate it. Heh, now I need to get back on the main topic of this CTI which is the objectives. I REALLY REALLY want to use mando power. But, sorry mando I read your PM like 100 times, I still can not figure it out.

You said use:

[tr_1, script follows here];
[tr_2, script follows here];

You said that tr_2 would override tr_1. But will that allow me to walk into tr_1, and register me there so I can capture the objective. Then, can I walk into tr_2 and take that objective. I need to get that part so I can get all the objectives placed all around the map and just registering that any BLUFOR or OPFOR are in the zone.
« Last Edit: 20 Oct 2008, 19:24:37 by USM-CPT.Dyson »
CTI SectorLink
Version: Beta 7
http://hosted.filefront.com/Spyder001/