Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, degenerate_762), 1,309 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
var_for_name() ??? execute();??? #177793
01/14/08 07:33
01/14/08 07:33
Joined: Aug 2004
Posts: 1,305
New York
PrenceOfDarkness Offline OP
Serious User
PrenceOfDarkness  Offline OP
Serious User

Joined: Aug 2004
Posts: 1,305
New York
Okay, i'm working on a multiplayer game. I want to send a string for the players to execute on the local computers. The problem isn't that they aren't recieving the string, instead, the problem seems to be execute();. It simply just wont work. So I read the manual, and var_for_name() I'm guessing should be used instead when you want to change a variable. Well... it just doesn't seem to work. Do they not work in C-lite? Or is it a logic error/syntax error on my end?


"There is no problem that can't be solved with time and determination." -me
prenceofdarkness for instant messages on AIM.

Looking for a model designer
PLEASE, SEND ME A PRIVATE MESSAGE OR EMAIL IF YOU'RE INTERESTED.
Re: var_for_name() ??? execute();??? [Re: PrenceOfDarkness] #177794
01/14/08 08:00
01/14/08 08:00
Joined: Aug 2004
Posts: 1,305
New York
PrenceOfDarkness Offline OP
Serious User
PrenceOfDarkness  Offline OP
Serious User

Joined: Aug 2004
Posts: 1,305
New York
sorry for wasting your time guys... Incase anyone else had this problem, all you need to do is change any STRING* name = ""; to STRING* name "#n"; where n = how big you need the string to be... THIS MAKES MY LIFE 10X EASIER!


"There is no problem that can't be solved with time and determination." -me
prenceofdarkness for instant messages on AIM.

Looking for a model designer
PLEASE, SEND ME A PRIVATE MESSAGE OR EMAIL IF YOU'RE INTERESTED.
Re: var_for_name() ??? execute();??? [Re: PrenceOfDarkness] #177795
01/14/08 09:32
01/14/08 09:32
Joined: Apr 2006
Posts: 136
San Francisco
T
Tor Offline
Member
Tor  Offline
Member
T

Joined: Apr 2006
Posts: 136
San Francisco
when you initialize the string to "" you're basically initializing the length of the array (a string is an array of char's) to 0, which means that it most likely wont fit anything in it.

I can't remember (haven't used liteC in a while) so it's probably best to just leave it as:

Code:

STRING* name;



until you are ready to add stuff to it or something.


"Towlie, you're the worst character ever." I know...
Re: var_for_name() ??? execute();??? [Re: Tor] #177796
01/15/08 08:35
01/15/08 08:35
Joined: Aug 2004
Posts: 1,305
New York
PrenceOfDarkness Offline OP
Serious User
PrenceOfDarkness  Offline OP
Serious User

Joined: Aug 2004
Posts: 1,305
New York
okay for some reason this works:

STRING* zoneSkillExeStr = "#20";

Code:

str_cat(zoneSkillExeStr,"my.z=1000;");
var_for_name(zoneSkillExeStr);



and this doesn't:
Code:

str_cat(zoneSkillExeStr,"my.skill30=5;");
var_for_name(zoneSkillExeStr);



I've read the manual... it says when there is an equal sign use var_for_name instead of execute... but i even tried:
Code:

str_cat(zoneSkillExeStr,"my.z=1000;");
execute(zoneSkillExeStr);



I hate strings... Anyone have any clue to what the heck is going on? I don't see any logic errors but i'm sure they are there...


"There is no problem that can't be solved with time and determination." -me
prenceofdarkness for instant messages on AIM.

Looking for a model designer
PLEASE, SEND ME A PRIVATE MESSAGE OR EMAIL IF YOU'RE INTERESTED.
Re: var_for_name() ??? execute();??? [Re: PrenceOfDarkness] #177797
01/15/08 14:42
01/15/08 14:42
Joined: Mar 2007
Posts: 197
Y
yorisimo Offline
Member
yorisimo  Offline
Member
Y

Joined: Mar 2007
Posts: 197
try using str_cpy first, then adding to the string with str_cat


Joris Lambrecht
My Contributions: Relative Rotation, Window Sizing

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | 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