Gamestudio Links
Zorro Links
Newest Posts
How to Change Multiplier
by vicknick. 06/02/23 03:27
How to buy tomorrow at open?
by vicknick. 06/02/23 03:19
Adding Position to Current Trade
by vicknick. 06/02/23 03:09
Unable to change multiplier of contract
by vicknick. 05/30/23 06:56
Wrong Definition of Sharpe Ratio in Zorro?
by vicknick. 05/29/23 06:32
Backtest strategy on bitcoin/crypto
by JamesHH. 05/26/23 04:36
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (vicknick, 7th_zorro, Quad), 1,030 guests, and 10 spiders.
Key: Admin, Global Mod, Mod
Newest Members
BInnacle, androsa, XquicksnowX, danishinvest, Trail
18942 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Defining Skills #333385
07/16/10 02:37
07/16/10 02:37
Joined: Jul 2008
Posts: 168
8
82RJZAE Offline OP
Member
82RJZAE  Offline OP
Member
8

Joined: Jul 2008
Posts: 168
Can someone show me an example of titling a skill that will be visible in WED?

Thanks,
82RJZAE

Re: Defining Skills [Re: 82RJZAE] #333387
07/16/10 03:11
07/16/10 03:11
Joined: Jul 2010
Posts: 129
B
bk9iq Offline
Member
bk9iq  Offline
Member
B

Joined: Jul 2010
Posts: 129
yes I wanted to ask the same question... how do we do this with lite-c ... it is very easy with c-script but is it still possible??

Re: Defining Skills [Re: bk9iq] #333392
07/16/10 04:48
07/16/10 04:48
Joined: May 2008
Posts: 257
D
djfeeler Offline
Member
djfeeler  Offline
Member
D

Joined: May 2008
Posts: 257
hello,

the response here

skill1 ... skill100
General-purpose entity variables for storing parameters, just like local variables. The first 20 entity skills can be set in WED's entity properties panel; their meaning depends on the entities' action. Each three consecutive entity skills can be used together as a vector, which is given by giving the first of the three skills. Skills can be renamed by #define statements for assigning meanginful names to WED's entity properties panel.
Range:
-999999.999 .. +999999.999 (default:0)
Type:
var
Remarks:

* skill1..skill20 are used for entering default properties in WED.
* skill21..skill40 were used by the A6 template scripts, and are otherwise free for the user.
* skill41..skill50 are used for shaders.
* skill61..skill70 are used for storing internal data by the template scripts and the script libraries.
* skill71..skill80 are used for data exchange between template script functions, f.i. for input parameters.
* skill81..skill100 are reserved for future extensions.
* Skills can be used for storing object pointers when using a cast operator (f.i. (STRING*), see example). The cast operator is required for functions that expect a pointer, otherwise a pointer to the skill, and not the skill itself would be passed to the function. Note that pointers become invalid on game_load.
* Skills can also be accessed through an array index from 0 to 99, f.i. my.skill1 == my.skill[0].

Examples:

vec_set(my.skill1, my.pan); // sets skill1..skill3
my.tilt = my.skill2;
...
define health,skill10;
#define health skill10
my.health = 99;
...
my.skill40 = str_create(""); // use skill for storing a string pointer
str_for_id((STRING*)my.skill40,my.client_id);

grin

Re: Defining Skills [Re: djfeeler] #333396
07/16/10 05:43
07/16/10 05:43
Joined: Jul 2008
Posts: 168
8
82RJZAE Offline OP
Member
82RJZAE  Offline OP
Member
8

Joined: Jul 2008
Posts: 168
Thanks for pasting a part of the manual for us. What I was asking for was if someone could possibly write a short example in Lite-C since the example given in the manual isn't much of one.

Re: Defining Skills [Re: 82RJZAE] #333410
07/16/10 09:52
07/16/10 09:52
Joined: May 2009
Posts: 445
Peine, Germany
Razoron Offline
Senior Member
Razoron  Offline
Senior Member

Joined: May 2009
Posts: 445
Peine, Germany
Originally Posted By: 82RJZAE
Can someone show me an example of titling a skill that will be visible in WED?

Thanks,
82RJZAE

That will be visible in WED?
You can set skill1-skill20 in WED. Those will be available in your script.
Skill21-skill100 are just for scripting.

Re: Defining Skills [Re: 82RJZAE] #333411
07/16/10 09:56
07/16/10 09:56
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
#define health skill10
#define damage skill11

// uses: health, damage
action my_player()
{
...
}

Now skill10 shows up as health and skill11 as damage in WED.
Make sure that between "// uses..." and "action..." is NOT a empty line, the "// uses...." have to be direct before the action.

Re: Defining Skills [Re: Widi] #333498
07/16/10 19:53
07/16/10 19:53
Joined: Jul 2010
Posts: 129
B
bk9iq Offline
Member
bk9iq  Offline
Member
B

Joined: Jul 2010
Posts: 129
Thanks djfeeler and Widi for ur help

Re: Defining Skills [Re: Widi] #338553
08/19/10 00:42
08/19/10 00:42
Joined: Jul 2008
Posts: 168
8
82RJZAE Offline OP
Member
82RJZAE  Offline OP
Member
8

Joined: Jul 2008
Posts: 168
If multiple actions require to use the same name that has already been defined, is there a way to assign the defined name to different skill numbers?

I understand that comment tags can be used to define skill names that will appear in WED:

Code:
// skill1: Health 100
action player_one() {...}


However, when this is done, the skill still has to be accessed by its number and cannot be accessed by its defined name.

Re: Defining Skills [Re: 82RJZAE] #338838
08/22/10 00:06
08/22/10 00:06
Joined: Jul 2008
Posts: 168
8
82RJZAE Offline OP
Member
82RJZAE  Offline OP
Member
8

Joined: Jul 2008
Posts: 168
Does anyone know how I can access defined skill names instead of the skill numbers when comment tags are used?

For example:

Code:
// skill1: Health 100
action player_one() {...} // skill1 now appears as Health in the WED properties


When the first skill is renamed to "Health" by this method, it can only be accessed by my.skill1 instead of the defined name. I understand that using the #define and the // uses: works for renaming a skill, but I need to use defined names for more than one entity. Any suggestions please? It becomes very difficult to edit my code when many skills are required and can only be accessed by their number.

Re: Defining Skills [Re: 82RJZAE] #338841
08/22/10 00:27
08/22/10 00:27
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
You can use the same skill for different entities, but you can't define different skills with the same name.

This is possible, because the engine can't miss the right skill:
#define health skill1
#define stamina skill1

This is not possible, because the name "health" doesn't tell the engine which of the two skills has to be used:
#define health skill1
#define health skill2

That's at least the way I understand how it works.

EDIT:
The second part could be wrong.
Maybe, it works this way, and the problem begins only when using a second define for one of the skills.

Let's say one entity uses these defines:
#define health skill1
#define stamina skill2

but there is a define for another entity like this:
#define health skill2

then the engine changes both skills when changing the value of 'health' because the define doesn't whose skill is meant.

Last edited by Pappenheimer; 08/22/10 00:35.
Page 1 of 2 1 2

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