[SOLVED]Players().action_flags.action_trigger in multiplayer

Have a question, suggestion, or comment about Aleph One's features and functionality (Lua, MML, the engine itself, etc)? Post such topics here.
Post Reply
Dan
Cyborg
Posts: 94
Joined: Feb 20th '14, 02:26
Location: California

In single player, the action_trigger variable will state whether or not the action key is activated or not.
In multiplayer, it doesn't seem to do anything, which messes up my script (which uses action key to switch stuff). :huh:

Is this supposed to happen?
If it is, tell me so I can change my script.

Thanks in advance :)
Last edited by Dan on Feb 22nd '14, 01:01, edited 1 time in total.
Roses are rose red
Poems don't always make sense
Refridgerator
User avatar
treellama
Vidmaster
Posts: 6107
Joined: Jun 2nd '06, 02:05
Location: Pittsburgh
Contact:

It works in multiplayer. See Co-op Lua.
Dan
Cyborg
Posts: 94
Joined: Feb 20th '14, 02:26
Location: California

Thanks treellama :)
I'm going to check that out

EDIT:
Urk. :mellow:
Well, Co-op lua sure works. But even a basic script like this:
Triggers = {}
function Triggers.init()
function Triggers.idle()
for p in Players() do
if p.action_flags.action_trigger then
p.zoom_active = true
end
end
end
end
-- doesn't work in multiplayer. I'm definitely doing something wrong, ain't I? :rolleyes: I am really clueless right now, because it stuff like this works fine in single-player.

-- Yes, nested elements. Didn't see that.
Last edited by Dan on Feb 21st '14, 23:06, edited 2 times in total.
Roses are rose red
Poems don't always make sense
Refridgerator
User avatar
treellama
Vidmaster
Posts: 6107
Joined: Jun 2nd '06, 02:05
Location: Pittsburgh
Contact:

Ordinarily one wouldn't nest trigger functions...brush up on your Lua.
Dan
Cyborg
Posts: 94
Joined: Feb 20th '14, 02:26
Location: California

Yeah, sorry 'bout that. :P
And never mind about this. It seems to work now. Funny. Sorry for causing trouble.
Can't be too sure though, so I'll just give it a few more goes before I mark this as a stupid solved topic.

EDIT: Y'know, I think this is just a case of sloppy writing. I'm rewriting my script.
Roses are rose red
Poems don't always make sense
Refridgerator
Dan
Cyborg
Posts: 94
Joined: Feb 20th '14, 02:26
Location: California

Sorry for all the trouble; I don't know what went wrong, but rewriting the whole thing smoothed out the errors. Well, thanks for listening to my pleas for help :)
Roses are rose red
Poems don't always make sense
Refridgerator
Post Reply