Update - More triggers, autosave

Announcements will appear here.
MD
Site Admin
Posts: 195
Joined: Sun Aug 12, 2007 2:06 pm

Update - More triggers, autosave

Post by MD »

AI Command changes:
Previously a death trigger looked like this:
makeTrigger, death, someAction, SOURCE_PART#, TARGET_PART#, OR_OTHER_ACTION_RELATED_OPTIONS
However, I realised that I messed up the syntax. There's an order which makes much more sense.

Consider this:
You're using this command to rotate parts:
rotatePartToShip,5,7
and now you'd like to put it inside a trigger, which previously would look like this (assuming 6 is your source part #):
makeTrigger,death,rotatePartToShip,6,5,7

But it would make much more sense to go
makeTrigger,death,6
then copy and paste the command you were using above to get this:
makeTrigger,death,6,rotatePartToShip,5,7

Therefore, the new syntax is:
makeTrigger,death,sourcePart#,anyAICommand

I will keep backward compatibility with the old style though, as I don't want to ruin any levels that are using it. I must say though, that keeping things backward compatible is really annoying, as I now have 30 lines of code added to the 3 lines that are needed just so I won't break existing levels!

In case you were wondering, the actual code that I program had to change significantly to support this. But it's much cleaner and will make future additions easier.

And of course, there is an addition I've made which is what prompted this change. In fact I've been planning this feature ever since the idea of triggers came up, but my code just wasn't ready for it...until now.
Introducing, time triggers!

You can now specify a time for some action to happen and it will magically happen :) What kind of actions you say? It can be any AI command you were used to using before. Including more time triggers and death triggers. Even a death trigger can create a time trigger which then does your action, in fact, you can nest as many as you'd like together.

The syntax:
makeTrigger,time,frames,anyAICommand

Why frames? Because it's the simplest unit of time for me. The game theoretically runs at 30 frames per second. So just times the number of seconds you want by 30.

I expect you to get creative with how you want to use this.

Furthermore, there's now an autosave feature which will save your level on your local computer. In the event that you need to use it, just open up the editor (and go to the new menu if it's not already open) and click on "recover".

~MD
Last edited by MD on Mon Jun 23, 2008 11:01 am, edited 1 time in total.
Sasadad
Posts: 109
Joined: Wed Jan 02, 2008 1:23 pm
Location: Over there... no, a little to the left
Contact:

Post by Sasadad »

Could you make a command that stops another command after a cetain amount of time? The current stop command doesn't really make any sense to me... doesn't it just cancel out an action, or in other words, delete it?

Also, I wish we could make it so that something happens, then stops, then happens again, sort of like the "Timed Rotation Pausing" using these new time commands.
Mouzi
Posts: 153
Joined: Sat Sep 01, 2007 5:34 am
Location: Finland
Contact:

Post by Mouzi »

Yeah, you can make nested time triggers, but still you can't make intervals :/
Also there could be a createPart command too which would work the same way as text editing.
Of course this can be always done with parts outside the screen and then rotate them in but it's a lot of trouble (and that way the level will always run out of parts :P).

EDIT: Now that I think about it, I was going to use intervals in my level when I read the theme was time and there was a new time command :S
Now my plans are messed up again. I doubt I can make any use of a timeout-only command in my level idea :(
MD
Site Admin
Posts: 195
Joined: Sun Aug 12, 2007 2:06 pm

Post by MD »

Ah, so you want them to repeat themselves...I could add that in I suppose.

How's this:
makeTrigger, timeRepeat, FRAMES, REPEAT_FRAMES, ANY_COMMAND

Try it out, let me know what you think as I have barely tested this.

As for the stop command, it is suppose to be used along with a trigger. Not by itself.

~MD
Mouzi
Posts: 153
Joined: Sat Sep 01, 2007 5:34 am
Location: Finland
Contact:

Post by Mouzi »

Could you explain what exactly should "REPEAT_FRAMES" be? I don't quite get it o.O
EDIT: is it how often it repeats? like in frames. I think I get it now.

Is it possible to stop it somehow? :S
You could make a temporary "stop all repeats" if you can't make them stop individually (I think this would require IDs for the repeat commands or something like that).
It would help a lot.

EDIT2: I can't get the hotkeys working (like rotation)? Is it a problem in my end or with the game?
MD
Site Admin
Posts: 195
Joined: Sun Aug 12, 2007 2:06 pm

Post by MD »

You're right. It's how often it will repeat measured in frames. And no, can't stop those just yet.

I have been working on the hotkeys, so it's probably in the game. For a temporary fix, try opening and closing the login window (or any other window that disables hotkeys while it is open). You could also try deleting the saved settings back to their defaults.

Do you know which window you had open prior to it not working?

~MD
Mouzi
Posts: 153
Joined: Sat Sep 01, 2007 5:34 am
Location: Finland
Contact:

Post by Mouzi »

No, I don't remember. Now that I refreshed the page they seem to work.

Would you be able to implement a way to stop a repeat before the contest is over?
Because I'd like to use it for my level ;)
MD
Site Admin
Posts: 195
Joined: Sun Aug 12, 2007 2:06 pm

Post by MD »

Mouzi wrote:Would you be able to implement a way to stop a repeat before the contest is over?
Probably. Hopefully within a few days.
Mouzi
Posts: 153
Joined: Sat Sep 01, 2007 5:34 am
Location: Finland
Contact:

Post by Mouzi »

Ok, thanks :)
I already figured two workarounds for it so I can use another of them for my level if there won't be a way to stop it (although it may be a bit laggy way to do it :S)
EDIT2: Too complicated. It didn't work. Have to wait for a way to stop repeats.
EDIT3: \o/ Level mostly done. Just have to add the repeat stop thingy and I'm finished.

