Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (7th_zorro, degenerate_762, AndrewAMD, ozgur), 774 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
tranfering variables #166626
11/09/07 04:02
11/09/07 04:02
Joined: Sep 2007
Posts: 49
O
onslaught147 Offline OP
Newbie
onslaught147  Offline OP
Newbie
O

Joined: Sep 2007
Posts: 49
how do you transfer different variables between function and function, action and action, and function and action (i imagine it will be the same way for all three) i know how to transfer flags but that is very limiting so transfering even skills will be extremely helpful. ty


The only thing in life you can depend on is death and taxes.
Re: tranfering variables [Re: onslaught147] #166627
11/09/07 11:15
11/09/07 11:15
Joined: Oct 2007
Posts: 29
AUT/Burgenland
bonecracker Offline
Newbie
bonecracker  Offline
Newbie

Joined: Oct 2007
Posts: 29
AUT/Burgenland
So what variables do you mean?

If you wanna transfer Informaition like "Player-Energy or Money or something else" you should use "DEFINE"
for example:



*****************************************
DEFINE Money,Skill51;

Action Player
{

MY.Money = 100;

while(....){
blalalalalala
.....
....
wait(1);
}
}

Function Bad_guy_take_my_money()
{

IF( ....EVENT_TYPE....is TRUE) { YOUR.Money = 0; }

}

****************************************************
The Pointer of the "Bad_guy_take_my_money" have to point the "Player".

So you can handel the energy of every Action , function... !!

I hope that help you to fix your little problem.

Ciao Bonecracker

Last edited by bonecracker; 11/09/07 11:31.

Wenn man glaubt alles zu Wissen, weiß man wenig. Denn Glauben ist nicht Wissen. Wenn man weiß dass man Wissen nur glauben kann, dann kennt man die Warheit!
Re: tranfering variables [Re: bonecracker] #166628
11/09/07 20:46
11/09/07 20:46
Joined: Aug 2005
Posts: 1,230
M
MichaelGale Offline
Serious User
MichaelGale  Offline
Serious User
M

Joined: Aug 2005
Posts: 1,230
What you talk about are global variables. They work like this:

Code:

var x;

function alpha()
{
x += 5;
// x is now 10
}

function main()
{
x = 5;

alpha();
}




Your friendly mod is at your service.
Re: tranfering variables [Re: MichaelGale] #166629
11/09/07 21:18
11/09/07 21:18
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
I think his talking about function parameters.
Do it just like that:

Code:

function main()
{
test_sub(30);
temp = 20;
test_sub(temp);
}

function test_sub(a)
{
//after thrist call a == 30
//after second call a == 20
...
}



This is NOT possible with actions!!! For actions you have to use global Variables.
For more informations about parameters look into the manual.

Dark_Samurai


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: tranfering variables [Re: Dark_samurai] #166630
11/10/07 00:41
11/10/07 00:41
Joined: Sep 2007
Posts: 49
O
onslaught147 Offline OP
Newbie
onslaught147  Offline OP
Newbie
O

Joined: Sep 2007
Posts: 49
i cant use global varables bc i will have multiple objects of the same type using the same variables so global variables will be impossible to use


The only thing in life you can depend on is death and taxes.
Re: tranfering variables [Re: onslaught147] #166631
11/10/07 09:13
11/10/07 09:13
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
So why not using parameters?
If you want to use actions there is no other solution then using global variables, but you can also use functions in WED! If you write the name of the function in the behaviour panel, this function is handled like an action, but you can use parameters.

Dark_Samurai


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: tranfering variables [Re: Dark_samurai] #166632
11/10/07 09:22
11/10/07 09:22
Joined: Aug 2005
Posts: 1,230
M
MichaelGale Offline
Serious User
MichaelGale  Offline
Serious User
M

Joined: Aug 2005
Posts: 1,230
If you have multiple objects of the same type you should go for skills in C-Script. In Lite-C, however, you could have structures and arrays to work with. Or as Dark_samurai suggested you pass the variables through the function parameters, which is very limited though.


Your friendly mod is at your service.
Re: tranfering variables [Re: MichaelGale] #166633
11/10/07 19:36
11/10/07 19:36
Joined: Sep 2007
Posts: 49
O
onslaught147 Offline OP
Newbie
onslaught147  Offline OP
Newbie
O

Joined: Sep 2007
Posts: 49
i would use skills but u cant pass the skill through two different objects and i dont have WED so the function parameters (as far as i know) will be impossible for me but thnx for the replies


The only thing in life you can depend on is death and taxes.

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