|
1 registered members (AndrewAMD),
1,310
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
TEXT not working at all?
#261356
04/17/09 06:09
04/17/09 06:09
|
Joined: Oct 2003
Posts: 2,194 Saturn
Metal_Thrasher
OP
Expert
|
OP
Expert
Joined: Oct 2003
Posts: 2,194
Saturn
|
I take TEXT* straight from the manual implement it into my script. and it dosen't work? It tell me it doesn't know what "TEXT*" is. This frustrating...
Help please?
-Johnny Thrash
|
|
|
Re: TEXT not working at all?
[Re: delinkx]
#261362
04/17/09 07:17
04/17/09 07:17
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
If you are using c-script, drop the asterisk, its lite-c only.
If you are using lite-c, make sure SED has saved your source files as C and not WDL. It is easy to not notice...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: TEXT not working at all?
[Re: EvilSOB]
#261364
04/17/09 07:27
04/17/09 07:27
|
Joined: Jul 2008
Posts: 553 Singapore
delinkx
User
|
User
Joined: Jul 2008
Posts: 553
Singapore
|
yeps. c-script calls objects directly but lite-c uses pointers. from the manual: In C-Script, we had to differentiate between object definitions (PANEL mypanel = {... }) and object pointers (PANEL* mypanelpointer = mypanel;). In lite-C, objects are always pointers. So it's now PANEL* mypanel = { ... }.
|
|
|
Re: TEXT not working at all?
[Re: delinkx]
#261379
04/17/09 09:53
04/17/09 09:53
|
Joined: Oct 2003
Posts: 2,194 Saturn
Metal_Thrasher
OP
Expert
|
OP
Expert
Joined: Oct 2003
Posts: 2,194
Saturn
|
Thank a billion dudes. You'd think my stupid ass would have figured that one out. Thanks again... although i have another stupid question for you at this point. How do I assign the value of a variable to a string. For instance displaying the amount of the player's health stored in a variable.
-Johnny Thrash
|
|
|
Re: TEXT not working at all?
[Re: Metal_Thrasher]
#261382
04/17/09 10:25
04/17/09 10:25
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Beware the number and placement of brackets! Important! str_cpy((panelname.pstring)[linenumber],""); //clear existing content.(even first time) str_cat_num((panelname.pstring)[linenumber], "%.3f", thenumber); //display number to 3 decimal places.NOTE: not sure if this is c-script friendly or not. I live lite-c and my WDL is shoddy
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: TEXT not working at all?
[Re: EvilSOB]
#261480
04/17/09 19:19
04/17/09 19:19
|
Joined: Jul 2002
Posts: 2,002 Europe
ShoreVietam
Expert
|
Expert
Joined: Jul 2002
Posts: 2,002
Europe
|
Never saw something like this in C-Sript, there are no type conversions in C-Script since there is only one type.
To avaid str_for_num() printing out all 3 numbers after the comma pass the variable through the int() function.
Last edited by ShoreVietam; 04/17/09 19:20.
|
|
|
|
|
|