Mr. Project DX

Discuss and unveil current Marathon projects.

Post Mar 26th '09, 12:02

Kurinn wrote:Do you think it's weird? If so, then fix it and tell me how you fixed it.

Yes, I do, but I also haven't a clue how it's done to begin. If I stumble across the answer you'll be second to know!

Could you add a "bang" as though the machine had been kicked from there?
Thank the sun that went nova so that Earth could have iron and silicon.
User avatar

effigy

Post Mar 26th '09, 12:08

If that's so Kurinn, I suggest you check out MaraPiD. While it's even less intensive than your ideas for various reasons, they did use a level changing system that allowed the player to go back and forth between levels without using the teleportation effect. Since their ideas seem fairly related to yours, it probably wouldn't be a bad idea to check it out. In regards to everything else, I like the ideas. A very interesting take on the whole concept of FPS-RPG's.
I have been wading in a long river and my feet are wet.
User avatar

L'howon
Somewhere outside the Citadel Of Antiquity

Post Mar 26th '09, 13:07

Kurinn wrote:This is digging up some old issues, but has anyone else tried playing with activate_terminal in Lua?

I use it all the time to skip through Ne Cede Malis

The first thing you should try, is putting an actual terminal in the level, and making sure you're doing those right. If that works, you should be able to call it up just by doing Players[0]:activate_terminal(0) in the Lua console.
User avatar

treellama
Pittsburgh

Post Mar 26th '09, 14:56

Treellama wrote:I use it all the time to skip through Ne Cede Malis

The first thing you should try, is putting an actual terminal in the level, and making sure you're doing those right. If that works, you should be able to call it up just by doing Players[0]:activate_terminal(0) in the Lua console.


Did that. For some reason, the console will in fact do it correctly, however whenever I action-key on the appropriate 3d object, all I get is the sound effect.

Update:
Okay, I think I've figured out a vague notion of what is going on here.
I've tried rewriting this at every step, seeing where something could have gone wrong. In each case that the action key was involved, no dice. Even when I scripted it so that the action flag for Player 0's action key would activate_terminal, it didn't work. Then I scripted something where pressing the mic key would activate_terminal, and sure enough it worked. I am thinking that the way the engine itself detects and handles action key requests, especially regarding terminals is responsible for the issue I am having. There is no "terminal" there, so whatever normal detection routines are involved for action key interaction aren't jiving with the appearance of a terminal. I guess what is happening here is that if you press the action key when there is no terminal, then the last thing the engine wants to do is display a terminal?

Dunno what exactly causes it, but at least now I have a vague idea. Still, this really toads the wet socket when it comes to my hopes and dreams of having 3d terminals so easily (well, there was still that issue of matching scenery to the right terminal)...


Update 2:
I made a simple fix by way of making the action-key routines ultimately switch the boolean state of a variable which then is used to trip an if/then in the Triggers.idle which opens a terminal. So now the 3d terminal works, but actual implementation is another story, as there is still the issue of how to match up terminals to scenery. Anyway, it seems for now I've gotten around the big mystery of it all. activate_terminal always worked, it's just that nobody ever thought to use it in the screwed up way I did, and thus such problems arose. I guess you would have some insight into whatever issue there is with the action key, but that's not such a big deal now I suppose. Thanks for your advice anyway though, Treellama. Even if it's only teaching me that the stove is hot, that was enough to make me look at it again from the right angle and figure out what wasn't working.
Last edited by Kurinn on Mar 26th '09, 15:18, edited 1 time in total.
Image
Kurinn

Post Mar 26th '09, 15:48

I don't understand most of that. Can you post some code? I understand code :)
User avatar

treellama
Pittsburgh

Post Mar 26th '09, 23:11

Treellama wrote:I don't understand most of that. Can you post some code? I understand code :)


Bleep bloop bleep bleep bloop? Blooooop...

Oh, right, sorry... here you go:

Doesn't work:
Code: Select all
Triggers = {}

function Triggers.idle()

    if Players[0].action_flags.action_trigger then
        Players[0]:activate_terminal(0)
    end
    
end


Works: (console)
Code: Select all
> Players[0]:activate_terminal(0)


Also works:
Code: Select all
Triggers = {}

function Triggers.idle()

    if Players[0].action_flags.microphone_button then
        Players[0]:activate_terminal(0)
    end
    
end


Finally this, which happens to work:
Code: Select all
Players[0]._3d_terminal_active = false

Triggers = {}

