Home   Help Search Login Register  

Author Topic: playmove  (Read 3200 times)

0 Members and 1 Guest are viewing this topic.

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
playmove
« on: 11 Jul 2006, 20:28:48 »
Code: [Select]
_unit = _this select 1
_sign = _this select 2
hint format ["%1\n%2",name _unit,_sign]
_unit playmove _sign

ok, that is part of a script I got. This all works good in singleplayer, the unit plays the animation and all. But in multiplayer the unit doesn't play the animation. So to figure out if there was something wrong with the unit/animation passed on to the script, I added a little hint to make sure it's right, and the hint shows the right name for the animation and shows the name of the unit. So I know that I got the animation and the unit right, so I don't understand what's wrong. I know that playmove works in multiplayer, so there shouldn't really be a problem.
« Last Edit: 11 Jul 2006, 21:05:41 by Garcia »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: playmove
« Reply #1 on: 11 Jul 2006, 20:33:04 »
Quote
hint format ["%1"\n%2",name _unit,_sign]

you sure about that?

in any case, how are you passing the animation name to the script?

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re: playmove
« Reply #2 on: 11 Jul 2006, 21:04:49 »
eh, yes, that script part was written by memory, not at home ATM ;)

I'm passing the animation and the unit to the script in an array through a global variable. Something like this (this is also from memory, so any typos isn't there in the original script):

script1:
Code: [Select]
arrayname = []
...
arrayname = [[_variable,_unitname,_animation]]
publicvariable "arrayname"

the variable _variable got nothing to do with the animation part of the other script, it's just there to decide if the other script is supposed to get as far at to the animation part.

script2:
Code: [Select]
_order = arrayname select 0
some funcky stuff here to remove the _order array from the arrayname array ;D
? !(_order select 0) : goto "animation"

#animation
_unit = _order select 1
_sign = _order select 2
hint format ["%1\n%2",name _unit,_sign]
_unit playmove _sign

Something like that. As I said, it all works great in SP, but in MP I get to the animation part, I get the right animation name and the name of a unit, but no units perform the animation. I've got 5 units, including me, on the map, and all are supposed to play the animation, but only I do. The hint however, as I said, shows the names of the other units and the animation name. There is no way that the hint could possibly show the names of the other units and not know about them, since it goes through 5 names, and there's only 5 units on the map.
« Last Edit: 11 Jul 2006, 21:15:13 by Garcia »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: playmove
« Reply #3 on: 11 Jul 2006, 21:08:05 »
the only thing i can think of is that you are passing the animation name without stating it as a string, i.e.

Code: [Select]
arrayname = [[_variable,_unitname,animation]]
instead of

Code: [Select]
arrayname = [[_variable,_unitname,"animation"]]
if it is exactly the same script which works in SP, then i dunno mate  :-\

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re: playmove
« Reply #4 on: 11 Jul 2006, 21:13:23 »
damn how I keep writing wrong :-\

it's supposed to be _animation, and I am quite sure the _animation variable is set with the "", something like this:

Code: [Select]
_animation = "animationname"

And yes, the script works in singleplayer, but not in multiplayer. Though I'll look into how the animation is passed, if I lack the "", but I doubt it, since it shouldn't work in singleplayer either if I don't got them :-\

Offline Baddo

  • Former Staff
  • ****
  • Reservist Jaeger
Re: playmove
« Reply #5 on: 11 Jul 2006, 21:42:41 »
You can't publicVariable arrays.

Edit: well, with standard OFP you can't. But with Coc Network services you can. But that's an overkill for your situation. Find a better way.
« Last Edit: 11 Jul 2006, 21:45:17 by Baddo »

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re: playmove
« Reply #6 on: 11 Jul 2006, 22:02:50 »
Well, I actually think I don't have to PV the array, because I do get the names of the units and the animation, but for some reason the animation won't play. I just PVed it as a last try before I posted here.

