Gamestudio Links
Zorro Links
Newest Posts
How to select between IB accounts by script?
by Jack_Zodiac. 06/12/26 23:17
Zorro tutorial ideas?
by pr0logic. 06/12/26 13:36
Max Number of Strategies in /Strategy folder
by Martin_HH. 06/12/26 08:50
Stooq now requires an API key
by AndrewAMD. 06/11/26 17:55
Z9 getting Error 058
by k_ivan. 06/10/26 14:38
ZorroGPT
by TipmyPip. 06/10/26 13:07
Z12 live performance
by alx. 06/09/26 20:42
Lapsa's very own thread
by Lapsa. 06/08/26 22:41
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (TipmyPip), 1,954 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Student_64151, Koti, curry, DeepxKalsi, Samed
19219 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
str_cpy bug? #436619
01/30/14 07:53
01/30/14 07:53
Joined: Dec 2010
Posts: 224
NRW, Germany
NeoJones Offline OP
Member
NeoJones  Offline OP
Member

Joined: Dec 2010
Posts: 224
NRW, Germany
Hi!
I have a problem with the multiplayer workshop from AUM 74.
In "multiplayer3.c" in line 80:
Code:
str_cpy(input_str, "#100"); // reset the input string


If I test it, there comes the text "#100" on enter key. But if I start the original server.bat and press the enter key, it works...!? I think, this is a bug?

I have Version A8.40.3 Com

Can anyone help me please?


Errors are the engine of progress.

Version: A8 Commercial
OS: Win 7 64bit
Models: Cinema 4D
Re: str_cpy bug? [Re: NeoJones] #436622
01/30/14 08:37
01/30/14 08:37
Joined: Dec 2010
Posts: 224
NRW, Germany
NeoJones Offline OP
Member
NeoJones  Offline OP
Member

Joined: Dec 2010
Posts: 224
NRW, Germany
Ok, I find it myself. Its not a bug. Here is my solution:

I changed:
Code:
str_cpy(input_str, "#100"); // reset the input string


with this:
Code:
str_cpy((input_txt.pstring)[0], str_create("#100")); // reset the input string



I think for TEXT objects its better you work with pstring.


Errors are the engine of progress.

Version: A8 Commercial
OS: Win 7 64bit
Models: Cinema 4D
Re: str_cpy bug? [Re: NeoJones] #436638
01/30/14 12:04
01/30/14 12:04
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
I think #100 only works in str_create and when defining a string globally, and not in str_cpy which only copies a content to another string...


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: str_cpy bug? [Re: sivan] #436650
01/30/14 18:00
01/30/14 18:00
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Ouh, your "solution" leaks memory.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: str_cpy bug? [Re: WretchedSid] #436655
01/30/14 19:09
01/30/14 19:09
Joined: Dec 2010
Posts: 224
NRW, Germany
NeoJones Offline OP
Member
NeoJones  Offline OP
Member

Joined: Dec 2010
Posts: 224
NRW, Germany
Thanks for your replies. yes, but it works for Me. sid Do you know a better way?

Last edited by Dragonfly; 01/30/14 19:13.

Errors are the engine of progress.

Version: A8 Commercial
OS: Win 7 64bit
Models: Cinema 4D
Re: str_cpy bug? [Re: NeoJones] #436715
01/31/14 18:07
01/31/14 18:07
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Originally Posted By: Dragonfly
yes, but it works for Me.

That sounds like a fundamental lack of knowledge in regards to memory management. Which is bad the second you start playing with dynamically allocated memory.

Originally Posted By: Dragonfly
sid Do you know a better way?

Yes. But you should google "memory leak" and use the manual to find out why it is a memory leak, what's so bad about it and how it's fixed.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: str_cpy bug? [Re: WretchedSid] #436750
02/01/14 05:16
02/01/14 05:16
Joined: Dec 2010
Posts: 224
NRW, Germany
NeoJones Offline OP
Member
NeoJones  Offline OP
Member

Joined: Dec 2010
Posts: 224
NRW, Germany
Ok, but I really don't understand, why you can't explain me about the problem.
I asked google for that, but I dont understand, whats the problem here.
This line:
Code:
str_cpy(input_str, "#100"); // reset the input string


is the original code of the workshop in AUM 74.


Errors are the engine of progress.

Version: A8 Commercial
OS: Win 7 64bit
Models: Cinema 4D
Re: str_cpy bug? [Re: NeoJones] #436756
02/01/14 10:47
02/01/14 10:47
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Yes, this code creates the string once. Yours creates a new string every time you call it.


POTATO-MAN saves the day! - Random

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1