Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,388 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
custom function call removed from execute(), why? #247725
01/22/09 09:26
01/22/09 09:26
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline OP
Expert
Helghast  Offline OP
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
I think the title says enough...
I really would like such functionality back, be it in execute, be it similar to var_for_name (fnc_for_name for example).

I am creating all of my content from .txt files to customize it all and tweak it a lot easier.
But currently it's a real slow process to me, since i have to track a variable in a function, and set a specific if for that again. running it from a execute command would save a lot of confusion (especially when people would like to mod your game for example).

Can this be included again please?

kind regards,
Dennis


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: custom function call removed from execute(), why? [Re: Helghast] #247728
01/22/09 09:48
01/22/09 09:48
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
A function like execute() can not be implemented because the compiler does not support that.

But you can call script functions through engine_getscript().

Re: custom function call removed from execute(), why? [Re: jcl] #247735
01/22/09 10:27
01/22/09 10:27
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline OP
Expert
Helghast  Offline OP
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Yes, that is my whole point.

I dont want to use if statements to call a function.
I tried using engine_getscript, and then a function I made wouldnt get called.
all i want to use is the string i got out of a .txt file and run that as a function... i dont see how engine_getscript would help, since it only returns the pointer, i still have to call it, and as i said, i dont want to use 1000's of if statements.

Out of curiosity, why did that change, because A6 did support this?

I hope there is a way to do this without hundreds of if statements...

kind regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: custom function call removed from execute(), why? [Re: Helghast] #247740
01/22/09 10:48
01/22/09 10:48
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
It changed because A7 uses a different compiler.

I'm probably stupid, but I have not yet understood what problem you have with engine_getscript and what if statements you're talking about. Can you explain?

Re: custom function call removed from execute(), why? [Re: jcl] #247747
01/22/09 11:01
01/22/09 11:01
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline OP
Expert
Helghast  Offline OP
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
hahahaa, if you were stupid, we'd still be cavemen wink (or some previous evolution they came from :P).



No really, i tried this:

Code:
function doubleBeep() {
	beep();
	beep();
}


and called it from main like:

Code:
engine_getscript("doubleBeep");


But i'm not hearing 2 beeps at all...

I'm using A7.66.3(BETA), might that be the issue?



The if statements i'm talking about is what the manual says:
Quote:

void pFunction(var x, var y);
...
pFunction = engine_getscript("myscriptfunction");
if (pFunction) // if a function "myscriptfunction" exists in the script,
pFunction(1,2); // call it


i dont want to have to call the function like in the example, say i have 20 different function, i'd have to write 20 different if statements, for calling all the different functions from script, where before i could extract the string, and simply call the function through execute (and yes, i'm aware that wont work.. ever :P). That's what i really miss, i made great use of that actually. In one of my turn based battle systems it defined what the enemy could do (called functions from there, magic, melee etc).

thanks for the superfast replies!

kind regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/

Moderated by  old_bill, Tobias 

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