Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-18-2006, 08:27 AM
calani calani is offline
Scriptess
calani's Avatar
Join Date: Aug 2003
Location: asmgarden.gmap
Posts: 606
calani is on a distinguished road
Send a message via AIM to calani
Question dynamic function calling

Okay, I'm trying to do something, and I'm not sure if its supported by GS2 or not.

I'm trying to redo my system in such a way that I can call any function from chat or suchlike without having one gigantic switch and hardcoding each functioncall.

Basically, I'm trying to do this:

PHP Code:
function callfunc(temp.funcname,temp.fparams) {
  
temp.fparams=replacemarkers(temp.fparams);  // replace escapes with values
  
(@temp.funcname)(temp.fparams);  // call the function
}

function 
prop(temp.fparams) {
  
do_stuff();

This way I could call a showimg, setfocus, local functions, etc.
I'm going to add in a preset sys that lets me do preset action (or set new ones) to keys. as an example, lmouse="gani $ sit 0" would call a local gani() function with the params "$m jellybean blue.png". (I use $m as an escape that refers to the current mousetarget. others are $mx $my for mouse xy, etc)


Problem I'm having - this just doesn't work.
__________________
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 02:48 PM.


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