Home   Help Search Login Register  

Author Topic: In-Game Trigger Creating  (Read 757 times)

0 Members and 1 Guest are viewing this topic.

Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
In-Game Trigger Creating
« on: 18 Apr 2003, 18:53:13 »
Hi everyone.
Can we create a trigger from a script ?
Something like :
_mytrigger="Emptydetector" CreateUnit [getpos _myobject,_whatevergroup,"blabla"]
What interests me is to define the different fields in the "blabla" section (detected by, axis a, axis b, condition, on activation...). Is that possible ?
« Last Edit: 18 Apr 2003, 18:53:39 by Igor Drukov »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:In-Game Trigger Creating
« Reply #1 on: 18 Apr 2003, 21:05:08 »
I don't know.

But, as a workaround, you can have a bunch of triggers hidden in the corner of the map over the sea and move them to the relevant place as they are needed.
Plenty of reviewed ArmA missions for you to play

Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
Re:In-Game Trigger Creating
« Reply #2 on: 18 Apr 2003, 21:22:35 »
Yeah, I know, but I'm working on an arty script that sets buildings on fire, and it all works fine, but I wanted those fires to burn for real. As the number of buildings depends on the number of shells fired and on the definable percentage of chances for those shells to inflame the buildings, and as I can see no other way to simulate real fires than with a burn script and an anybody trigger, the number of triggers is virtually unlimited.
Can someone come up with a suggestion ? (and thank you anyway, macguba)

Offline Dinger

  • Contributing Member
  • **
  • where's the ultra-theoretical mega-scripting forum
Re:In-Game Trigger Creating
« Reply #3 on: 19 Apr 2003, 06:54:01 »
could you use NearestBuilding to find the nearest building to the shell?

you know, track the shell down, and use its last known location before detonation, grab that and do a:

_mygamelogic setpos [_lastshellpos select 0, _lastshellpos select 1, 0]
_building = nearestbuilding getpos _mygamelogic
?_mygamelogic distance _building < 10:goto "rolldiceinflame"
exit
#rolldiceinflame
?random 10 < 2:[_building] exec "torch.sqs"
Dinger/Cfit

Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
Re:In-Game Trigger Creating
« Reply #4 on: 19 Apr 2003, 12:02:07 »
Actually, nearesbuilding is exactly the command that I've used, and same for the creation of a gamelogic : to make it short, the arty script sometimes calls another script to set buildings on fire, the parameter of which simply being [_pos], where _pos designates the position where the shell has exploded.
Then, this script goes like this :
_pos=_this select 0
_lifeTime = random 120
_delay = 0.3
_lifeTicks = _lifeTime / _delay
_lifeTick = _lifeTicks
_invisible="logic" camcreate _pos
_building=nearestbuilding _invisible
_x=getpos _building select 0
_y=getpos _building select 1
_z=getpos _building select 2
_feu="fire" camcreate [_x,_y,_z-0.5] (I like this idea of creating a fire because you've got the sound too... ;))
_feu inflame true
#Begin
?(random _lifeTicks) < _lifeTick : drop ["cl_fire", "", "Billboard", 1, random 5, getpos _building, [ random 1, random 1, 1 + random 1], 1, 0.005, 0.0042, 0.2, [random 0.05], [[1,1,1,1],[0,0,0,0]], [0,1,0], 0.5, 0.5, "", "", ""] (that's for spark creation, everybody should check cutscene x10WhenFightEnds.Noe in the resistance campaign  8))
drop ["cl_basic", "", "Billboard", 1, 10, getpos _building, [0,0,1], 1, 0.005, 0.0042, 0.5, [0.2,10], [[0,0,0,0], [0.3,0.3,0.3,1 * _lifeTick/_lifeTicks], [0.8,0.8,0.8,0.1 * _lifeTick/_lifeTicks], [0.8,0.8,0.8,0]], [0,1,0,1,0,1], 0.2, 0.2, "", "", ""]
drop ["cl_fire", "", "Billboard", 1, 1.5, getpos _building, [random 0.3, random 0.3, random 0.3], 1, 0.004, 0.004, 0.1, [5*(0.1 + 0.2 * _lifeTick/_lifeTicks), 5*(0.1 + 0.5 * _lifeTick/_lifeTicks), 5*(0.1 + 0.1 * _lifeTick/_lifeTicks)], [[1,1,1,0], [1,1,1,1], [1,1,1,0.6], [1,1,1,0]], [0,1,0], 0.5, 0.05, "", "", ""]
~_delay
_lifeTick = _lifeTick - 1
?_lifeTick > 0 : goto "Begin"
?_lifeTick<=0:_feu inflame false;deletevehicle _feu;exit

Now, my problem is that I want those fires to BURN (i.e setdammage ! ???) FOR REAL.
And I thought that creating triggers with axis a=5, axis b= 5, activated by "anybody present" and activating a "classic" burn script would be cool.
Still racking my brains...
 :o ???
« Last Edit: 19 Apr 2003, 12:12:57 by Igor Drukov »

Bremmer

  • Guest
Re:In-Game Trigger Creating
« Reply #5 on: 19 Apr 2003, 12:18:41 »
I don't think you can create trigger from scratch unfortunately.

A possible work around would be to run a third script that checks all units on the map against a list of buildings on fire. You would need to generate the unit list at the start of the mission using a large anybody present trigger, the array of burning buildings (or just their positions) would be built by your fire script. The new script would cycle through all units and check if the are within a certain distance of any burning building and increment their damage accordingly.

No perfect I agree, but a potential solution.

Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
Re:In-Game Trigger Creating
« Reply #6 on: 19 Apr 2003, 12:30:11 »
Aaaargh, that's a lot of work ahead again (I mean, I'm only me), but geee your solution sounds good.
My problem then will be : how to create an array (which is something limited, isn't it ?) of things which are potentially unlimited ? Or I guess I will have to limit the number of inflamed buildings... :-[
Well, this is reasonable anyway,  :) because of the lag too many "drop" commands might create.
Ok, thanks Bremmer, I'll try your way, and if it works, I'll mark the thread as solved.