New verge.exe, new event triggers (onStep, onEntityActivation)
Displaying 1-15 of 15 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
mcgrue

There are now four new read/write string variables accessible to verge3 via vc:

trigger.onStep
trigger.afterStep
trigger.beforeEntityScript
trigger.afterEntityScript

These are global callfunction triggers. If they are blank, or if they are set to a string that isn't a vc function name, nothing happens. But if they are set to a vc function name, awesome magic happens!

If trigger.onStep is set to a vc function name, that function will be called everytime the player entity crosses a zone activation border, regardless of if a zone is about to be activated. If a zone will be activated, this function occurs right before that zone's script goes off.

If trigger.afterStep is set to a vc function name, that function will be called everytime the player entity crosses a zone activation border, regardless of if a zone is about to be activated. If a zone was activated, this function occurs right after that zone's script goes off.

Both trigger.onStep and trigger.afterStep's assigned vc functions will have access to a proper event.tx, event.ty, regardless if a zone gets activated. Note that this is a change in behavior, as event.tx and event.ty are now updated at a new point. If this breaks anyone's day, please let me know.

These two triggers are good for things like dealing with poison and tintinabar-style effects and step counters, which are more dependant on the act of walking than on any specific zone. I was brought to implement this specifically because there was no good way to deal with decrementing the "steps to battle" counter for Sully, and this seemed like an idea whose time had come.

If trigger.beforeEntityScript is set to a vc function name, that function will be called before any entity's onActivate script is called.

If trigger.afterEntityScript is set to a vc function name, that function will be called after any entity's onActivate script is called.

Both trigger.beforeEntityScript and trigger.afterEntityScript's assigned vc functions will have the proper event.tx, event.ty, and event.entity values available to them, just like the entity's onActivate script does.

These two triggers are great for handling universal pre- and post-conditions for entity onActivate events. Specifically, in Sully it was getting tiresome to have to tell the game to forbid the menu as the first line of every entity's onActivate script, and it was getting tiresome to tell the game to re-allow menus afterwards. If you forgot any of these, you basically created a gameplay bug! Awesome, eh?

Forthcoming, but not implemented yet, are similar variables for before and after any zone has been adjacently activated. I'm also looking into making a new kind of zone activation which would activate when you push against it. Imagine a closed door opening when your player pushes into it. I am eager to listen to any suggestions for both new callback triggers, and new script activation conditions.

Please, share your thoughts!

Posted on 2008-04-25 03:28:38

Biggs


...in Sully it was getting tiresome to have to tell the game to forbid the menu as the first line of every entity's onActivate script, and it was getting tiresome to tell the game to re-allow menus afterwards.


With Lua you can automate initialization/finalization calls by coding a function that generates functions like so:


function fDM(func)
-- returns a newly created function that
-- does initialization/finalization and calls func

f = function ()
disable_menu()
if func then
func()
end
enable_menu()
end

return f
end


And then your onActivate function would be defined like so:


--pass your custom function in and it returns the new function made with it
dude_activate = fDM(
function () dude.say("hi") end
)


So dude_activate will equate to:


function ()
disable_menu()
dude.say("hi")
enable_menu()
end


Functions that take functions as parameters are called higher-order functions (HOFs).

I just had to mention this. The new triggers will still definitely help things, though, so, kudos! :)

Posted on 2008-04-25 18:54:09

creek23

Quote:Originally posted by mcgrue

Please, share your thoughts!


I downloaded the latest Sully release, and I had a little problem.
Then saw this latest Verge3 release. And I still have this little problem.


Has anyone blew the code related to graphic display?

Posted on 2008-04-25 19:41:41

ErayMan

The onStep events are great. I was about to implement a weird way of doing random encounters, so the timing couldn't be more perfect!
I'll definately use them.

One little question!
Do you need to have a zone specifed on each tile for it to be called? Or any step anywhere? Like, would I need to put an empty zone in each tile of a village if I would be to track steps taken?

Also, for suggestions, an event to be called when you try to move where there's an obstruction or an entity. So we'd be able to switch into "pushing" mode and do proper animation, a la secret of mana when you push monsters or statues, might be swell.
Or it could be used to play a sound meaning you hit a wall.
What do you think? :)

Posted on 2008-04-29 12:18:44

mcgrue

Erayman:

Nope. You don't need a zone defined for it to fire.

As for the pushing mode, while I was going to add an onPush script activation trigger to zones and entities, there probably should be something like a script like player.onBlock or a read-only int entity.attemptingMoveButBlocked

But with a better name.

>_>

I'll think on it.

Posted on 2008-04-29 14:47:20

mcgrue

Creek:

You want to talk to Kildorf!

We need more both more mac engine developers and mac gamemakers. The feedback loop is a little slow right now.

Posted on 2008-04-29 14:48:23

Linachan

V3 is sexy!

Posted on 2008-05-04 21:37:51

Kildorf

Quote:Originally posted by mcgrue

Creek:

You want to talk to Kildorf!

We need more both more mac engine developers and mac gamemakers. The feedback loop is a little slow right now.


Grue, that's clearly a WinXP screenshot. What?

Posted on 2008-05-14 10:06:05

creek23

Quote:Originally posted by Kildorf

Grue, that's clearly a WinXP screenshot. What?

It is XP. that's why I wondered because Im aware that you are maintaining the Mac release and Im being forwarded to you...

The bug, btw, is the setting of 640x480 window while maintaining the 320x240 primary buffer size.

Posted on 2008-05-17 23:58:31

mcgrue

Oh, you've cut the crusts off of it. Or are hiding your taskbar.

This looks like the fullscreen mode error. were you trying to set fullscreen mode?

Posted on 2008-05-18 16:56:44

creek23

I executed the verge engine after unzipping the latest Sully release.

I believe that the config file is set to 640x480 window mode while keeping the 320x240 screen size.

Posted on 2008-05-20 03:08:05

resident

New Sully is awesome. Some of the new art is a _colossal_ improvement.

I mourn the passing of Bumville Classic, though. Whilst New Bumville is definately superior in every way, it's difficult for me not to feel nostalgic for the version that I ripped off and turned into a poor quality zombie-shooter.

Posted on 2008-05-23 07:34:21

mcgrue

The old bumsville will live on in our hearts!

...also in the archives. >_>

Posted on 2008-06-04 03:17:01

Technetium

Hey all. I'm bored at work and thought I would check in on what's going on in verge these days. The new onStep trigger sounds awesome, and will make it a lot easier to code my poison effect, as you mention. I haven't done any verge in 2 years, but I really want to get back into it now.

Also, I second the idea for an onPush or something that works to that effect. It's not too hard to have a zone trigger a function that checks every refresh if you are pressing in a certain direction, but this would be better, no doubt.

I'm gonna go play Phobos Project when I get home to see where I left off. And then maybe make some more. :)

Posted on 2008-07-16 13:47:49

Gayo

Oh hey, that'd be awesome! Man, you can never be sure something is dead in VERGE, can you?

Posted on 2008-07-21 05:07:46


Displaying 1-15 of 15 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.