He Everyone,
I am new in this forum, i am trying some cool features with smartoxserver and alternativaplatform. I just came up with an idea to create objects in the 3d enviroment that everyone can see example a Sprite3d bullet or putting a turret to the sceen etetc. How can i achieve that thing? How will in sfs the object syncronised? Can anyone show me some examples about that? Thank you very much!
Good Day!
Creating objects bulets,towers,boxes in the game "word""
Re: Creating objects bulets,towers,boxes in the game "word""
Hi.
I suggest you to check the Unity Examples, to better understand how to integrate SFS2X with the 3d environment:
http://docs2x.smartfoxserver.com/Exampl ... troduction
I suggest you to check the Unity Examples, to better understand how to integrate SFS2X with the 3d environment:
http://docs2x.smartfoxserver.com/Exampl ... troduction
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Re: Creating objects bulets,towers,boxes in the game "word""
Thans for answer. Am i have a 3d enviroment where players moving jumping on the x,y,z my problem is creating objects example droping my weapon to the ground that everyone can se or pick up.
Edit: I asume that a droped item is not an NPC than what is it? How can i create a player created object?:) Thank you for help!
Edit: I asume that a droped item is not an NPC than what is it? How can i create a player created object?:) Thank you for help!
Re: Creating objects bulets,towers,boxes in the game "word""
Well, maybe you could use an SFSObject as a RoomVariable which would store all the objects that had been dropped, but this variable would only be used by the users that were joining the room. For the other users that are already in the room, you simply use a ObjectMessageRequest to send the object information (id, position, etc.).
Of course the best option would be to control all the game from the server, and so you would store the dropped objects in a list in an Extension.
Of course the best option would be to control all the game from the server, and so you would store the dropped objects in a list in an Extension.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Re: Creating objects bulets,towers,boxes in the game "word""
Hm. I'm trying to shoot a bullet with sfs.objectmessage but i havent found any example about it:
How will other see my object created and moving?
Code: Select all
protected function onRightClickNow(event:MouseEvent):void
{
sfs.addEventListener(SFSEvent.OBJECT_MESSAGE, onObjectMessage);
bullet=new Bullet()
bullet.x = myplayer.x
bullet.y = myplayer.y
bullet.z = myplayer.z+50
bulletDirection.x = 100*Math.cos(camera.rotationX + (Math.PI/2)) * Math.sin(-camera.rotationZ);
bulletDirection.y = 100*Math.cos(-camera.rotationZ) * Math.cos(camera.rotationX + (Math.PI/2));
bulletDirection.z = 100*Math.sin(camera.rotationX + (Math.PI/2));
scene.addChild(bullet)
bullet.registerCollisionObject(scene);
[b] var dataObj:ISFSObject = new SFSObject();
dataObj.putInt(bullet.x, myplayer.x);
dataObj.putInt(bullet.y, myplayer.y);
sfs.send(new ObjectMessageRequest(dataObj));[/b]
}
private function onObjectMessage(evt:SFSEvent):void
{
//Dont know how to describe this event
}
Re: Creating objects bulets,towers,boxes in the game "word""
Pf. Made it in 10 minutes...
Thanks anyway:)
Thanks anyway:)