When I get home I'll try to add the unitname and the animation to global variables and PV them to see if that works.
« Last Edit: 11 Jul 2006, 22:04:32 by Garcia »

Offline Baddo

  • Former Staff
  • ****
  • Reservist Jaeger
Re: playmove
« Reply #7 on: 11 Jul 2006, 22:14:07 »
Are the units artificially controlled or are they all players?

Quote
I know that playmove works in multiplayer

Are you saying about playMove that if you use it locally, the effect is public? I think it needs to be performed on all computers individually. Deleted words which confused myself :D

« Last Edit: 11 Jul 2006, 22:16:14 by Baddo »

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re: playmove
« Reply #8 on: 12 Jul 2006, 00:33:41 »
I mean that I've seen it work in MP in a script that was global ;) This script is also global, and since I do get the name of the unit and the name of the animation, I guess that all that I need for the playmove to work is also global.

And all the units except myself is AI. I'm trying the script alone on a dedicated server.

And I know that the playmove command is local, since I've tried playing animation locally on a server with another human present, where I saw the animation since it ran locally on my computer, while the other guy didn't see it.
« Last Edit: 12 Jul 2006, 00:35:36 by Garcia »

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re: playmove
« Reply #9 on: 12 Jul 2006, 12:03:02 »
Now this is just plain stupid. I've now tried assigning the animation and the unit to a global variable and PVed it, didn't work. So I tried assigning a single unit in the script to the _unit variable (_unit = unitname), didn't work. So I went for the foolproof solution:

Code: [Select]
unitname playmove "animation"

no luck. So then I had to go for the even more foolproof way, adding the same line to a radio activated trigger...which finally worked. So, any ideas why the script won't work? I know for sure it's running on my client, since if it wasn't, I wouldn't get the hint showing. So I don't really see any reason why the damn animation shouldn't be played.

Offline Cheetah

  • Former Staff
  • ****
Re: playmove
« Reply #10 on: 12 Jul 2006, 12:08:30 »
You might want to try "switchMove" instead of "playMove", as playmove doesn't always work and switchMove does. I don't know where you type all these things, but several animations only work when activated from a script or trigger.

Hope that this helps, because it's quite frustrating this way. What you're doing is good, looking for a simple solution and then moving to the more advanced one :).
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re: playmove
« Reply #11 on: 12 Jul 2006, 12:20:40 »
I've tried activating from a trigger, it worked, then I tried using the same trigger to activate a script, and then play the animation in the script, which worked too. So both activation method should work. The frustrating thing is that I know the script is running, it's just that the damn playmove command won't work, for some strange, annoying reason. I've even tried setpossing myself to the unit in the same script, which worked. I'll give the switchmove a try, was thinking about it yesterday, but never tried.

Well, I tried switchmove, and it works. Only problem, which was the reason why I didn't try it before, is that the transition to and from the animation looks crap. I don't really want to use switchmove rather than playmove, because playmove looks much better. I guess I can use switchmove just for now, just to get the scripting done, but in the end I need a way to get playmove to work, so any suggestions/ideas on how to get playmove to work will be welcome.
« Last Edit: 12 Jul 2006, 12:27:01 by Garcia »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: playmove
« Reply #12 on: 12 Jul 2006, 13:23:25 »
which animation(s) you using?

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re: playmove
« Reply #13 on: 12 Jul 2006, 18:01:06 »
Animations from the hand signal system thingy by General Barron.

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: playmove
« Reply #14 on: 16 Jul 2006, 13:21:54 »
I am not 100% sure but dosent the players behaviour affect if the player does the move or not. Try setting the units behaviour as safe.

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re: playmove
« Reply #15 on: 16 Jul 2006, 19:29:17 »
Seeing that the unit perform the animation in singleplayer, no matter what behaviour the units have, I doubt it. Besides, the units performs the animation in the behaviour they have when I write the command in another script or in a trigger.

Anyway, I guess I can lock this one, since I've kinda given up on this whole project for the time being. Too many problems :-\