Operation Flashpoint Dragon Rising OFDR Forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Better lighting

+2
TheGeneral
dewi316
6 posters

Go down

Better lighting - Page 2 Empty Re: Better lighting

Post by Guest Thu 07 Feb 2013, 15:08

Mdog wrote:something like this!

https://youtu.be/GcTuTlt_ABo

TJ actually helped out with this and has managed to refine it a bit better than the video. But this could work really well.

You have him to thank for the code, I only placed the markers on the map. Which tends to happen a lot.

MD, that looks pretty cool mate. Is there any chance of getting a look at the code you used to do it? I've found that even with my very basic knowledge of LUA, I'm able to read code and understand it. Like any language though, it's much easier to understand something than to put together your own sentences, but I'm still working on it. I know I've been quiet lately as work and family has taken priority a bit, but I've still got my campaign in mind and since it's based on a pilot's experiences, I'll be using the airfield alot. Also, if I can see the code I can try to modify it and apply it to a heli pad. Ideally, I'd like strobe lighting around a heli pad in a PB, but only visible through NVGs.
Cheers
RC
Anonymous
Guest
Guest


Back to top Go down

Better lighting - Page 2 Empty Re: Better lighting

Post by tjdagger Sat 09 Feb 2013, 23:51

Hi Rockcop,
below is an mssn file.

http://filebeam.com/9ddea646616a8d22f8a7c14399cf4d51

here is the code...
Code:
function onMissionStart()
particle_zones_sets = {
["triggerzone"] = {"runlights",100,300},
["triggerzonei1"] = {"runlightsi1",100,300},
}
particle_setID = {}
particle_table = {}
end

function onEnter(zoneName, unitName)
   if particle_zones_sets[zoneName] and OFP:isPrimaryPlayer(unitName) then
      particle_setID[OFP:activateEntitySet(particle_zones_sets[zoneName][1])] = {zoneName,particle_zones_sets[zoneName][2],particle_zones_sets[zoneName][3]}
   end
end

function onLeave(zoneName, unitName)
   if particle_zones_sets[zoneName] and OFP:isPrimaryPlayer(unitName) then
      for i,v in ipairs(particle_setID) do      
      --   OFP:displaySystemMessage(v[1])
         if v[1] == zoneName then
            OFP:destroyEntitySet(i)
            particle_table[i] = nil
         end
      end
   end
end

function runwayLights(index,set,loopcount)
   if loopcount >= 0 then
      loopcount = loopcount - 1
      OFP:displaySystemMessage("lighting "..loopcount)
      if index == #particle_table[set]then
         OFP:stopParticleSystem(particle_table[set][index])
         index = 0
      end
      indexi = index + 1
      OFP:stopParticleSystem(particle_table[set][index])
      if loopcount > 0 then
         EDX:serialTimer("runwayLights",particle_setID[set][2],indexi,set,loopcount)
         OFP:startParticleSystem(particle_table[set][indexi])
      end
   end
end

function onSpawnedReady( setName, setID, tableOfEntities, errorCode )
   if particle_setID[setID] then
      particle_table[setID] = tableOfEntities
      EDX:serialTimer("runwayLights",particle_setID[setID][2] ,0,setID,particle_setID[setID][3])
   end
end

...feel free to ask questions.


Last edited by tjdagger on Sun 10 Feb 2013, 12:52; edited 1 time in total

tjdagger
Admin

Location : Silverdale, Queensland, Australia
Points : 107
Reputation : 7
Join date : 2012-12-17
Age : 48

Back to top Go down

Better lighting - Page 2 Empty Re: Better lighting

Post by TheGeneral Sat 09 Feb 2013, 23:55

Tim I haven't posted it up because it still crashes when you re enter the zones I've been waiting to catch you on skype to tell you about it.
TheGeneral
TheGeneral
Admin

Points : 780
Reputation : 35
Join date : 2012-12-15

http://maniacaldog.wix.com/keepdralive

Back to top Go down

Better lighting - Page 2 Empty Re: Better lighting

Post by John J. Stevens Wed 13 Feb 2013, 09:46

Another note that we figured out was the player had to be looking in the direction for light effects to be seen. While this seems obvious the issue was discovered when using effects that SHOULD illuminate the surroundings around you from behind - much like lightning would.

The bigger mind bender is are shadows are being processed from the source ONLY then or always - consider a search party with flashlights in the woods or shipping warehouse.
John J. Stevens
John J. Stevens
Admin

Location : WV/PA
Points : 285
Reputation : 22
Join date : 2012-12-19

Back to top Go down

Better lighting - Page 2 Empty Re: Better lighting

Post by dewi316 Sun 17 Feb 2013, 20:22

When creating a mission can you change the time of day and if so how do you do it? I want to do a night mission:) ok sorted worked it out thanks
dewi316
dewi316
Veteran

Location : swansea
Points : 179
Reputation : 22
Join date : 2012-12-19

Back to top Go down

Better lighting - Page 2 Empty Re: Better lighting

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum