Novahq.net Forum

Novahq.net Forum (https://novahq.net/forum/index.php)
-   Joint Operations (https://novahq.net/forum/forumdisplay.php?f=178)
-   -   Questioned about chained events. (https://novahq.net/forum/showthread.php?t=47579)

HomeSkool 06-12-2014 12:01 PM

Questioned about chained events.
 
I'm not sure if I got the terminology correct on this one. But I'll try to explain.

I have an AI flying a helicopter. I've made him take off and land at a different location via waypoints. Fantastic.

But now I need him to wait at the LZ for a minute or two then return to the original LZ. He basically is a shuttle for people. How do I "chain" events together with delays? I don't want to use the main game timer because I want him to do this forever. I can't just loop the waypoints because he will then not wait on the ground. This needs to be a chain of events.

Is there a separate timer I can use to trigger the different events and then when I want these events to start all over again I can reset that timer back to 0?

Hope someone knows whats up! :hail:

Guest001 06-12-2014 12:32 PM

Hey Buddy :)

If no-one else sees this before the week end...

Can you hang on, I'm working on it now for you but I may get a call-out in the meantime.

But don't worry I'll be back if I do, I won't leave you hanging :)

It's a little complex to explain without a mission file so I'm checking out a map I made with the things you want to get some images and AI sets together.

The map is actually a DFX2 map "Coffinwood TD" (you can download it here at NHQ) and it will open in JO with waypoints etc intact but it's not exactly ready to go for you just yet if you want a full conversion to work from.

Just to give you food for thought.....
There are several ways to do it but generally we use the "Reset Flags Has Visited" command in the event editor in conjunction with several waypoints and some Waypoint Pausing.

I'll see about your variable timer as well, I'll have to pull that out of my cobwebbed brain again :)

stomp

Guest001 06-12-2014 01:07 PM

1 Attachment(s)
Part 1

For this method, everything is done in the event editor, (no wac required) study this while I get some variables and images together :)

Mission file is in uploaded zip file just below this text ;)

HomeSkool 06-12-2014 01:07 PM

Thanks Stomp!
I'm in no hurry I just wanted to get the ball rolling! Thank you for responding.

I'll check out your map as well.

My events work well with the game timer. But after it does the entire series of events the game timer does not reset to zero of course. That's why I was hoping to use different counting veriable to accomplish this. That's how I do much of my programing in other programs. Whatever the easiest way is I'm down.

With a variable I could have a guy do a patrol. Meet up with another patrol guard. Make it look like they are having a conversation for a few minutes (maybe even insert some audio of them talking). Then once they are done continue along another waypoint route and then maybe get in a truck drive around. Then when they get back to their original start point 20 minutes later the timer resets itself and they start their adventure all over again.

Guest001 06-12-2014 01:46 PM

Here is a basic one


if never then
set v1,0
set v2,0
endif

if ssnnearssn 1,3,100 then
set v1,1
else
set v1,0
endif

if eq v1,1 then //adds 1 to variable2 every second
inc v2
endif

if eq v2,5 then // fires after 5 seconds and resets the variable to 0
SSNtoWP 1,3
set v2,0
endif

Guest001 06-12-2014 02:13 PM

If you go here I have built a workshop tool where you can assemble and play around with scripts...

http://stompem-web.enjin.com/assembler

HomeSkool 06-12-2014 03:38 PM

That is awesome! I'll test it when I get home later today.

One more thought. Is the 24 hour clock a variable?
1. I could make a guy walk down the street and go stand guard at 0800
2. Have him stay at his point until 1700 then he could "go home"
3. Then because the day timer resets at 0800 the next day he "goes back to work"

I thought this would be awesome because I could make the town I am building automated. People go to work then go home. Have a helicopter fly a route then park for the night and do it all over again.

This said I also have not figured out how to make it cycle from day to night.

This this possible?

Guest001 06-13-2014 03:24 AM

Quote:

Originally Posted by HomeSkool (Post 383730)
That is awesome! I'll test it when I get home later today.

One more thought. Is the 24 hour clock a variable?
1. I could make a guy walk down the street and go stand guard at 0800
2. Have him stay at his point until 1700 then he could "go home"
3. Then because the day timer resets at 0800 the next day he "goes back to work"

I thought this would be awesome because I could make the town I am building automated. People go to work then go home. Have a helicopter fly a route then park for the night and

do it all over again.

This said I also have not figured out how to make it cycle from day to night.

This this possible?

Yes you can.

You can set the mission start time in the editor or set it in the WAC.

You must keep in mind that the time of day settings will immediately change the actual time of day in-game.

So the sun could disappear and it could suddenly be the middle of the night.

//sets the TOD to 8:00AM
//tod 08:00

//If the current TOD is 5:00PM
//if eq curTOD,17:00
-----------------------------------------------------------------------------------------
//so for Q.1 Q.2 and Q.3...

if never then
set v1
endif

if eq curTOD,08:00 then
set v1,1
endif

