Home  | Login  | Register  | Help  | Play 

RE: Flash Q&A thread 3

 
Logged in as: Guest
  Printable Version
All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy >> RE: Flash Q&A thread 3
Page 8 of 16«<678910>»
Forum Login
Message << Older Topic   Newer Topic >>
5/18/2007 20:05:09   
SirSchmoopy
Banned Multi



quote:

ORIGINAL: flsg

petermaxo:20 total

SirSchmoopy: O.M.G.sorry to say this, but you shouldn' start with a multiplayer game or even a chatroom, because you don't even understand the basic of a multiuser socket.
I looked at your thing, but I don't even need to see it to tell you that it won't work. imageshack?! Do you think you can just upload a single flash file on a webpage in order to run a chatroom? You need a dedicated server(most of them cost money), and you need to configure very complicated things (do you think I'm still jalous eragon?) I seggest you to learn the basic of actionscript before attempting such a big project.

BTW, did you see any big game running with a single file hosted on a webpage like imageshark?

no, but where can i find a dedicated server for free (i dont care how good it is)?

_____________________________

Sig deleted.
Post sig only once per page.
Post #: 176
5/18/2007 21:27:41   
petermaxo
Member

by the way, I checked the code in Flash and you missed a } (bold and inserted.). Also, you switch programming languages rather abruptly in the bold area.
quote:

ORIGINAL: SirSchmoopy

whts wrong with this code????
import it.gotoandplay.smartfoxserver.*
stop()
ip = "127.0.0.1"
port = 9339
smartfox = new SmartFoxClient()
smartfox.onConnection = handleConnection
smartfox.connect(ip, port)
//----------------------------------------------------------
// Handle connection response from server
//----------------------------------------------------------
function handleConnection(success)
{
if (success)
{
status_txt.text = "Connection succesfull!"
}
else
{
status_txt.text = "Can't connect!"
}
}
smartfox.onRoomListUpdate = function(roomList)
{
roomList_lb.removeAll()
for (var i in roomList)
{
var room = roomList
roomList_lb.addItem(room.getName() + " (" + room.getUserCount() + ")", room.getId())
}
roomList_lb.sortItemsBy("label", "ASC")

// Join the default room
this.autoJoin()
}
smartfox.onUserCountChange = function(roomObj)
{
updateRoomStatus(roomObj.getId())
}
function updateRoomStatus(roomId)
{
var room = smartfox.roomList[roomId]
var newLabel = room.name + " (" + room.getUserCount() + ")"
for (i=0; i < roomList_lb.getLength(); i++)
{
var item = roomList_lb.getItemAt(i)
if (roomId == item.data)
{
roomList_lb.replaceItemAt(i, newLabel, item.data)
break;
}
}
}
//----------------------------------------------------------
// Setup components callback functions
//----------------------------------------------------------
roomList_lb.setChangeHandler("changeRoom")
userList_lb.setChangeHandler("userSelected")
function changeRoom()
{
var item = roomList_lb.getSelectedItem()

// new Room id
var newRoom = item.data
if (newRoom != smartfox.activeRoomId)
{
// Check if new room is password protected
var priv = smartfox.getRoom(newRoom).isPrivate()
if (priv)
{
// Save newroom as _global for later use
_global.newRoom = newRoom
showWindow("passwordWindow")
}
else
{
// Pass the room id
smartfox.joinRoom(item.data)
}
}
var priv = smartfox.getRoom(newRoom).isPrivate()
smartfox.joinRoom(item.data)
function loginProtectedRoom(pwd)
{
hideWindow("passwordWindow")
smartfox.joinRoom(_global.newRoom, pwd)
}
joinRoom = function(newRoom, pword, dontLeave, oldRoom)
smartfox.onJoinRoomError = function(errorMsg)
{
var win = showWindow("errorWindow")
win.errorMsg.text = errorMsg

// Put the selected room in the combo box back to its old value
resetRoomSelected(smartfox.activeRoomId)
}
<Zone name="simpleChat">
<Rooms>
<Room name="The Cottage" maxUsers="70" isPrivate="false" isTemp="false" isGame="false"
autoJoin="true" />
<Room name="The Tree" maxUsers="70" isPrivate="false" isTemp="false" isGame="false"/>
<Room name="The Pool" maxUsers="70" isPrivate="false" isTemp="false" isGame="false" />
<Room name="The Bathroom(lol)" maxUsers="70" isPrivate="false" isTemp="false" isGame="false" />
<Room name="The Tradin' Place Foo!" maxUsers="70" isPrivate="false" isTemp="false" isGame="false" />
<Room name="The Big Fieldy Place Room" maxUsers="50" isPrivate="true" isTemp="false" pwd="piddu"
isGame="false" />
</Rooms>
</Zone>

createRoom(roomObj)
function makeNewRoom()
{
showWindow("newRoomWindow")
}
}
function createRoom(name, pwd, max)
{
hideWindow("newRoomWindow")

var roomObj = new Object()

roomObj.name = name
roomObj.password = pwd
roomObj.maxUsers = max

smartfox.createRoom(roomObj)
}
smartfox.onCreateRoomError = function(errorMsg)
{
var win = showWindow("errorWindow")
win.errorMsg.text = errorMsg
}
function userSelected()
{
uid = userList_lb.getSelectedItem().data

// If it's not me...
if (uid != smartfox.myUserId)
{
// store the recipient for later use
_global.pmUid = uid

var win = showWindow("pmWindow")

var uList = smartfox.getActiveRoom().getUserList()
var targetUsr = uList[uid]

win.title_txt.text = "Send a private message to " + targetUsr.getName()
}
}
function sendMessage()
{
var m = message.text
if (m.length > 0)
{
_parent.sendPrivateMessage(m, _global.pmUid)
message.text = ""
}
}
smartfox.onConnectionLost = function()
{
gotoAndStop("connect")
}
Edit: stoopid syntax error!!!


