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.

Help with setMood and setDoctrine please?

2 posters

Go down

Help with setMood and setDoctrine please? Empty Help with setMood and setDoctrine please?

Post by DYNDB Tue 24 Jun 2014, 20:54

A while back I was able to set the mood of a unit to to "EMoodPassive" and set the doctrine to "EATease". I'ts been a while and I forgot how to do these
loops since I'm not a programmer.Does anyone know how to set up the loops to use either one or both of these commands?

DYNDB

Points : 7
Reputation : 1
Join date : 2014-06-24

Back to top Go down

Help with setMood and setDoctrine please? Empty Re: Help with setMood and setDoctrine please?

Post by tvig0r0us Wed 25 Jun 2014, 05:45

Both of these commands are outlined in the help file inside of the editor. Pay very close attention to the case they use in the instructions as the commands are case sensitive and will not work if they are not typed exacly as stated in the help file. If you have any other questions, I'm happy to help you out, but make sure to look over the help file first as it does a fairly good job of covering the scripting commands of the game.

Cheers Very Happy
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

Help with setMood and setDoctrine please? Empty Re: Help with setMood and setDoctrine please?

Post by DYNDB Thu 26 Jun 2014, 06:34

I can't seem to get the setMood command to work in any way. I'm trying to make an echelon or entity stay on "EMoodPassive" for either a time limit
or a number of loops.

DYNDB

Points : 7
Reputation : 1
Join date : 2014-06-24

Back to top Go down

Help with setMood and setDoctrine please? Empty Re: Help with setMood and setDoctrine please?

Post by tvig0r0us Thu 26 Jun 2014, 13:55

AFAIK the command also takes an override. I would not use it in conjunction with any other commands as they sometimes seem to interfere with each other. In your original post you asked about the setDoctrine command as well. If I'm not mistaken, it will not be necessary to set the doctrine because "EMoodPassive" overrides the AI functions. In other words, they should have no doctrine when set passive. Keep us up to date.

Cheers Very Happy
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

Help with setMood and setDoctrine please? Empty Re: Help with setMood and setDoctrine please?

Post by DYNDB Thu 26 Jun 2014, 18:19

why isnt this working? (set PLA and USA to EMoodPassive)

function onMissionStart()

if OFP:getMood("rdech") ~= "EMoodpassive" then
OFP:setMood("rdech", "EMoodPassive", "OVERRIDE")



end
end



function onMissionTime_HHxMMx00(missionTimeInMilliSeconds)
OFP:setMood("echblue", "EMoodPassive","OVERRIDE")
end

DYNDB

Points : 7
Reputation : 1
Join date : 2014-06-24

Back to top Go down

Help with setMood and setDoctrine please? Empty Re: Help with setMood and setDoctrine please?

Post by tvig0r0us Thu 26 Jun 2014, 19:37

Because the word "passive" needs to be capitalized in your first line of code.

EDIT-
Although that is not what is causing the code not to work on second thought. You do not want to use the onMissionTime function as it is firing every frame, so remove that from your code entirely. Try to insert a line at the end of your onMissionStart function that reads OFP:displaySystemMessage("Mood is "..OFP:getMood("rdech"))

That will display the mood in game and tell you whether or not the command took effect. Let us know your results and we'll go from there.
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

Help with setMood and setDoctrine please? Empty Re: Help with setMood and setDoctrine please?

Post by DYNDB Thu 26 Jun 2014, 19:48

I fixed the capitalization and still no luck. I tried this next (didn't work):


function onMissionStart()

setrdID = OFP:activateEntitySet("rd")
if OFP:getMood("rdech") ~= "EMoodPassive" then
OFP:setMood("rdech", "EMoodPassive", "OVERRIDE")

end
end


function onSpawnedReady( setName, setID, tableOfEntities, errorCode )
    if setID == setrdID then
    for i = 1,2 do
    OFP:setMood("rdech" .. i, "EMoodPassive", "OVERRIDE")
    

end
end
end




I can't get the setMood to change. I got it to work about a year ago but I don't have the .mssn anymore.

DYNDB

Points : 7
Reputation : 1
Join date : 2014-06-24

Back to top Go down

Help with setMood and setDoctrine please? Empty Re: Help with setMood and setDoctrine please?

Post by tvig0r0us Thu 26 Jun 2014, 23:44

I'll look into this and come up with a solution. Are the units attached to an echelon?? I noticed in your onSpawnedReady you are just cycling 2 indexes from the tableOfEntities. If there is an echelon, you will only need to get the echelon if I'm not mistaken. Do that with the following code.

Code:
for i,v in ipairs(tableOfEntities) do
  if OFP:isEchelon(v) then
    OFP:setMood(v,"EMoodPassive","OVERRIDE")
  end
end


UPDATE:
Ok... I ran a series of tests setting soldiers to passive with and without echelons attached and echelons to passive. It appears that the EMoodPassive parameter is having no effect what so ever. I also set up some debugging messages to see if the command was in-fact changing the mood status when getMood was used and found out that the command was effective, but did not modify their behavior. I'm at a loss. I'll keep checking into it, but I'm not sure what to look for from here in all honesty.

If it's all the same to you, please explain what you would like to see happen in your scenario and maybe I can put together some code to help you get the desired effect.

Cheers


Last edited by tvig0r0us on Fri 27 Jun 2014, 02:02; edited 1 time in total (Reason for editing : Added stuff)
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

Help with setMood and setDoctrine please? Empty Re: Help with setMood and setDoctrine please?

Post by DYNDB Fri 27 Jun 2014, 06:06

Thanks for looking into that for me. I appreciate the help. What i'm trying to do is here is get the mood to change to passive for the visual look of that mood compared to normal. I can achieve a similar thing by using the "setholdfire" (or "setArmy" to neutral) commands which work perfectly but the enemy soldier with setholdfire activated still points his gun at my echleon and walks toward me like he wants to shoot. If i can get the setMood command to work then I can get a soldier to stop shooting and also look relaxed at the same time. I wish I could explain a more narrower scenario to make this simpler but now I'm just looking to see the setMood work in a simple function that changes an entity's mood to Passive for the remainder of the mission or until I change it back with some sort of trigger.

DYNDB

Points : 7
Reputation : 1
Join date : 2014-06-24

Back to top Go down

Help with setMood and setDoctrine please? Empty Re: Help with setMood and setDoctrine please?

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


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