Would you like to react to this message? Create an account in a few clicks or log in to continue.

Official Community Forums
 
HomeHome  SearchSearch  Latest imagesLatest images  RegisterRegister  Log in  The Wiki  Website  github Project  

 

 Projectile: Server/Client update SOLVED (NOT A BUG)

Go down 
2 posters
AuthorMessage
Guest
Guest
avatar



Projectile: Server/Client update SOLVED  (NOT A BUG) Empty
PostSubject: Projectile: Server/Client update SOLVED (NOT A BUG)   Projectile: Server/Client update SOLVED  (NOT A BUG) EmptySat 15 Sep - 3:40

Currently the implementation in TestProjectile.py doesn't seem to update the server or other clients
with an animation in SampleWorld so there is no animation in the target's client.


Projectile: Server/Client update SOLVED  (NOT A BUG) Screen10 Projectile: Server/Client update SOLVED  (NOT A BUG) Screen11


Only a test I know but thought the behavior would already be there.
Projectile script needs to update the server so it can update
the target's client to run an animation. Time to get my hands dirty. Smile


If someone wants to see this in Sampleworld
1) Open 2 clients and connect them to your server
2) Ctrl-Alt-P to fire projectile at a target, not just any mesh
since the projectile is fired at the target's socket.

The key assignments are in: \SampleAssets\sampleworld\Interface\FrameXML\Bindings.txt
Working with Effects: http://www.multiversemmo.com/wiki/Coordinated_Effects_Example_-_Fireball

Cheers Very Happy


Last edited by Koron on Fri 21 Sep - 8:19; edited 1 time in total
Back to top Go down
Delurin
Head of Platform Development
avatar


Posts : 424
Join date : 2011-08-03

Projectile: Server/Client update SOLVED  (NOT A BUG) Empty
PostSubject: Re: Projectile: Server/Client update SOLVED (NOT A BUG)   Projectile: Server/Client update SOLVED  (NOT A BUG) EmptySat 15 Sep - 6:28

That is intentional. It was a test just to see how you would implement a projectile.
If you want to have all the players see it you need to send a command to the server. You could make a real simple one by adding
Code:
class ProjectileCommand (ProxyPlugin.CommandParser):
    def parse(self, cmdEvent):
        playerOid = cmdEvent.getObjectOid()
        targetOid = cmdEvent.getTarget()
        projectilemsg= AnimationClient.InvokeEffectMessage(playerOid, "TestProjectile")
        projectilemsg.setProperty("targetOID", targetOid)
        projectilemsg.setProperty("sourceOID", playerOid)
        Engine.getAgent().sendBroadcast(projectilemsg)

proxyPlugin.registerCommand("/projectile", ProjectileCommand())
to extension proxy
Back to top Go down
Guest
Guest
avatar



Projectile: Server/Client update SOLVED  (NOT A BUG) Empty
PostSubject: As always   Projectile: Server/Client update SOLVED  (NOT A BUG) EmptySat 15 Sep - 10:49

Thanks Delurin!

Will post when I get it to work.


Now it's off to play games.


Cheers Very Happy
Back to top Go down
Guest
Guest
avatar



Projectile: Server/Client update SOLVED  (NOT A BUG) Empty
PostSubject: Cast to Long()   Projectile: Server/Client update SOLVED  (NOT A BUG) EmptyFri 21 Sep - 8:31

Thanks again Delurin. Very Happy

Had the BigInteger java issue but you and mwright solved it for me here:
http://update.multiverse.net/old-forum/viewtopic.php?t=6201&highlight=biginteger&theme=multiverse

After casting the oid's to long...voila! cheers

Projectile: Server/Client update SOLVED  (NOT A BUG) Fireba11
Back to top Go down
Delurin
Head of Platform Development
avatar


Posts : 424
Join date : 2011-08-03

Projectile: Server/Client update SOLVED  (NOT A BUG) Empty
PostSubject: Re: Projectile: Server/Client update SOLVED (NOT A BUG)   Projectile: Server/Client update SOLVED  (NOT A BUG) EmptyFri 21 Sep - 8:37

Sorry I think I add a long() conversion for every effect and forgot that it wasnt standard
Back to top Go down
Guest
Guest
avatar



Projectile: Server/Client update SOLVED  (NOT A BUG) Empty
PostSubject: Pointed me in the right dir though   Projectile: Server/Client update SOLVED  (NOT A BUG) EmptyFri 21 Sep - 9:24

Not a problem. You pointed me in the right direction.

I gotta learn this stuff anyway and that made me dig through stuff
more than I would've.

Very Happy
Back to top Go down
Guest
Guest
avatar



Projectile: Server/Client update SOLVED  (NOT A BUG) Empty
PostSubject: Key bindings   Projectile: Server/Client update SOLVED  (NOT A BUG) EmptySat 22 Sep - 7:10

And in Bindings.xml changed the key binding to use my /fireball


Changed
Code:
 <Binding name="PROJECTILETEST" header="ACTIONS">   
    ClientAPI.InvokeEffect("TestProjectile", ClientAPI.GetLocalOID(), {'targetOID': MarsTarget.GetCurrentTarget().OID, 'sourceOID':ClientAPI.GetPlayerObject().OID})
    </Binding>
     


To
Code:

<Binding name="PROJECTILETEST" header="ACTIONS">
            ClientAPI.Network.SendTargetedCommand(MarsTarget.GetCurrentTarget().OID, "/fireball")         
