May 25, 2024, 06:31:35 pm

The Gang Garrison 2 Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

NOTICE: Wondering where all the forums have gone?

Join the community Discord server!

Pages: 1 ... 30 31 [32] 33 34 ... 77

Author Topic: Official PyGG2 Development thread  (Read 144761 times)

Vindicator

  • Developer
  • ******
  • Karma: 84
  • Offline Offline
  • Posts: 2398
    • http://www.kylemoy.org/
Re: Porting GG2 to Python - PyGG2
« Reply #465 on: January 18, 2012, 05:21:15 pm »

Quote
Traceback (most recent call last):
  File "C:\Workspace\PyGG2\src\make.py", line 22, in <module>
    client.profileGG2()
AttributeError: 'module' object has no attribute 'profileGG2'

Halp. This thing hates me TT_TT
Logged

Orpheon

  • Moderator
  • *****
  • Karma: 15
  • Offline Offline
  • Posts: 6409
  • Developer
Re: Porting GG2 to Python - PyGG2
« Reply #466 on: January 19, 2012, 04:57:19 am »

Quote
Traceback (most recent call last):
  File "C:\Workspace\PyGG2\src\make.py", line 22, in <module>
    client.profileGG2()
AttributeError: 'module' object has no attribute 'profileGG2'

Halp. This thing hates me TT_TT
Had the same problem, and simply commented the profiling out.
Bad solution, but working one.

Pull again.
Logged

Dusty

  • 2012 Haxxy Award Winner
  • *
  • Karma: -78
  • Offline Offline
  • Posts: 10312
  • Dust in a box under a table
Re: Porting GG2 to Python - PyGG2
« Reply #467 on: January 20, 2012, 05:38:38 pm »

So, how would I go about doing string comparison/editing? Is it as simple as "str1 = str2+str3" and "if str1 == str4"? Or will I need another module/extention thing?

nightcracker

  • NC
  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 516
  • PyGG2 dev
    • NC Labs
Re: Porting GG2 to Python - PyGG2
« Reply #468 on: January 21, 2012, 03:15:08 am »

So, how would I go about doing string comparison/editing? Is it as simple as "str1 = str2+str3" and "if str1 == str4"? Or will I need another module/extention thing?

These are all the string methods: http://docs.python.org/library/stdtypes.html#string-methods

In addition strings have comparison (==, != but also < and > for alphabetical ordering), concatenation (+), repeat (*) and formatting operator (%).

This should give some examples:
Code: [Select]
>>> s1 = "foo"
>>> s2 = "bar"
>>> s1 + s2
'foobar'
>>> s1 == "foo"
True
>>> s2 == "ber"
False
>>> s2 < s1
True
>>> s1 * 4
'foofoofoofoo'
>>> "This is a number: %d" % (7)
'This is a number: 7'
Logged

Vindicator

  • Developer
  • ******
  • Karma: 84
  • Offline Offline
  • Posts: 2398
    • http://www.kylemoy.org/
Re: Porting GG2 to Python - PyGG2
« Reply #469 on: January 21, 2012, 03:38:47 pm »

Code: [Select]
>>> s1 * 4
'foofoofoofoo'

Oh god I love python.
Logged

NAGN

  • Developer
  • ******
  • Karma: 146
  • Offline Offline
  • Posts: 16150
  • Yeah so now I have an idea
Re: Porting GG2 to Python - PyGG2
« Reply #470 on: January 23, 2012, 11:11:21 pm »

:o
Logged

CandleJack

  • Seasoned Member
  • *****
  • Karma: 3
  • Offline Offline
  • Posts: 2029
  • +15/-130
    • SushiGaming
Re: Porting GG2 to Python - PyGG2
« Reply #471 on: January 24, 2012, 02:31:52 pm »

You guys should post a progress bar in the OP.
Logged
I'm gonna need more rope...


Shamefully Stolen

Orpheon

  • Moderator
  • *****
  • Karma: 15
  • Offline Offline
  • Posts: 6409
  • Developer
Re: Porting GG2 to Python - PyGG2
« Reply #472 on: January 24, 2012, 02:35:31 pm »

You guys should post a progress bar in the OP.
A progress bar shows something which can be mesured in percentage. This can't be.

We don't know the amount of code, lines, or even features that'll be in at completion. How do you expect us to give a progress bar?
Logged

Rodoval

  • Seasoned Member
  • *****
  • Karma: 8
  • Offline Offline
  • Posts: 3937
  • It's been 8 years already, am I oldfag yet
Re: Porting GG2 to Python - PyGG2
« Reply #473 on: January 24, 2012, 05:13:52 pm »

Yeah because that usually turns out for the best.
Logged

read this post about minors without looking at the last page first, and I thought you were encouraging rodo to hunt for young women.

Orpheon

  • Moderator
  • *****
  • Karma: 15
  • Offline Offline
  • Posts: 6409
  • Developer
Re: Porting GG2 to Python - PyGG2
« Reply #474 on: January 25, 2012, 01:13:41 am »

That's a service we are unable to provide.

If you want to register a complaint, please do so at our customer service here.
Note: The server might be down temporarily. Thank you for your understanding.
« Last Edit: January 25, 2012, 01:14:08 am by Orpheon »
Logged

Nukleus

  • Guest
Re: Porting GG2 to Python - PyGG2
« Reply #475 on: January 25, 2012, 02:46:19 am »

N/A%
Logged

nightcracker

  • NC
  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 516
  • PyGG2 dev
    • NC Labs
Re: Porting GG2 to Python - PyGG2
« Reply #476 on: January 25, 2012, 02:54:11 am »

Logged

nightcracker

  • NC
  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 516
  • PyGG2 dev
    • NC Labs
Re: Porting GG2 to Python - PyGG2
« Reply #477 on: January 25, 2012, 06:59:21 am »

NaN means Not a Number.
Logged

Orpheon

  • Moderator
  • *****
  • Karma: 15
  • Offline Offline
  • Posts: 6409
  • Developer
Re: Porting GG2 to Python - PyGG2
« Reply #478 on: January 27, 2012, 07:59:28 am »

I noticed that there is no clear consensus with the struct commands on which endianess we use. I think we should set one, because native isn't always reliable.
Native byte order is big-endian or little-endian, depending on the host system. For example, Intel x86 and AMD64 (x86-64) are little-endian; Motorola 68000 and PowerPC G5 are big-endian; ARM and Intel Itanium feature switchable endianness (bi-endian). Use sys.byteorder to check the endianness of your system.
For the Player input, we even used
Code: [Select]
bytestr = struct.pack("!BH", keybyte, aim)which I don't completely understand.
The form '!' is available for those poor souls who claim they can’t remember whether network byte order is big-endian or little-endian.
This doesn't forebode much good, but I'm probably missing something here. Does it try to guess what endianness we use or what?
« Last Edit: January 27, 2012, 08:02:06 am by Orpheon »
Logged

nightcracker

  • NC
  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 516
  • PyGG2 dev
    • NC Labs
Re: Porting GG2 to Python - PyGG2
« Reply #479 on: January 27, 2012, 08:22:03 am »

Well, until Medo makes the lobby code sane we have to follow the lobby endianness for the server-side lobby code. In all the other cases we should decide for ourselves, and so I will:


Big-endian


Why? Because big-endian is the most often used for networking, and because it's an arbitrary choice anyway.
Logged
Pages: 1 ... 30 31 [32] 33 34 ... 77
 

Page created in 0.036 seconds with 65 queries.