This code has no syntax errors, but it may not do what you want it to.

import it.gotoandplay.smartfoxserver.*
stop()
ip = "127.0.0.1"
port = 9339
smartfox = new SmartFoxClient()
smartfox.onConnection = handleConnection
smartfox.connect(ip, port)
//----------------------------------------------------------
// Handle connection response from server
//----------------------------------------------------------
function handleConnection(success) {
if (success) {
status_txt.text = "Connection succesfull!"
}else{
status_txt.text = "Can't connect!"
}
}
smartfox.onRoomListUpdate = function(roomList) {
roomList_lb.removeAll()
for (var i in roomList) {
var room = roomList
roomList_lb.addItem(room.getName() + " (" + room.getUserCount() + ")", room.getId())
}roomList_lb.sortItemsBy("label", "ASC")
// Join the default room
this.autoJoin()
}
smartfox.onUserCountChange = function(roomObj) {
updateRoomStatus(roomObj.getId())
}
function updateRoomStatus(roomId) {
var room = smartfox.roomList[roomId]
var newLabel = room.name + " (" + room.getUserCount() + ")"
for (i=0; i < roomList_lb.getLength(); i++){
var item = roomList_lb.getItemAt(i)
if (roomId == item.data){
roomList_lb.replaceItemAt(i, newLabel, item.data)
break;
}
}
}
//----------------------------------------------------------
// Setup components callback functions
//----------------------------------------------------------
roomList_lb.setChangeHandler("changeRoom")
userList_lb.setChangeHandler("userSelected")
function changeRoom() {
var item = roomList_lb.getSelectedItem()
// new Room id
var newRoom = item.data
if (newRoom != smartfox.activeRoomId) {
// Check if new room is password protected
var priv = smartfox.getRoom(newRoom).isPrivate()
if (priv) {
// Save newroom as _global for later use
_global.newRoom = newRoom
showWindow("passwordWindow")
}else{
// Pass the room id
smartfox.joinRoom(item.data)
}
}var priv = smartfox.getRoom(newRoom).isPrivate()
smartfox.joinRoom(item.data)
}
function loginProtectedRoom(pwd) {
hideWindow("passwordWindow")
smartfox.joinRoom(_global.newRoom, pwd)
}
joinRoom = function(newRoom, pword, dontLeave, oldRoom){
smartfox.onJoinRoomError = function(errorMsg){
var win = showWindow("errorWindow")
win.errorMsg.text = errorMsg
// Put the selected room in the combo box back to its old value
resetRoomSelected(smartfox.activeRoomId)
}
}
createRoom(roomObj)
function makeNewRoom() {
showWindow("newRoomWindow")
}function createRoom(name, pwd, max) {
hideWindow("newRoomWindow")
var roomObj = new Object()
roomObj.name = name
roomObj.password = pwd
roomObj.maxUsers = max
smartfox.createRoom(roomObj)
} smartfox.onCreateRoomError = function(errorMsg){
var win = showWindow("errorWindow")
win.errorMsg.text = errorMsg
}
function userSelected(){
uid = userList_lb.getSelectedItem().data
// If it's not me...
if (uid != smartfox.myUserId) {
// store the recipient for later use
_global.pmUid = uid
var win = showWindow("pmWindow")
var uList = smartfox.getActiveRoom().getUserList()
var targetUsr = uList[uid]
win.title_txt.text = "Send a private message to " + targetUsr.getName()
}
}
function sendMessage() {
var m = message.text
if (m.length > 0) {
_parent.sendPrivateMessage(m, _global.pmUid)
message.text = ""
}
} smartfox.onConnectionLost = function() {
gotoAndStop("connect")
}