function Triggers.idle()

    if Players[0]._3d_terminal_active then
        Players[0]:activate_terminal(0)
        Players[0]._3d_terminal_active = false
    end

    if Players[0].action_flags.action_trigger then
        local o, x, y, z, polygon = Players[0]:find_target()
        if is_scenery(o) then
            if o.type == (whatever scenery is set up as a terminal) then
                Players[0]._3d_terminal_active = true
            end
        end
    end
end
Image
Kurinn

Post Mar 26th '09, 23:41

Oh, yeah, it's not going to be as simple as #1. As it happens, action_trigger is the flag that aborts terminals. So, you have to turn it off before you activate_terminal.

But, you don't want to turn it off if you're actually in the terminal, or you can't abort it. And, regrettably, Lua doesn't expose whether you're in a terminal or not--and also doesn't invalidate the action flags when you're in a terminal like the docs say it will. So, you have to keep track of whether you're in a terminal yourself.

Code: Select all
Triggers = {}

function Triggers.terminal_enter(_, player)
   player._in_terminal = true
end

function Triggers.terminal_exit(_, player)
   player._in_terminal = false
end

function Triggers.idle()
   if not Players[0]._in_terminal and Players[0].action_flags.action_trigger  then
      Players[0]._in_terminal = true
      Players[0].action_flags.action_trigger = false
      Players[0]:activate_terminal(0)
   end
end

Mind you, you also want to see if the action trigger was handled, if you want any doors or switches on your level to work.

Edit: better check _in_terminal first to short circuit flags check in case Lua ever acts like docs say
Last edited by treellama on Mar 26th '09, 23:51, edited 1 time in total.
User avatar

treellama
Pittsburgh

Post Mar 27th '09, 01:15

Treellama wrote:Oh, yeah, it's not going to be as simple as #1. As it happens, action_trigger is the flag that aborts terminals. So, you have to turn it off before you activate_terminal.

But, you don't want to turn it off if you're actually in the terminal, or you can't abort it. And, regrettably, Lua doesn't expose whether you're in a terminal or not--and also doesn't invalidate the action flags when you're in a terminal like the docs say it will. So, you have to keep track of whether you're in a terminal yourself.

Code: Select all
Triggers = {}

function Triggers.terminal_enter(_, player)
   player._in_terminal = true
end

function Triggers.terminal_exit(_, player)
   player._in_terminal = false
end

function Triggers.idle()
   if not Players[0]._in_terminal and Players[0].action_flags.action_trigger  then
      Players[0]._in_terminal = true
      Players[0].action_flags.action_trigger = false
      Players[0]:activate_terminal(0)
   end
end

Mind you, you also want to see if the action trigger was handled, if you want any doors or switches on your level to work.

Edit: better check _in_terminal first to short circuit flags check in case Lua ever acts like docs say


Well, now things make more sense. Thank you, thank you very much.

Assuming that the interpreter isn't altered at some point to bring it into line with what the docs say about action flags, I wonder if we can screw around in Lua to add a layer of interaction into terminals..? If the other player action flags are still being seen as valid, then I am curious if other flags, such as the weapon cycle flags, could let me jump into other terminals or invoke other commands, maybe opening doors or some kind of crap... It would have to be level specific, and terminal specific code due to the fact that Lua has no idea about what each terminal says or does.

It would be interesting if the interpreter could dynamically create terminals, kind of like a php backend can whip out html pages. Add that to the other rocket-delivered bacon ideas I had such as positioning overlays, etc., I guess.

I looked over the features requests on the sourceforge page for A1, and it looks like everyone has their own pie-in-the-sky wishes for what exactly the interpreter should be able to do. I don't expect to see anything too specific which wouldn't address the basic functionality of the engine which caters to the overall community, but I am curious to know what the focus of your intentions are in the development of the engine so I might point my efforts in the same general direction. I mean, if that branch you showed us in the thread with the bump maps ever matures enough to get mainstreamed, then I could see myself going over the textures and making bump maps for everything, and making sure the maps can take advantage of that.

Anyway, I am having a blast as it is playing with Lua. Eventually I hope to know enough about scripting in Lua so that I don't have to ask you such inane questions as these, but until then I am glad that you have time to answer them.
Image
Kurinn

Post Mar 27th '09, 01:50

I did some testing to see if I could use any of the action triggers while the terminal was engaged, and for all intents and purposes there is no practical use for them in a terminal.

However, you can still toggle sniper zoom while in a terminal, which is giving me ideas. "Press F7 to destroy computer system" or something like that.

Edit:

I was able to switch terminals on the fly with sniper zoom.

Code: Select all
Triggers = {}

function Triggers.terminal_enter(terminal, player)
   player._in_terminal = true
   player._active_terminal = terminal.index
end

function Triggers.terminal_exit(_, player)
   player._in_terminal = false
end

function Triggers.idle()
    if Players[0]._in_terminal and Players[0].zoom_active then
        Players[0].zoom_active = false
        Players[0]._active_terminal = Players[0]._active_terminal + 1
        Players[0]:activate_terminal(Players[0]._active_terminal)
    end    
end
Last edited by Kurinn on Mar 27th '09, 02:00, edited 1 time in total.
Image
Kurinn

Post Mar 27th '09, 02:05

zoom_active is only valid for the local player; your scenario would not work in co-op if you use it.
User avatar

treellama
Pittsburgh

Post Mar 27th '09, 03:20

Treellama wrote:zoom_active is only valid for the local player; your scenario would not work in co-op if you use it.


Hmm... I still haven't determined if I want to even cater towards the possibility of co-op play yet, but I will keep that in mind.

Right now I am spinning off into tangents, so I guess it's not worth thinking about creating new tricks for the terminals yet.
Last edited by Kurinn on Mar 27th '09, 05:38, edited 1 time in total.
Image
Kurinn

Post Mar 27th '09, 14:41

Kurinn wrote:Right now I am spinning off into tangents, so I guess it's not worth thinking about creating new tricks for the terminals yet.

Reminds me a little of Doomchargers, which we used to use before there were enough decent net maps without rechargers.
User avatar

treellama
Pittsburgh

Post Mar 28th '09, 21:48

This project looks like its gonna be the bomb.
MoppyPuppy
Lake Nebagamon, WI

Post Mar 30th '09, 18:44

MoppyPuppy wrote:This project looks like its gonna be the bomb.


Well, it needs more manpower than just me. If you aren't busy, I really would appreciate some help.

First you compare my work to a Menards, then you just stand there with your jaw hanging open... Go get your pickaxe, it's time to go to work!

(Seriously though, if you have time and can lend a hand in any kind of work, drop me a PM. I have classes starting next week, and if I don't have some kind of help this project isn't going anywhere fast.)
Image
Kurinn

Post Mar 30th '09, 19:08

Treellama wrote:Reminds me a little of Doomchargers, which we used to use before there were enough decent net maps without rechargers.


Hmm. I was actually hoping to inspire people to put more rechargers into their net maps just to see people randomly get fried.

I was thinking of expanding the concept to make a comprehensive net game script where you have random stuff like two players being randomly chosen at the beginning of a round, and when they come close enough they create a nuclear explosion that kills everyone on the map.

Or, maybe something where one player starts out with some kind of crippling disease which is passed on to other players whenever they get close enough, slowly decreasing health and oxygen, as well as impairing movement. The only way to stop it is to die, which happens eventually anyway. Dying from disease or other causes makes you uninfected again, but if the "plague-bearer" is killed, they respawn with the disease again, and Then every round someone different plays the part of the "priest", and they have to chase down the infected players (and of course they are immune to the disease) and try to do an exorcism by punching them, which really doesn't do anything to 'cure' the players (the priest's attack doesn't inflict damage either, and they can't carry any weapons), but each time they do it they get a boost to their score, and they cannot be killed without invoking a negative score penalty, except in the case of the "anarchist", who has to guard the "commune" and gets a massive score boost whenever they shoot the priest. But, if the priest gets into the commune, then everyone's weapons are disabled, and the only way to win the round is to see who can kill themselves the quickest by either using the rechargers or jumping in front of the giant radar dish (or whatever object you like) which can only be activated by everyone chasing down and surrounding the "alien", who is chosen by being the one who stays the farthest away from all the other players on the map. Once everyone has gotten close enough to the alien at once, then they "phone home" and everyone can jump in front of the dish in order to get fried. BUT, if the alien is killed once the priest has sanctified the commune and turned it into the "church", then the player that killed the alien becomes the "magician", and they can either cause the game to end at will with a massive negative score adjustment to themselves, or alternately, de-sanctify the church, which sets everything back to the beginning except for the scores, and restarts the game timer.

It's the best idea ever, right?
Image
Kurinn

Post Mar 30th '09, 19:28

Yeah...um...inflict disease and such.

You, sir, are quite the story teller. Where's the Rabi during all of this? Also, let's have a description of the map (pub/bar) you're going to need to play it. [MGrin]

Jokes aside, if you're not joking, I'd definitely test this out.
Thank the sun that went nova so that Earth could have iron and silicon.
User avatar

effigy

Post Mar 30th '09, 19:59

effigy wrote:Yeah...um...inflict disease and such.

You, sir, are quite the story teller. Where's the Rabi during all of this? Also, let's have a description of the map (pub/bar) you're going to need to play it. [MGrin]

Jokes aside, if you're not joking, I'd definitely test this out.