Hmm there should be a way to set a part's HP. If I add other parts to a part (to get it's HP up) it will cause too much lag :/
Or there could be some kind of switch-like part that has higher HP so that it doesn't get destroyed with a few shots.
Custom HP would be better though.
EDIT: Ok, I solved the HP thing for my level so it's not that urgent :P

Sorry for all these requests :D
Sasadad
Posts: 109
Joined: Wed Jan 02, 2008 1:23 pm
Location: Over there... no, a little to the left
Contact:

Post by Sasadad »

Wait wait wait- what I still don't get is if you do this (from your new commands thread)
Assuming you have "randomWaypoints": stop, randomWaypoints
Doesn't it just mean the core never actually does the "randomwaypoints" command because it is stopped and basically doesn't exist?
Or does it stop it after it happens once (like the core goes to one spot first)?
MD
Site Admin
Posts: 195
Joined: Sun Aug 12, 2007 2:06 pm

Post by MD »

Yes, using that command on its own would mean that randomWaypoints never runs.

So to clarify:
MD wrote:Stop
Syntax: stop, ANY_RECURRING_COMMAND
Description: Stop a recurring action. Specify the parameters you used originally if you want to be specific about which action to stop. This isn't interesting on its own, so use it with a trigger.
Example: Assuming you have "randomWaypoints": stop, randomWaypoints
Example: Assuming you have "rotatePart, 5, 1": stop, rotatePart
Example: Assuming you have "rotatePart, 5, 1 and rotatePart, 4, 2": stop, rotatePart, 5 OR stop,rotatePart, 5, 1
For instance: makeTrigger,time,90,stop,randomWaypoints

I'll post a good example of triggers tonight.

~MD
Mouzi
Posts: 153
Joined: Sat Sep 01, 2007 5:34 am
Location: Finland
Contact:

Post by Mouzi »

My level would be a great example of triggers if I had the stop repeats thingy and could finish it ;D
MD
Site Admin
Posts: 195
Joined: Sun Aug 12, 2007 2:06 pm

Post by MD »

Mouzi wrote:My level would be a great example of triggers if I had the stop repeats thingy and could finish it ;D
Ok ok, you can stop them now :) I just updated the manual with that information.

Here's something to try, apply it to any level (only needs the core)

Code: Select all

makeInvincible,0
makeTrigger,timeRepeat,0,300,makeTrigger,timeRepeat,60,2,coreGun_spread
makeTrigger,timeRepeat,0,300,makeTrigger,time,120,stop,makeTrigger,timeRepeat,60,2,coreGun_spread
makeTrigger,timeRepeat,0,300,makeTrigger,time,180,makeTrigger,timeRepeat,0,2,stop,coreGun_spread
makeTrigger,timeRepeat,0,300,makeTrigger,time,240,stop,makeTrigger,timeRepeat,0,2,stop,coreGun_spread
waypoints,1,7,200,200,600,200,600,400,200,400
makeTrigger,timeRepeat,0,300,makeTrigger,time,60,rotatePart,0,4
makeTrigger,timeRepeat,0,300,makeTrigger,time,240,stop,rotatePart,0,4
makeTrigger,time,1400,destroy,0
makeTrigger,time,0,col,0CA4FE,0
makeTrigger,time,300,col,10FAFA,0
makeTrigger,time,600,col,15AC09,0
makeTrigger,time,900,col,B5B500,0
makeTrigger,time,1200,col,B53600,0
~MD
Mouzi
Posts: 153
Joined: Sat Sep 01, 2007 5:34 am
Location: Finland
Contact:

Post by Mouzi »

Hehe, tried combining my level. It's 2/3 done and I already get an error stating:
"Too many triggers running at once. Deleting triggers for this frame and pausing the game."
:D I guess it fails here then.

Well I've got ~400 lines of AI data so I guess it is quite a lot :D
But it's not even enough yet. I still have the third part of my level under construction.

Btw, what's this error for? And what triggers it? It wasn't lagging or anything when I last time tried it.
MD
Site Admin
Posts: 195
Joined: Sun Aug 12, 2007 2:06 pm

Post by MD »

That error was to prevent you from doing something silly like this:
makeTrigger,timeRepeat,0,1,makeTrigger,timeRepeat,0,1,makeTrigger,timeRepeat,0,1,col,FF0000,0
Which would quickly lock up flash, and it doesn't trigger Flash's warning either. If you have a valid reason for so many triggers at once then perhaps I will increase the limit, which is 50 triggers on one frame currently.

~MD
Post Reply