< Message edited by petermaxo -- 5/18/2007 21:36:01 >
AQ DF  Post #: 177
5/18/2007 21:38:15   
flsg
Member

SirSchmoopy: there is no free dedicated server. The cheapest I know is 80$/month
I suggest you to learn more the basic of actionscript before using it in a more advanced way
AQ  Post #: 178
5/18/2007 22:13:06   
SirSchmoopy
Banned Multi



quote:

ORIGINAL: flsg

SirSchmoopy: there is no free dedicated server. The cheapest I know is 80$/month
I suggest you to learn more the basic of actionscript before using it in a more advanced way

kk thanks....only problem is more than half of my ideas are impossible for a begginer

_____________________________

Sig deleted.
Post sig only once per page.
Post #: 179
5/19/2007 16:29:45   
Myhos
Member

well then work on the other half, honestly if you don't know the basics of bike racing you can't go and compete in the tour de' france
Baby steps my friend, baby steps
AQ DF  Post #: 180
5/19/2007 23:51:08   
EragonZZZZ
Member


quote:

ORIGINAL: SirSchmoopy
kk thanks....only problem is more than half of my ideas are impossible for a begginer


Ummm....I really really hate to say this, but....then you really can't do them now.

For my walkaround, I'd been scripting, like 3 months, but even then I'd been programming for 5 years. And the code in that walk around absolutely stunk. Flat out garbage code.
Although it sure did what I wanted it too :{P

_______________________________________
on a different topic, flsg now owes us about 30 bucks.

and yo, I gots a scripting challenge to flsg only! everybody who feels like it. Using the LEAST possible amount of code that takes the LEAST amount of memory, collide two circles on a plane.
Specs:
1. Circles must collide and respond accurately. A simple ceasing of motion is good enough for me.
2. One or both circles must be controllable in some way
3. Circles are symbols (movieclips) but code can be anywhere as long as it is organized.
4. The only objects on the plane are the two circles.

If you finish this flsg whoever enters, post your .swf and .fla files here. I want to see how my method measures up to what flsg you all come up with
AQ  Post #: 181
5/20/2007 20:00:58   
SirSchmoopy
Banned Multi


how do i uninstall flash 8?!?!?! plz tell me plz!!! i wanna make a crappy starcraft game so bad!!!

_____________________________

Sig deleted.
Post sig only once per page.
Post #: 182
5/21/2007 12:36:42   
flsg
Member

SirSchmoopy: ..........just click uninstall in the start menu
but I don't think LBB's trick can work
you want to make a starcraft with flash? sorry but it's impossible for you now(I didn't say I can, and I'm NOT jalous lol)
eragon: what do you mean by collide and respond accurately?

_____________________________

My flash gallery
my game thread

flsg, proud old member of AQ(still playing :O)
AQ  Post #: 183
5/21/2007 16:07:21   
Myhos
Member

yea flsg is right, First of all you need a massive amount of code for a crappy AI, and even more for a good one. Then the....ah hell....look at the moment you honestly are just starting codeing with flash..which you don't even own your own legal copy...which can be a problem...and whats-his-name method will NOT WORK. that is unless you have a cracked or illegal version which would mean by the time you publish your ground breaking game you get your self sued to kingdom come. Also Star craft in flash is just impossible, or at the least the swf file would be huge and the movie would take an hour to load.
AQ DF  Post #: 184
5/22/2007 15:50:58   
EragonZZZZ
Member

Oops, forgot that spec.

like, if its touching a circle, it will not penetrate the outer border of the circle.

which means that code for circling the perimeter might be neccessary, something i didn't think of :P
AQ  Post #: 185
5/22/2007 18:52:52   
somebody621
Member

Eragon: Hehe... I have the code, I just don't feel like implementing it. XD You did see my demo. It was capable of handling ball versus ball collisions, but I needed different code on the main frame. Also, I have to change my integration method to verlet or RK4 (which I have also coded already, just only with basic particles, not circles, but its the same thing). And with collision formulas, I am THIS CLOSE to getting SAT working (I started it earlier (didn't finish it), but then gave up, but then I have to relearn what my code was about now).

Myhos: meh... with AS3, the speed is amazing, and since starcraft is 2D, it just MIGHT be possible, but DEFINATELY NOT FOR A BEGINNER.

SirSchmoopy: don't get so impatient. You need to learn the basics first. And unless you have flash 9, it'll be impossible.

< Message edited by somebody621 -- 5/22/2007 19:00:10 >
Post #: 186
5/22/2007 19:06:28   
EragonZZZZ
Member

Yay! I remember you!

You actually gave me that idea. XD

Although what I do is I simply see if the distance between the center of the circles is less than the sum of the radii :P



Gosh DARN it, I just don't have the time to LEARN AS 3.0, gonna be way too hard (I'm already unlearning AS 2.0 AND Visual Basic XP)

and yeah, you can't get flash 9 until you own flash 8

and @ myhos, no you don't, i can make a crappy AI with 10 lines of code. Including lines that just contain


}

on them.
AQ  Post #: 187
5/22/2007 19:18:14   
somebody621
Member

Actually, flash CS3 (flash 9) is out. I just use flex. For my collision detection demo, I actually didn't use projection, but rather sweep tests. I found these faster AND more accurate, strangely enough. However, yes, for mutliple circles colliding, projection is probably the way to go (if you use sweep tests, you may be able to use impulses, which is what I'm aiming toward with my SAT code).

< Message edited by somebody621 -- 5/22/2007 19:22:07 >
Post #: 188
5/22/2007 23:00:07   
Myhos
Member

quote:

ORIGINAL: EragonZZZZ

and @ myhos, no you don't, i can make a crappy AI with 10 lines of code. Including lines that just contain


}

on them.

Ah but i mean as in a easy handicaped AI but it still implies a Good AI code

as for loading times, really? despite having a a large amount of the adobe cs3 stuff i haven't had the time to mess around too much with flash action script

and once more yea flash 9 aka cs3 has been out now for some time, and i have it: here

< Message edited by Myhos -- 5/22/2007 23:03:37 >
AQ DF  Post #: 189
5/23/2007 14:27:26   
Lightles
Member

This might be asked before, but I couldn't find it anywhere, so I'll ask it.

I have Flash8 for a few weeks now, and I'm trying some things to hope it will look a bit better.
So I recently discovered the magic window called "Color Mixer" and not knowing that I was making alot of those arrow-thingies to make radient more colorful, I have like 10-20 of those thingies right now and I'm just wondering how can I reset it to just 2 arrow-thingies?

And for those who want to know how *couch* great *couch* I am... The actionscripting is like a zillion room dungeon with only one outway at the end to me, and the only thing I can currently draw well are stickfigures and swords in DF style without shades.

Thank you.
AQ DF  Post #: 190
5/23/2007 14:35:51   
EragonZZZZ
Member


quote:

ORIGINAL: Myhos

Ah but i mean as in a easy handicaped AI but it still implies a Good AI code

as for loading times, really? despite having a a large amount of the adobe cs3 stuff i haven't had the time to mess around too much with flash action script

and once more yea flash 9 aka cs3 has been out now for some time, and i have it: here


ah, true, you would be right.

somebody621, how do you integrate flash and flex with each other?
Can you use flash 8 with flex?

and myhos, how dare you show me a picture like that. You is evil ;________________;
AQ  Post #: 191
5/23/2007 16:18:48   
dominic_r_monroe
Member

i haven't any knowledge of coding and wish to have someone to teach me
AQ  Post #: 192
5/23/2007 18:11:02   
flsg
Member

lightnes: I think you should click the arrows with right mouse
eragon: what?! Wow, I thought it would be more difficult than that, like predict the moves after the collision, etc
if it only need to be accurate, then:

var radius1=_root.circle1._height/2, radius2=_root.circle2._height/2
_root.onEnterFrame=function(){
if(radius1+radius2+this.circle1.moveDistance+this.circle2.moveDistance<distanceBetween2Circles){
.........................code to move the circles normally
}
}else{
this.circle1.newMoveDist=distanceBetween2Circles*(this.circle1.moveDistance+this.circle2.moveDistance)/this.circle1.moveDistance
this.circle2.........................//same thing, just get the distance that each circle should move when their next move will collide (by getting the proportion of the distance that each circle should use)
}....................

}

I'm not very clear in my code, and I didn't write the calculations for the distances and how the circles should move, but I think you guys understand what I want to do.
this SHOULD produce a perfect collision
AQ  Post #: 193
5/23/2007 21:04:20   
Myhos
Member


quote:

ORIGINAL: EragonZZZZ
and myhos, how dare you show me a picture like that. You is evil ;________________;


Muhahahha Hell i don't know what half of the cs3 programs do...lol i only know Photoshop, Flash and Dream weaver, the rest (bridge, Illustrator, and InDesign) i have no idea who to use XD also all of this is on a mac.

now for lightness, you drag the points/arrows up or down and they should go away
AQ DF  Post #: 194
5/24/2007 11:58:13   
Lightles
Member

quote:

ORIGINAL: flsg

lightnes: I think you should click the arrows with right mouse



That's odd, it doesn't work... They still won't go away.
AQ DF  Post #: 195
5/24/2007 20:42:30   
flsg
Member

lightnes: oops sorry...it's ctrl+left mouse
AQ  Post #: 196
5/25/2007 11:44:52   
Lightles
Member

Yay it works! Thank you.
AQ DF  Post #: 197
5/27/2007 18:01:27   
EragonZZZZ
Member

FLSG, is that AS 3.0 or 2.0?
AQ  Post #: 198
5/28/2007 16:50:45   
flsg
Member

2.0, why? I didn't make any classes
AQ  Post #: 199
5/28/2007 17:36:29   
EragonZZZZ
Member

No, because I always know you to use whatever scripting language is the newest/hardest :D

Plus, in leu (sp?) of an AS 3.0 tutorial book, I've been looking at examples and teaching myself. Good thing I didn't try to learn from that XD

and no classes? *gasp*

SHAME on you :D
AQ  Post #: 200
Page:   <<   < prev  6 7 [8] 9 10   next >   >>
All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy >> RE: Flash Q&A thread 3
Page 8 of 16«<678910>»
Jump to:






Icon Legend
New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts




Forum Content Copyright © 2018 Artix Entertainment, LLC.

"AdventureQuest", "DragonFable", "MechQuest", "EpicDuel", "BattleOn.com", "AdventureQuest Worlds", "Artix Entertainment"
and all game character names are either trademarks or registered trademarks of Artix Entertainment, LLC. All rights are reserved.
PRIVACY POLICY


Forum Software © ASPPlayground.NET Advanced Edition