playerelite's Forum Posts

  • I think this was a problem in my code (maybe the fact my Sprite is called "object" ?). I recoded everything and now it works

  • Hey

    So I'm currently working on a game which is 95 % made with Python and I want to pick an object by comparison using python and the objectname.PickByCompare

    The problem is that it's not working :/

    myObject.PickByCompare(myObject.Value("name"), ==, "test")
    [/code:p3nvxps0]
    
    I think that I must do something like (for each object -> pick by comparison) but I don't know how to do this 
    
    Any idea  ?
  • Yes ofc :p

  • Well I'll give a look

    The reason I'm doing this in python is that because the game will be 99% editable, I want to let users mod what they want using python (editing txt python file then they are executed by construct)

    Edit : another reason is that with python I can have temp variables and with events I'd have to create useless global variables...

    Edit 2 : String addition is not the reason, if I replace all my script by anything in python (example : print "hello") it shows me the error message too...

  • Hello,

    I am currently working on a new project and I'm using python, the problem is that when I start the game, I have an error message and I don't have any idea of where it comes from.

    For the moment the game only have this code (and it works) :

    import os.path
    
    totalObjects = INI.ItemValue("objectsList", "objects")
    objects = 0
    line = 0
    lineObjects = 0
    
    while objects < totalObjects:
    	objects += 1
    	lineObjects += 1
    	if lineObjects > 5:
    		line += 1
    		lineObjects = 1
    	objx = (745 + ((lineObjects - 1)* 55))
    	objy = 105 + (line * 55)
    	System.CreateByName("object", 1, objx, objy)
    	SOL.object.SetValue("name", INI.ItemString("objectsList", objects))
    	if os.path.isfile(System.AppPath + "images/" + SOL.object.Value("name") + ".png"):
    		SOL.object.LoadFrameFromFile(System.AppPath + "images/" + SOL.object.Value("name") + ".png")
    	else:
    		SOL.object.LoadFrameFromFile(System.AppPath + "images/undefined.png")
    [/code:zdl4z7u6]
    
    But I get this when I start the game  (I click ok and then everything works fine, I mean, the code above do what he must do) :
    [code:zdl4z7u6]
    ---------------------------
    Error
    ---------------------------
    Traceback (most recent call last):
      File "<string>", line 1387, in <module>
    TypeError: Error when calling the metaclass bases
        __init__() takes exactly 1 argument (4 given)
    
    ---------------------------
    OK   
    ---------------------------
    [/code:zdl4z7u6]
    
    Has anyone an idea of how to fix this  ?
    
    Thanks in advance 
    Regards, player.elite
  • Well, thanks for your anwser

    I'll try with SpriteFont then, I tried the "outline" effect too but the line color can't be changed (white) and it's really ugly (pixelated).

    Edit : little problem, the SpriteFont's download link is broken

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hey guys !

    I am creating a multiplayer game and I want to put a black border on the username of players but I don't have any idea of how to do it, I tried to do the same text with x-1 ; y - 1 ; x + 1 ; y + 1 etc... but it looks ugly :s

    Is there any way to do it with effects or something like ? :p

    Thanks in advance

    (this is a picture of what I want if you don't understand :

  • Hello,

    I am currently working on an "open world" RPG and I want to make a map like Warcraft 3, but I don' know where to start

    Is Warcraft 3 using a special map rendering or it's just a 2d background?

    How to make Units like Warcraft 3 or League of Legends ?

    Thanks in advance

  • Ahah ^^

    It's C++ and I dont know C++ :( don't think I can make it work for Windows 7, if only someone was good in C++ here and able to make it work with windows 7 : would be amazing :D

    But I don't think someone will do this, everybody is using Construct 2 now :(

  • Hey, I'm back

    I tried to make a multiplayer game with PodSixNet but I always get errors etc..., could you please give me the source of the Network Plugin so I can edit it and make it work for Windows 7 ?

    I really need it or I need a working version :(

    Thanks in advance, playerelite

  • You can do the same thing with PodSixNet. The tutorial describes the scenario you are talking about, but there is more Python code so probably harder to understand.

    When you send a message you do something like:

    connection.send('action':'move'....data coordinates, etc)

    The event would be:

    def Network_move(self,data):

        ....code that does stuff to "data" with a message "move"

    It is all very similar, but just harder to understand at first. If you take a couple passes through the tut you should pick it up..but you need to have some basic Python skills already to fully use it.

    I already started without PodSixNet

    #!/usr/bin/python
    # coding: ascii
    import socket
    import select
    import ctypes
    
    ctypes.windll.kernel32.SetConsoleTitleA("MineGalaxy")
    
    hote = 'localhost'
    port = 1011
    
    connexion_principale = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    connexion_principale.bind((hote, port))
    connexion_principale.listen(5)
    print("http://orbit84.tk/")
    print("MineGalaxy Project: server ready")
    print("=================================")
    serveur_lance = True
    clients_connectes = []
    while serveur_lance:
    
         connexions_demandees, wlist, xlist = select.select([connexion_principale],
         [], [], 0.05)
    
         for connexion in connexions_demandees:
              connexion_avec_client, infos_connexion = connexion.accept()
    
              clients_connectes.append(connexion_avec_client)
              print '[CONNECTION] Something established connection with the server.'
         clients_a_lire = []
         try:
              clients_a_lire, wlist, xlist = select.select(clients_connectes,
              [], [], 0.05)
         except select.error:
              pass
         else:
    
              for client in clients_a_lire:
    
                   msg_recu = client.recv(1024)
    
                   msg_recu = msg_recu.decode()
                   print("[PACKET] Get : " + msg_recu)
                   
                   
                   if msg_recu == "connect":
                        client.send(b"playerConnect:map_id:name:life:shield:ship")
                   elif msg_recu == "disconnect":
                        client.send(b"playerDisconnect:name")
                   elif msg_recu == "attack":
                        client.send(b"attack:name:target")
                   elif msg_recu == "isOnline":
                        client.send(b"serverStatus:yes")
                   else:
                        client.send(b"unknownPacket:1")
    
                   #client.send(b"5 / 5") - ceci enverra un packet au client qui a envoye le packet
                   if msg_recu == "fin":
                        serveur_lance = False
    
    print("Fermeture des connexions")
    for client in clients_connectes:
         client.close()
    
    connexion_principale.close()
    

    and client :

    #!/usr/bin/python
    # coding: ascii
    import socket
    import codecs
    
    hote = "localhost"
    port = 1011
    
    clientA = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    clientA.connect((hote, port))
    
    msg_a_envoyer = b""
    
    while True:
         messageA = "isOnline"
    
         clientA.send(messageA.encode())
         messageB = clientA.recv(1024)
         messageB.decode()
         if messageB == "serverStatus:yes":
              connectbutton = 1
              
    clientA.close()
    

    But Construct don't know what encode() is :

    ---------------------------

    Erreur

    ---------------------------

    Traceback (most recent call last):

    File "<string>", line 27, in <module>

    LookupError: no codec search functions registered: can't find encoding

    ---------------------------

    OK   

    ---------------------------

    What do you think is the best to do, continue using socket library or use PodSixNet ?

    Regards, playerelite

  • Thanks for the offer Jayjay. I really need someone to try to compile it in Visual Studio 2012 with the compilation target of XP - 2012 so it can be more platform neutral.

    I thinking there is some type of incompatibility with VS 2012 and the COnstruct SDK or it is something with the new version of ENET no longer working with the plugin and I will have to manually go through the pain of troubleshooting (which took days with the original plugin). Have to put print statements all over the place with a painful compile, copy plugin, and run scenario.

    I just wanted to get a feel that other folks have built CC plugins with VS 2012 to rule out that issue.

    I am now looking to another way with PodSixNet, I saw your tutorial and examples files but there is something I don't like, the server is doing directly what the client saw.

    I want to make something like the Network Plugin with PodSixNet

    Like a function "sendPacket" and an event onPacket()

    Could you please explain me how to ?

    Thank

  • Another question, is it possible to access a VB.NET server with the Network plugin, because I started doing my server in VB but I can't connect with the network plugin :/

  • May be possible using emscripten:

    https://npmjs.org/package/enet

    I haven't quite wrapped my brain around how this would work and if it needs WebRTC to facilitate talking to the networking library. Perhaps something like Bananabread game demo which actually uses an ENET core.

    All of this is probably too time intensive for me to even consider...so answer practically is no right now.

    No problem, I found another way with HTTP object, btw can you fix error with Windows 7 (compatibility mdoe) :s

    thank in advance :)

    regards, playerelite

  • WOW...playerelite... that is an awesome game. Gives me some inspiration for updating the plugin.

    Thanks ^^

    Hum, yeah I have some ideas and some questions too :p

    When you join a server, what are "user data" for ?

    Have channels an utility ? (reduce lags etc.. ?)

    Maybe you could add something to load, change values from sql table.

    I am currently using ini system but it's bad :p Would be great if it was possible

    to directly load, save things in sql table.

    Make game working on Windows Vista, Seven, 8 is important too, because some players don't know

    how to make running as xp compatibility mode ^^

    I don't have any other idea at the moment :)

    Good luck with the updating, regards, player.elite