OWP: Custom Sound App

Page 2 of 2 Previous  1, 2

Go down

OWP: Custom Sound App - Page 2 Empty Re: OWP: Custom Sound App

Post by tvig0r0us on Fri 15 Mar 2019, 23:27

Hmmm.... Please post the code that you used when you attempted to set the weather.

--tvig


OWP: Custom Sound App - Page 2 Nst_tv10
tvig0r0us
tvig0r0us
Admin

Location : Nky
Points : 266
Reputation : 29
Join date : 2013-10-16

http://www.moddb.com/members/tvig0r0us

Back to top Go down

OWP: Custom Sound App - Page 2 Empty Re: OWP: Custom Sound App

Post by MGRiz on Sat 16 Mar 2019, 16:16

Here is the code :
Code:

--[[
If you have any questions feel free to contact tvig0r0us on the True OFDR Community Forums at:
http://operationflashpoint.forummotion.com/t396-official-ofdr-mission-editor-expansion#2886


onEDXInitialized is the same as onCreate() but it fires after the EDX has been initialized.  It is Recommended to use this instead
of onCreate to prevent any script from firing prior to the complete initialization of the EDX.

***** I strongly recommend registering the player entity and all playable enitites to the EDX as this will make other functions available
]]--
function onEDXInitialized()
--Place your playerteam on the map and use the functions below to register its members to the EDX.  THIS IS IMPORTANT!!!
 
 EDX:registerPlayerEchelon("echelonName",false) --change the name to the echelon name of the player's team
 -- Change false to true to remove the playable entities from the game that are not used by a human player at mission start.
 
 --You can also use the commands below to register the enitites in the player team individually.
 --EDX:registerPlayer("playerEntityName") --change the name in quotes to the name of the player entity in the editor
 --EDX:registerPlayable("playableEntityName", false) --change the name in quotes to the name of the playable entity in the editor.  If you want to remove the entity if it is not used by a coop player, change false to true.
 --Simply copy/paste the line above for all of the multiplayer playable entities you are using in your mission.
 
 --You can now add anything you want to the onEDXInitialized just as you would in the onCreate without the EDX.
end

--[[
***I strongly recommend setting all time and weather conditions using the functions provided by the EDX.
This way the EDX can keep track of and change the environment including displaying information about the time and weather.
In this script I have included all of the functions prewritten to do just that.
This should be done in the onMissionStart.
]]--
function onMissionStart()
 --By using EDX time and weather functions you give the EDX information that allows you to track the ingame time and start random weather cycles and similar items.
 EDX:setTimeOfDay(00, 00, 00) -- You can change the starting time as you desire here.  You can also comment out this line and set it in the Mission Properties tab of the editor
 --EDX:setRandomTime() --If you want a randomly generated starting time, simply comment the line above and uncomment this line.
 
 EDX:setWeatherCurrent("foggy") --You can use this line to set the starting weather type or set it in the Mission Properties tab of the editor.  Note that you can use the weather type name instead of a number with this function.
 EDX:setFogCurrent(100) --You can set the fog density here
 --EDX:setRandomWeather() --If you would like the starting weather to be randomly generated simply uncomment this line and comment the previous 2 lines.
 
 --To run a randomly changing weather sequence simply uncomment the next line.
 --EDX:randomizeWeather(30) --You can change the time in minutes between weather changes by changing the number to any number you want.
 
 --You can now add anything you want to the onMissionStart just as you would do without the EDX.
end

--The EDX is now completely configured and ready to go.  You can import modules, create your own or just code your missions from here!  Have fun!!

Specifically on weather set :

Code:
function onMissionStart()
 --By using EDX time and weather functions you give the EDX information that allows you to track the ingame time and start random weather cycles and similar items.
 EDX:setTimeOfDay(00, 00, 00) -- You can change the starting time as you desire here.  You can also comment out this line and set it in the Mission Properties tab of the editor
 --EDX:setRandomTime() --If you want a randomly generated starting time, simply comment the line above and uncomment this line.
 
 EDX:setWeatherCurrent("foggy") --You can use this line to set the starting weather type or set it in the Mission Properties tab of the editor.  Note that you can use the weather type name instead of a number with this function.
 EDX:setFogCurrent(100) --You can set the fog density here
 --EDX:setRandomWeather() --If you would like the starting weather to be randomly generated simply uncomment this line and comment the previous 2 lines.
 
 --To run a randomly changing weather sequence simply uncomment the next line.
 --EDX:randomizeWeather(30) --You can change the time in minutes between weather changes by changing the number to any number you want.
 
 --You can now add anything you want to the onMissionStart just as you would do without the EDX.
end

--The EDX is now completely configured and ready to go.  You can import modules, create your own or just code your missions from here!  Have fun!!

MGRiz

Points : 10
Reputation : 1
Join date : 2019-03-05

Back to top Go down

OWP: Custom Sound App - Page 2 Empty Re: OWP: Custom Sound App

Post by tvig0r0us on Sat 16 Mar 2019, 21:07

Do you use the templar gfx weather modification? If so, that is probably what is causing it. In my memory, foggy is a valid value to pass in setWeatherCurrent, but I'll have to look to verify that. First thing first though, remove any weather modifications you might have installed and try again. Let me know.

--tvig


OWP: Custom Sound App - Page 2 Nst_tv10
tvig0r0us
tvig0r0us
Admin

Location : Nky
Points : 266
Reputation : 29
Join date : 2013-10-16

http://www.moddb.com/members/tvig0r0us

Back to top Go down

OWP: Custom Sound App - Page 2 Empty Re: OWP: Custom Sound App