</Binding>


This is too much fun. Smile
Back to top Go down
rotello
Super Contributor
Super Contributor
rotello


Posts : 215
Join date : 2012-12-06

Projectile: Server/Client update SOLVED  (NOT A BUG) Empty
PostSubject: Re: Projectile: Server/Client update SOLVED (NOT A BUG)   Projectile: Server/Client update SOLVED  (NOT A BUG) EmptyThu 28 Mar - 20:28

Hey Koron,

I'm also getting a BigInteger error log and have no clue where to set long OIDs. Do you have a sample file(s) that I can check out? Smile
Back to top Go down
Delurin
Head of Platform Development
avatar


Posts : 424
Join date : 2011-08-03

Projectile: Server/Client update SOLVED  (NOT A BUG) Empty
PostSubject: Re: Projectile: Server/Client update SOLVED (NOT A BUG)   Projectile: Server/Client update SOLVED  (NOT A BUG) EmptyFri 29 Mar - 0:20

Basically in effect files when you execute the effect you should cast to long just to make sure (it doesnt take much processing power so its better just to be safe)

Code:
def ExecuteEffect(self, targetOID, sourceOID):
   
        # convert the object IDs sent from the server to the actual WorldObjects
        target = ClientAPI.World.GetObjectByOID(long(targetOID))
        caster = ClientAPI.World.GetObjectByOID(long(sourceOID))

this function requires longs
Code:
ClientAPI.World.GetObjectByOID(variableName)

so just add a long() to it
Code:
ClientAPI.World.GetObjectByOID(long(variableName))

And that should fix your problem
Back to top Go down
rotello
Super Contributor
Super Contributor
rotello


Posts : 215
Join date : 2012-12-06

Projectile: Server/Client update SOLVED  (NOT A BUG) Empty
PostSubject: Re: Projectile: Server/Client update SOLVED (NOT A BUG)   Projectile: Server/Client update SOLVED  (NOT A BUG) EmptyFri 29 Mar - 1:37

Thanks Delurin, I will try that out.
Back to top Go down
rotello
Super Contributor
Super Contributor
rotello


Posts : 215
Join date : 2012-12-06

Projectile: Server/Client update SOLVED  (NOT A BUG) Empty
PostSubject: Re: Projectile: Server/Client update SOLVED (NOT A BUG)   Projectile: Server/Client update SOLVED  (NOT A BUG) EmptySat 30 Mar - 18:20

Still no luck, I have modified the TestProjectile.py lines 32 - 33 below

Code:

        target = ClientAPI.World.GetObjectByOID(long(targetOID))
        caster = ClientAPI.World.GetObjectByOID(long(sourceOID))

Added this set of code to extension_proxy.py:

Code:
class ProjectileCommand (ProxyPlugin.CommandParser):
    def parse(self, cmdEvent):
        playerOid = cmdEvent.getObjectOid()
        targetOid = cmdEvent.getTarget()
        projectilemsg= AnimationClient.InvokeEffectMessage(playerOid, "TestProjectile")
        projectilemsg.setProperty("targetOID", targetOid)
        projectilemsg.setProperty("sourceOID", playerOid)
        Engine.getAgent().sendBroadcast(projectilemsg)

proxyPlugin.registerCommand("/projectile", ProjectileCommand())

And set Bindings.xml to Koron's code (Note that he used /fireball instead of /projectile which is the correct and registered command above

Code:

<Binding name="PROJECTILETEST" header="ACTIONS">
                ClientAPI.Network.SendTargetedCommand(MarsTarget.GetCurrentTarget().OID, "/projectile")
        </Binding>


This is the error log I'm getting...

Code:
ERROR [2013-03-30 15:25:20,169] SQ-Message-4        SQ MessageCallback multiverse.server.util.MVRuntimeException: MVByteBuffer.putEncodedObject: no support for object of class class java.math.BigInteger
      at multiverse.server.network.MVByteBuffer.putEncodedObject(MVByteBuffer.java:496)
      at multiverse.server.network.MVByteBuffer.putPropertyMap(MVByteBuffer.java:646)
      at multiverse.mars.plugins.AnimationClient$InvokeEffectMessage.toBuffer(AnimationClient.java:130)
      at multiverse.server.plugins.ProxyPlugin$InvokeEffectHook.processMessage(ProxyPlugin.java:2182)
      at multiverse.server.plugins.ProxyPlugin$MessageCallback.doWork(ProxyPlugin.java:727)
      at multiverse.server.util.SQThreadPool.run(SQThreadPool.java:106)
      at java.lang.Thread.run(Thread.java:722)


Am I still missing something here?
Back to top Go down
Sponsored content





Projectile: Server/Client update SOLVED  (NOT A BUG) Empty
PostSubject: Re: Projectile: Server/Client update SOLVED (NOT A BUG)   Projectile: Server/Client update SOLVED  (NOT A BUG) Empty

Back to top Go down
 
Projectile: Server/Client update SOLVED (NOT A BUG)
Back to top 
Page 1 of 1
 Similar topics
-
» Can run client in --standalone only?>>>>Solved
» Server STARTUP FAILED >>> SOLVED
» DEMO WORLD SERVER UPDATE
» Server and Client on same computer
» Connecting the client to a server which is not localhost

Permissions in this forum:You cannot reply to topics in this forum
 :: Development :: Bugs and Issues-
Jump to: