Gamestudio Links
Zorro Links
Newest Posts
Tradestation missing in table of contents
by AndrewAMD. 10/23/26 14:35
ZorroGPT
by TipmyPip. 10/23/26 09:08
No connection to MT4
by JeyKey II. 10/22/26 15:33
Zorro tutorial ideas?
by mistery. 10/21/26 05:28
Avoid "log\ - delete old files" message
by Martin_HH. 10/20/26 07:23
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (JeyKey II, TipmyPip, Samed), 11,556 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
JimSimons, julienp, julienper, KelleyAbbey, Yopachi
19246 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Description of Function synonyms anyone? #2084
04/10/01 13:30
04/10/01 13:30

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



Hi all,
I was wondering if anyone could give me a definition of what a function synonym is?

The manual only says "Function synonyms themselves can be started by other functions" whch isnt exactly a definition of what they are <shrug>

Perhaps these function Synonyms are what I'm after, but if not, is there a way to essentially use enitities to create user defined "objects" that dont actually have models? Kind of like classes in C++?

So that I could created say a score object to track the score. I guess I'm just used to working with OO languages and am trying to find a way to use that knowledge in WDL.

I'm also finding it hard to adapt to no local vars...and the fact that NOTHING seems to make use of passing parameters in the predefined functions <shrug>

Thanks for any tips on the function synonyms.

Cheers.

------------------
Dale Drechsler
dale@dalesmatrix.com
http://www.dalesmatrix.com


Re: Description of Function synonyms anyone? #2085
04/10/01 13:54
04/10/01 13:54

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



Not quite sure what you mean. Making a score keeper is simple.

var score = 0;

then just add to the score.

score = score + 25;

Then you can digits to display it to the user.

Being a VB programmer I use a lot of variables in my games as Im sure a lot of people do.

Brandon


Re: Description of Function synonyms anyone? #2086
04/10/01 15:33
04/10/01 15:33

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



Yeah, a score keeper wasn't exactly the best example in the world, however it would still be nice to be able to ecapsulate it without having to resort to globals. This adds to the portability of it alot.

If WDL lets you define custom objects somehow that dont need to be associated with a model or bitmap, you could make a score object that you could re-use for player1,player2 etc without having to worry about making up new globals for each new players score. It'd be nice to be able to something like (syntax invented here, so bear with me )

synonym Player1 function;
synonym Player2 function;
define TargetScore skill10;
define CurrentScore skill11;
action ScoreObj{
my.TargetScore=10;
my.CurrentScore=0;
while (1){
if (my.CurrentScore==my.targetScore){
Display_End_of_level_mesage();
break;
}
//insert code to update score here
}
}

create(player1,ScoreObj);
create(player2,ScoreObj);

or even better, being able to define an array of synonyms that help a player score.

Anyone know if something like this is currently possible?

Any ideas on what a function synonym actaully is?

Cheers

------------------
Dale Drechsler
dale@dalesmatrix.com
http://www.dalesmatrix.com


Re: Description of Function synonyms anyone? #2087
04/10/01 17:16
04/10/01 17:16

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



OK, I read the part in the manual you are talking about, what I get is a 'function synonym' is just a synonym called from a function.

I believe that your example is already possible. You just need to define the skills you want (page 104). You can then just call the action when needed, you dont need to use the create command.

It would just be like adding health using a function or action, I like functions better since they are not called at the start of the game and you dont get those dreaded empty synonym errors.

Example:

Function add_health()
{
if(My._health < 25)
{
my._health += 25;
}else{
my._health -= 25;}
}

Hope this helps,

Brandon


Re: Description of Function synonyms anyone? #2088
04/10/01 17:27
04/10/01 17:27

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



What I really want to do is create a standalone code object that has its own skills.
ie an object thats not associted with any model, bitmap etc, just code, that can have its own persistent skill variables.

A straight forward concept in something like Java, or C++ or even Macromedia Director. I just dont quite see how ya do it in this, hehe.
thanks for the try though.

Cheers

------------------
Dale Drechsler
dale@dalesmatrix.com
http://www.dalesmatrix.com


Re: Description of Function synonyms anyone? #2089
04/11/01 20:10
04/11/01 20:10

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



Hi Dale,

currently there are no variables local to functions (i assume that this is what you would want to see) Also there are no arrays of synonyms yet. There are several things in the works for wdl but not yet available. A function synoym is like a pointer to a function. This way generic function can call different other functions without knowing their actual names .... It just calls the synonym function. The synonym has to be set by other functions otherwise you get an empty synonym error.
Back to your orig. problem. Because there are no local variables yet, you have two choices ... either place an invisible entity into your level and use it's entity skills (SKILL1 to SKILL48) or use global variables.

greetings Ronny

------------------
To boldly animate, what no man has ever animated before

cybersorcerer.de


Re: Description of Function synonyms anyone? #2090
04/11/01 22:01
04/11/01 22:01

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



Thanks for the reply Ronny,

Pointers to functions..cool. Why that cant be mentioned in the manual of course is another matter,hehe.
Any chance of pasting in here a bit of code showing a function synonym in use so I can see how its syntax?

Yes I guess its looking like an invisible entity is the only way to do it, maybe not worth the hassle.

thanks again for the information, much appreciated.


Re: Description of Function synonyms anyone? #2091
04/11/01 22:53
04/11/01 22:53

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



In the menu.wdl lots of function synonyms are used for storing functions previously assigned to keys.


Moderated by  HeelX, Spirit 

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