Official Community Forums
 
HomeHome  FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  Log in  The Wiki  Website  github Project  

Share | 
 

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

View previous topic View next topic Go down 
AuthorMessage
Guest
Guest



PostSubject: Projectile: Server/Client update SOLVED (NOT A BUG)   Sat 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.





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


Posts : 424
Join date : 2011-08-03

PostSubject: Re: Projectile: Server/Client update SOLVED (NOT A BUG)   Sat 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



PostSubject: As always   Sat 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



PostSubject: Cast to Long()   Fri 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

Back to top Go down
Delurin
Head of Platform Development


Posts : 424
Join date : 2011-08-03

PostSubject: Re: Projectile: Server/Client update SOLVED (NOT A BUG)   Fri 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



PostSubject: Pointed me in the right dir though   Fri 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



PostSubject: Key bindings   Sat 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
avatar

Posts : 215
Join date : 2012-12-06

PostSubject: Re: Projectile: Server/Client update SOLVED (NOT A BUG)   Thu 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


Posts : 424
Join date : 2011-08-03

PostSubject: Re: Projectile: Server/Client update SOLVED (NOT A BUG)   Fri 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
avatar

Posts : 215
Join date : 2012-12-06

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

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

Posts : 215
Join date : 2012-12-06

PostSubject: Re: Projectile: Server/Client update SOLVED (NOT A BUG)   Sat 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




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

Back to top Go down
 
Projectile: Server/Client update SOLVED (NOT A BUG)
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Chinese Client on US Server?
» Rules And Codes of Conduct [VIP SERVER] Last Update: 06/02/2014
» Solved: log on netease servers with US client
» 3.3.5 modified client to 4.0.1 problems--
» WoW china is back+need to update to 3.1.3+new realmlist

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