if eq v1,1 then
ssntoWP 1,1
endif

if eq curTOD,17:00 then
set v1,2
endif

if eq v1,2 then
ssntoWP 1,2
endif
-----------------------------------------------------------------------------------------
// Some basic controls relevant to your needs
if past(#) // time since player actually enters the game
if ontick(#) // time since game actually starts
if chain(#) // fires seconds after previous trigger
if previous() // same as chain but imediately after previous trigger
if elapse(#) // time elapsed from if or previous
-----------------------------------------------------------------------------------------
true
false
else
elseif
not
eq
ne
-----------------------------------------------------------------------------------------
loop
end
-----------------------------------------------------------------------------------------
ploop
end
-----------------------------------------------------------------------------------------
dornd
enddo
-----------------------------------------------------------------------------------------
// Using chain and var
-----------------------------------------------------------------------------------------
if ssnarea player,1 then
set v1,1
endif

if eq v1,1 and never then
text "You have 1:00 minute left"
wave "yourwave60.wav"
endif

if chain 30 and never then
text "You have 30 seconds left"
wave "yourwave30.wav"
endif

if chain 15 and never then
text "You have 15 seconds left"
wave "yourwave15.wav"
endif

if chain 10 and never then
text "You have 5 seconds left"
wave "yourwave5.wav"
endif

//etc...
-----------------------------------------------------------------------------------------
//You can set a countdown timer by way of the following- Thanks to info provided by Dave61
-----------------------------------------------------------------------------------------
// IN-GAME COUNTER
// These scripts create an in-game counter during game play.
// (This script was created by GENERAL ELECTRIC at NOVAWORLD FORUM)

// A.) counter that counts the seconds into the game:

if never then
set(v60,0) ; s into game
set(v70,0) ; helpvar s
set(v80,0) ; m into game
set(v90,30) ; cd m Minutes for countdown
set(v100,59) ; cd s
endif

if elapse(1) then
inc(v60)
inc(v70)
dec(v100)
endif

// B.) converting seconds into minutes

if eq(v70,60) or eq(v60,1) and ne(v90,0) then // (stompem - you can also use: and not eq v90,0)
inc(v80)
set(v70,0)
dec(v90)
set(v100,59)
endif

// C.) Making a countdown

if elapse(2) then
consol#("Minutes left",v90)
consol#("Seconds left",v100)
consol("Countdown")
endif


// D.) making a timer instead of countdown

if elapse(3) then
consol#("Minutes played",v80)
consol#("Seconds played",v70)
consol("Gametimecounter")
endif


// E.) trigger for countdown

if eq(v90,0) and eq(v100,0) and never then
text("Countdown finished")
endif
-----------------------------------------------------------------------------------------

HomeSkool 06-13-2014 11:00 AM

Wow thanks man! I'll try to understand the scripts you just provided this weekend.
I'll do my best to build a script that changes the time of day to match 1 minute to ever real second that passes. Then I'll use the TOD as triggers! Super cool!

12 minute dates and 12 minute nights seems perfect.

Guest001 06-13-2014 11:13 AM

Quote:

Originally Posted by HomeSkool (Post 383738)
Wow thanks man! I'll try to understand the scripts you just provided this weekend.
I'll do my best to build a script that changes the time of day to match 1 minute to ever real second that passes. Then I'll use the TOD as triggers! Super cool!

12 minute dates and 12 minute nights seems perfect.

I could have put more info up there but it may have made it too cluttered up to read easily, so just ask any question you like and we will deal with it.

Thanks to the comprehensive set of tools in the editor, you can easily accelerate the time cycle of the day, select the edit tab, then General Information.

Look for Minutes per Day on the right hand side - It's set to 1440 by default.

It's just underneath where you set the Environment File and Start Time.

Set to a higher or lower value as needed.

Guest001 06-13-2014 03:01 PM

Here's a vid I made that you probably haven't seen and it shows what's possible with the editor.
I was a demo map made with chain, wave and teleport events :)


HomeSkool 06-13-2014 07:36 PM

That test map you made is awesome. I've never seen such a good explosion in Joint Ops before. That must have taken forever!

I've set the time to 60 minutes per day in Nile, So 1 sec = 1 minute.
I have a question about one of your examples.

Instead of setting a variable like this

if eq curTOD,08:00 then
set v1,1
endif

Could I avoid the variable and just do this?

if eq curTOD,17:00 then
ssntoWP 1,1
endif

Reason I ask it because I tried to do it and it did not work.

Guest001 06-13-2014 08:14 PM

Quote:

Originally Posted by HomeSkool (Post 383741)
That test map you made is awesome. I've never seen such a good explosion in Joint Ops before. That must have taken forever!

I've set the time to 60 minutes per day in Nile, So 1 sec = 1 minute.
I have a question about one of your examples.

Instead of setting a variable like this

if eq curTOD,08:00 then
set v1,1
endif

Could I avoid the variable and just do this?

if eq curTOD,17:00 then
ssntoWP 1,1
endif

Reason I ask it because I tried to do it and it did not work.

PART 1

The WAC is renowned to be wonky in maps made with the NILE if you manually edit the WAC yourself.

It also uses a different system of AI Identification and as far as I know ssn is not used at all.

It generates the WAC scripts from within the program itself.

All of my JO, DFX and DFX2 maps have been made with DFX MEd 2.60

So I suggest you give it a try.

I will not say whether it's better or worse, just that my system of learning and knowledge is based on the MEd not the NILE.

All of the info on Dave61's web site is also MEd based data. :insane:

Guest001 06-13-2014 08:26 PM

Quote:

Originally Posted by HomeSkool (Post 383741)
That test map you made is awesome. I've never seen such a good explosion in Joint Ops before. That must have taken forever!

I've set the time to 60 minutes per day in Nile, So 1 sec = 1 minute.
I have a question about one of your examples.

Instead of setting a variable like this

if eq curTOD,08:00 then
set v1,1
endif

Could I avoid the variable and just do this?

if eq curTOD,17:00 then
ssntoWP 1,1
endif

Reason I ask it because I tried to do it and it did not work.

PART 2

Without the variable you will have greater difficulty controlling the on and off state of the command.

Remembering

1: then is repeatedly triggered so you may have to make another command to prevent that occurring depending on the timings you use.

2: and never then on it's own is triggered only once but it can be triggered repeatedly at will with a variable.

:gj:

HomeSkool 06-13-2014 08:32 PM

Excellent. I'll fool around with variables more then.

Also, I downloaded DFX MEd 2.60.
When I try to open it it says Warning: Unable to load file game bin file.
I cannot find any settings where I can point DFXMED to the game directory.
I have also tried to re-install joint ops and then re-install DFX with no luck.

Is there something simple I am missing?
I fully want to use the same program you are and ditch Nile.

*UPDATE*
I did not install it to the correct location. I didn't read that it needed to be installed to the Joint Ops folder.
It opens correctly now.

I am trying to get it to load my map file with little success so far. No environment loads. No errors but it just does not display anything.
My map file is *.npz
DFXMED looks like it wants a *.mis file

Guest001 06-13-2014 09:02 PM

Quote:

Originally Posted by HomeSkool (Post 383744)
Excellent. I'll fool around with variables more then.

Also, I downloaded DFX MEd 2.60.
When I try to open it it says Warning: Unable to load file game bin file.
I cannot find any settings where I can point DFXMED to the game directory.
I have also tried to re-install joint ops and then re-install DFX with no luck.

Is there something simple I am missing?
I fully want to use the same program you are and ditch Nile.

*UPDATE*
I did not install it to the correct location. I didn't read that it needed to be installed to the Joint Ops folder.
It opens correctly now.

I am trying to get it to load my map file with little success so far. No environment loads. No errors but it just does not display anything.

OK I'll answer as best I can...

NILE maps (NPJ NPZ) will not open in the MEd sry :(

You'll have to start again because there is no provision in the NILE to export to MIS

Some MIS files will load with no environment because they come from different versions of the game...

That's because terrains, environments and many objects are different or just not there.

If you put the MEd into your game it will open all the assets no problem as it reads the PFF files.

If you use JOE you have to point it to the exp folder using the switch /exp jox01

That may also be a reason your map doesn't load if it is a MIS after all...

Like this:

"C:\Program Files\NovaLogic\Joint Operations Typhoon Rising\dfxmed.exe" /exp jox01
or
"C:\Program Files\NovaLogic\Joint Operations Combined Arms\dfxmed.exe" /exp jox01


Note that if you want to merge or convert between versions you can open 2 maps at once in the MEd, Page1 (P1) and Page 2 (P2)
but make sure you set absolute height first so everything stays at the original heights, then use numeric move to set everything
to the desired height in the new terrain..

BTW
The volcano map was made in DFX2

HomeSkool 06-13-2014 09:38 PM

Okay. Trying to follow you on this one. I have countless hours of programing into this map I've already made in Nile. There is no way to convert it so it is readable in DFXMED?

Guest001 06-13-2014 09:48 PM

Quote:

Originally Posted by HomeSkool (Post 383746)
Okay. Trying to follow you on this one. I have countless hours of programing into this map I've already made in Nile. There is no way to convert it so it is readable in DFXMED?

Unfortunately not that I know of at this time...

You may be better off continuing with it as is and start with the MEd on your next map :(

Give me a little time and I'll have another look in the NHQ DB right now...

Back soon.

Guest001 06-13-2014 09:51 PM

You may well be in luck I think...

Go here mate :)

http://www.novahq.net/?show=utilitie...et_file&id=324

I'm testing it now myself

HomeSkool 06-13-2014 09:52 PM

Sorry I posted before I saw you already responded to me with a solution!
I've converted my file and it now opens in DFXMED! This is excellent!
I'm going to start to test some of your provided scripts now!


All times are GMT -5. The time now is 05:34 PM.

Powered by vBulletin®