Post by MGRiz on Sun 17 Mar 2019, 02:23

No, I didn't add any weather modification. I only added EDX, OFDR mission editor upgrade, and Ultimate AI mod.

MGRiz

Points : 10
Reputation : 1
Join date : 2019-03-05

Back to top Go down

OWP: Custom Sound App - Page 2 Empty Re: OWP: Custom Sound App

Post by MGRiz on Sun 17 Mar 2019, 06:31

Hi tvig,

Sorry, I made a mistake from the very beginning. Turned out I never actually replaced the Rootscript.lua. Now after replacing it, it is working now.

Now I am trying the playOwpSound but I do not know where to put the audio file (sound folder/OWP root). Do you know where to put the wav files?

Also, I tried to use a triggerzone to trigger a command, but all I get was a debug message. I changed the debug setting to false and tried it. The debug message did not appear but the command still was not executed by the trigger. Do you know how to fix this?  

- MGRiz

MGRiz

Points : 10
Reputation : 1
Join date : 2019-03-05

Back to top Go down

OWP: Custom Sound App - Page 2 Empty Re: OWP: Custom Sound App

Post by tvig0r0us on Sun 17 Mar 2019, 12:57

What was the debug message?? What was the code??

For future reference, I can't help you if you don't show me EXACTLY what you used to produce the result. I also need to know exactly what the result was, debug messages and all.

--tvig


OWP: Custom Sound App - Page 2 Nst_tv10
tvig0r0us
tvig0r0us
Admin

Location : Nky
Points : 266
Reputation : 29
Join date : 2013-10-16

http://www.moddb.com/members/tvig0r0us

Back to top Go down

OWP: Custom Sound App - Page 2 Empty Re: OWP: Custom Sound App

Post by MGRiz on Sun 17 Mar 2019, 13:51

Code:
I am sorry, here is the code that I used :


function onEDXInitialized()

 EDX:registerPlayerEchelon("echelonName",false) --change the name to the echelon name of the player's team


end


function onMissionStart()
EDX:setTimeOfDay(00, 00, 00) -- You can change the starting time as you desire here.  You can also comment out this line and set it in the Mission Properties tab of the editor

 EDX:setWeatherCurrent("clear") --You can use this line to set the starting weather type or set it in the Mission Properties tab of the editor.  Note that you can use the weather type name instead of a number with this function.
 EDX:setFogCurrent(0) --You can set the fog density here

end


function onEnter_triggerzone_playerGroup()

OFP:showPopup("test","test")

end



Code:
function onEnter_triggerzone_playerGroup ()

I used group name for the unitName that enters the triggerzone. The debug says:

 "DEBUG [waypoints]: function onEnter on script mission"  

Nothing happened. 


After that, I tried using an unit/entity name for the unitName.
Code:
function onEnter_triggerzone_player ()

No debug message and it works.

My mission script is using groups to check units for functions and it was working before using EDX.

I apologize if I bombard you with questions and not providing the code for you to troubleshoot.

- MGRiz

MGRiz

Points : 10
Reputation : 1
Join date : 2019-03-05

Back to top Go down

OWP: Custom Sound App - Page 2 Empty Re: OWP: Custom Sound App

Post by tvig0r0us on Sun 17 Mar 2019, 21:02

One reason it doesn't work is that you have to use all lower case in the entity names you are setting the event handler for.

Code:

function onEnter_triggerzone_playerGroup()
--needs to be
function onEnter_triggerzone_playergroup()

I don't think that it would work on a group name in either case. You have to check to see whether the unit is in the group you want to check.

So your code should look something like this...
Code:

function onEnter(trigger, unit)
  if trigger == "triggerzone" and OFP:isInGroup(unit, "playerGroup") then
    --do something
  end
end

I'm not on my gaming machine or I'd put together an example.

--tvig


OWP: Custom Sound App - Page 2 Nst_tv10
tvig0r0us
tvig0r0us
Admin

Location : Nky
Points : 266
Reputation : 29
Join date : 2013-10-16

http://www.moddb.com/members/tvig0r0us

Back to top Go down

OWP: Custom Sound App - Page 2 Empty Re: OWP: Custom Sound App

Post by MGRiz on Mon 18 Mar 2019, 13:46

It worked, thanks tvig! 

Also if you don't mind me asking again, do you know where to put the wav file for playOwpSound ? I didn't see any folder for the sound in the files from the link.

- MGRiz

MGRiz

Points : 10
Reputation : 1
Join date : 2019-03-05

Back to top Go down

OWP: Custom Sound App - Page 2 Empty Re: OWP: Custom Sound App

Post by tvig0r0us on Wed 20 Mar 2019, 22:48

MGRiz wrote:It worked, thanks tvig! 

Also if you don't mind me asking again, do you know where to put the wav file for playOwpSound ? I didn't see any folder for the sound in the files from the link.

- MGRiz

I had to dig into my installation to see where to put the sound files. The path to the sound files should be as follows:

OWP folder > sounds

So in the same folder as the owpServer.exe, create a sounds folder and drop your wave files in there. Hope this helps.

--tvig


OWP: Custom Sound App - Page 2 Nst_tv10
tvig0r0us
tvig0r0us
Admin

Location : Nky
Points : 266
Reputation : 29
Join date : 2013-10-16

http://www.moddb.com/members/tvig0r0us

Back to top Go down

OWP: Custom Sound App - Page 2 Empty Re: OWP: Custom Sound App

Post by Sponsored content


Sponsored content


Back to top Go down

Page 2 of 2 Previous  1, 2

Back to top


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