I don't know, if I wasn't already so damn tied into what I am doing now, I might spend a night and try and make something like that, but as it is I am not ready to make that kind of thing. Someone who already knows what they are doing with Lua could do it pretty easily, I think. I'm only just sick enough to think it up, not to actually implement it (not yet, at least).
Image
Kurinn

Post Mar 30th '09, 20:09

Very good, sir. Here's to new ideas.
Thank the sun that went nova so that Earth could have iron and silicon.
User avatar

effigy

Post Mar 30th '09, 20:24

New ideas are good, but consider the metaserver audience. When people can't figure out a game like Capture the Flag, where the only directions you need are in the title of the script, how well do you think they will fare with a script that takes 360 words of prose to describe?
User avatar

treellama
Pittsburgh

Post Mar 30th '09, 21:16

Treellama wrote:New ideas are good, but consider the metaserver audience. When people can't figure out a game like Capture the Flag, where the only directions you need are in the title of the script, how well do you think they will fare with a script that takes 360 words of prose to describe?


I think, then, that the name of such a game as described above will be something as simple, yet profoundly informative as "Society".

But I digress... with the lack of i/o functionality in the interpreter, I am looking for new and amusing ways to allow for all of the data which will be needed in the course of the scenario to be appended somehow to the information saved by the player.

Can the log file be used for this kind of thing?
Image
Kurinn

Post Mar 30th '09, 21:16

This would certainly cater to a niche audience. I think It would look nice next to Captures on my shelf of wonders.

Speaking of CTF...this might be CTF hour for any lucky souls that happen by the meta.
Thank the sun that went nova so that Earth could have iron and silicon.
User avatar

effigy

Post Mar 30th '09, 21:31

Kurinn wrote:But I digress... with the lack of i/o functionality in the interpreter, I am looking for new and amusing ways to allow for all of the data which will be needed in the course of the scenario to be appended somehow to the information saved by the player.

Can the log file be used for this kind of thing?

Are you talking about saving information across levels, or in saved games? For the latter, you can create annotations and such. For the former, you're really out of luck. The best you can do is mess with the player's limited inventory.

Solo scripts do have access to Lua's IO library, but to use them you would need to have players enable it (whereas embedded Lua, which you should be using(!), just works), and it would remove any possibility of playing co-op.

It's probably possible to hack some save/interlevel functionality into Lua. For a long time we've been trying to do it in an elegant way, and it hasn't happened. So, maybe something inelegant, like saving a string which you have to serialize/deserialize yourself.
Last edited by treellama on Mar 30th '09, 21:31, edited 1 time in total.
User avatar

treellama
Pittsburgh

Post Mar 30th '09, 21:39

Treellama wrote:Are you talking about saving information across levels, or in saved games? For the latter, you can create annotations and such. For the former, you're really out of luck. The best you can do is mess with the player's limited inventory.

Solo scripts do have access to Lua's IO library, but to use them you would need to have players enable it (whereas embedded Lua, which you should be using(!), just works), and it would remove any possibility of playing co-op.

It's probably possible to hack some save/interlevel functionality into Lua. For a long time we've been trying to do it in an elegant way, and it hasn't happened. So, maybe something inelegant, like saving a string which you have to serialize/deserialize yourself.


Annotations?

I figured that if anything a solution would not be elegant, and that ser/des would come into play somewhere.

I guess the first thing I want to know is how I can go about messing with saved games. After that I'll find out how much coffee I will need to hurt my brain into submission for the scripting of interlevel functionality.
Last edited by Kurinn on Mar 30th '09, 21:44, edited 1 time in total.
Image
Kurinn

Post Mar 31st '09, 00:22

Kurinn wrote:Annotations?

Map text.

I figured that if anything a solution would not be elegant, and that ser/des would come into play somewhere.

The other thing I considered was storing the custom variables attached to each object, and retrieving them. It's not out of the question, I guess. You'd have to wait for the next Aleph One.
User avatar

treellama
Pittsburgh

Post Mar 31st '09, 05:43

I thought annotations were still limited to 64 characters...
My idea for them was to use them to record the exact position and condition of every monster, item, platform, and switch that is ever altered during the level. This information would be added to a mother-string, containing the position of every single thing in every level that the player has visited so far, which would be then recorded in each of the annotations of the levels and then used to manipulate everything the second the player walks into the level.

This idea would allow level back-tracking, like in Prime Target and Pathways. But I don't think I could do that with just 64 characters per level... or technically 1024 characters if I used all 16 of my annotations in Forge for this purpose.
User avatar

Shadowbreaker
Melbourne, Victoria

PreviousNext

Return to Projects



Who is online

Users browsing this forum: No registered users