Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   pass functions/variables/objects by reference (https://forums.graalonline.com/forums/showthread.php?t=79613)

Robin 05-03-2008 04:24 PM

pass functions/variables/objects by reference
 
I know about .link() for objects but what about functions?

This is what I'm trying:

Bounce = new TStaticVar("Bounce");
Bounce.easeInOut = function(a,b,c,d) {
return a+b+c+d;
};

function Tween(easefunc,prop,a,b,c,d) {
prop = easefunc(a,b,c,d);
}

Tween(Bounce.easeInOut.link(), this.x.link(), 1,2,3,4);

(Essentially, it's just psuedocode)

But I'm getting all sorts of odd behaviour.

I've tried joining from classes, I've tried function objects, I've tried seperate named functions for everything, no workie.

Any ideas?

Chompy 05-03-2008 04:27 PM

Well, I dunno that would work though, since obj.link() is for arrays :o

(At first glance I thought this was a suggestion for passing functions etc. xD)

Robin 05-03-2008 04:46 PM

... well bugger I. Another case of not reading x-x

well how can you pass stuff by reference?


All times are GMT +2. The time now is 06:29 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.