[ SOLVED ] Was Wondering Has Any One Here Used EASY-ONLINE Add-On

Hey all.

Wondering if anyone here has used this blender game engine add-on called :arrow_down:

EASY-ONLINE

I have used it & it fully works.
However my question is somewhat complex.

My question is :arrow_right: How to get the custom-properties list to NOT keep resetting
( I can’t make a full online game due to this EXTREME bug )

1 Like

Guess it’s safe to say the answer is no.

It’s well-nigh a thousand lines worth of py on an unfinished project. I’m not saying set aside a day or two, brew some coffee and acquaint yourself with the code to the point where locating the bug becomes a trivial matter, but that’s probably your best bet.

@Liebranca

I can’t work with it. I don’t think anyone else could :slight_smile: the bug makes it so I can’t make a single properties without it resetting the list & that makes the whole online framework code die.

Thx for the suggestion btw.

?

Ok @wkk lesson time :panda_face:

So the game-properties that the client use’s gets sent to the server.
Blender makes a script file.
You put ALL your game-properties names there so they are sent (so things like health & ammo are checked on all clients)
It’s bad enough that you have to put EVERY name of game-properties for EVERY object that you want updated.
But there is a MAJOR bug in the add-on that makes that script file ERASE EVERY SINGLE game-property word that you typed previously for that certain script file WHEN you add ANY game-property on ANY object.

could be an issue with the internal text editor.

seems like an awful way to do this, any config should be read only. maybe someday ill look into this.

@Daedalus_MDW

I have known that I get this error :arrow_down: it’s just I haven’t been able to fix it so just assumed bug.

[ EDIT ]
Crap. Totally forgot to post this console_error :arrow_down:

update_arguement

Never touched it myself. Sorry:/.
It looks really promising though!

1 Like

@Thomas_Murphy

No problem. Thx for taking the time to reply :panda_face: :+1:

The name of this file is Data.py, right? Because this line

bpy.data.texts["Data.py"].clear()

Is run anytime the handler Update_GameProperty gets called. Now I’m not going to pretend I understand the inner workings of the code because I don’t, but what I can do is connect the dots and assume that the file is being wiped and re-written anytime certain changes are made.

What you need to do is copy the section of the text file that has your property names before the wipe occurs, then write it back on the file after it’s been updated.

Hey @Liebranca

Are you talking about BPY code or MANUAL copy & paste (?)
Because I already tried MANUAL & it’s just too time consuming not to mention not enough space since it’s ALL in one line of code . . . (MAJOR design flaw)

Manual copy and paste? We don’t do things by hand here!

I’m talking about fixing the addon’s code. Look at init.py, line 32.
That’s where the data file is rendered blank and then filled out with updated dicts.
So, one line before this, have python grab the property values.
Then after the wipe, have python insert the copied text back in.

The addon won’t install correctly for some reason, so I don’t know how this text file looks.
Paste it here and I can code a solution.

@Liebranca

The BGE code = 4 scripts.
Client. Server. Init. Properties.

BPY code = 1 script.

Which are you requesting :thinking:

Btw can’t you just download the scripts your self (?) It’s an add-on & I posted a link to the video.

( Thank you for your time btw )

The addon doesn’t work on my end. I’m just reading the code.

Only text file being modified through python is a certain “Data.py”, so that’s what I want to look at.
Do you have this file?

Hi again @Liebranca

Yes. I have :arrow_down:

Data.py

I know this is the ROOT problem. It keeps resetting. Should I make a video so you & others can understand my problem (?)

Interesting.

I need to see how Data.py looks with properties added.

These are all the SERVER OPTIONS + CLIENT properties from Data.py
(Also a lot of my object names. They might confuse you so just ignore them :stuck_out_tongue:)

Network=[‘localhost’, 80, 3, ‘Name’, 0, 4096]
Transmitters={‘MAIN: WeaponHub’: [‘CLIENT’, ‘REP: WeaponHub’, 0, [[‘worldPosition’, 0, 0, False], [‘worldOrientation’, 0, 0, False], [‘FIRE_DELAY’, 0, 0, False]]], ‘MAIN: Player’: [‘CLIENT’, ‘REP: Player’, 0, [[‘worldPosition’, 0, 0, False], [‘FIRE_DELAY’, 3, 0, False], [‘worldScale’, 0, 0, False], [‘HEALTH’, 0, 0, False], [‘MOVE’, 0, 0, False], [‘CROUCH’, 0, 0, False], [‘JUMP’, 0, 0, False], [‘DAMAGED’, 0, 0, False], [‘’, 0, 0, False]]]}
Observers={‘REP: Player’: [[‘Bullet’, ‘Health’, ‘ADD’, ‘-25’, ‘’]], ‘REP: WeaponHub’: }

I repeat my question → Should I make a video so you can see the bug in action (?)

No need for a video, this is good enough.
I’ll get down to coding a solution.

@Liebranca

The line

“Transmitters”

ALL disappears when you create a new game-property.

Alright, I switched to another build and now it installed properly.

Added a small change to the init so the transmitters line is saved; now it won’t reset.
This is not optimal though. If you delete an object, you still have to remove it from transmitters manually. And since I’m already looking at this I think it’s better to patch it up for real.

But to have the dictionaries update properly I’ll need to peek deeper into the scripts, that could take me a good while or a little bit, I don’t know.

In the meantime, you can just paste this quick and dirty fix into init, line 32.

        s = ""
        for line in bpy.data.texts["Data.py"].lines:
            if "Transmitters" in line.body:
                s = str(line.body)
                break

        bpy.data.texts["Data.py"].clear()
        bpy.data.texts["Data.py"].write("Network="+str([scn.IP, scn.Port, scn.Connection_Attempts, scn.Name, scn.Max_Players, scn.Size_Buffer])+"\n"+s+"\nObservers="+str(Observer_dictonary))
1 Like