Message Board
Message Board > Fenix / Bennu / Gemix / DIV > Functions...? |
February 8, 2006, 20:33 | |
Tovi
I love you! 75 posts |
In DIV2, a function would be a process that paused the entire game, except for the function itself, when you called upon the function. I tried running functions in fenix, but it didn't work out. So now I need a replacement. You guys have helped me alot in the past, so I don't see why I shouldn't ask this here. Is there a way in fenix for one process to freeze all other processes, without knowing what other processes are running? A "freeze_all_but_me()" command would be really sweet. ____________ Zombie Robot Ninja Pirate Battlefield Extreme!!! |
# |
February 8, 2006, 20:36 | |
Rincewind
programmer 1553 posts |
It seems it's your lucky day. Moogle made a DLL for Fenix that freezes all processes but itself! I'll look it up for you. And about functions, v0.84b has functions, but as you have noticed there's a lot other more important stuff not working. If you really need them then perhaps try a recent CVS compilation of Fenix (no idea if bad bugs have been fixed in that). ____________ Personal website: http://www.loijson.com |
# |
February 8, 2006, 20:36 | |
Fiona
games are terrible -9616558 posts |
Processes do the job. See what happens in Fenix (I think) is that when you start a process it runs the first frame there and then. (I'm right arn't I?) So having a process that does something and stops does the same thing as a function. [Edited on February 8, 2006 by Fiona] ____________ laffo |
# |
February 8, 2006, 20:43 | |
Tovi
I love you! 75 posts |
Ferret -> The function has to run several frames, so it's essential it freezes the rest of the game. Rincewind -> Thank you! ____________ Zombie Robot Ninja Pirate Battlefield Extreme!!! |
# |
February 8, 2006, 20:47 | |
Rincewind
programmer 1553 posts |
Moogle's Plus84 dll
____________ Personal website: http://www.loijson.com |
# |
February 8, 2006, 21:55 | |
Tovi
I love you! 75 posts |
That is awesome. Just what I needed. It couldn't have been more perfect to the extent that it's exactly how I wanted it to be... A single command to freeze all processes. Very scary... [Edited on February 8, 2006 by Tovi] ____________ Zombie Robot Ninja Pirate Battlefield Extreme!!! |
# |
February 8, 2006, 23:01 | |
Sandman
F3n!x0r 1194 posts |
That is one awesome DLL. Not that it matters much now, but... Code: signal_those_bastards( s_freeze ) === process signal_those_bastards( int my_signal ) begin for(z=1; z<=65535; z+=2) if(exists(z)) signal(z,my_signal); end end end ...would have been a reasonable solution. Though similar code in DLL form is faster and therefor better. ____________ BennuWiki Yes, my avatar has grey borders in IE (so get a decent browser) ROOFLEZ ROOFLEZ |
# |
February 8, 2006, 23:05 | |
Fiona
games are terrible -9616558 posts |
Can I ask why that for goes through every 2 id numbers? Are all ID's even? I didn't know that. ____________ laffo |
# |
February 8, 2006, 23:16 | |
Eckolin
Quite Whiskered 388 posts |
All ID's are odd, so they can be used in conditions and such.
____________ Maker of Games... Wisdom is supreme; therefore get wisdom. Need help with coding? I probably wrote something similar. |
# |
February 8, 2006, 23:39 | |
Sandman
F3n!x0r 1194 posts |
Wait you're right, Ferret. First I used Process ID's, hence the +2, but later I changed it to Process Type ID's and those use both odd as well as even numbers. Process Type ID '0' is the same as 'type main', or the main program 'process'. Of course Eckolin is right as well. [Edited on February 8, 2006 by Sandman] ____________ BennuWiki Yes, my avatar has grey borders in IE (so get a decent browser) ROOFLEZ ROOFLEZ |
# |
February 9, 2006, 14:21 | |
Tristan
Beardless 1 posts |
Quoting Sandman: That is one awesome DLL. Not that it matters much now, but... Code: signal_those_bastards( s_freeze ) === process signal_those_bastards( int my_signal ) begin for(z=1; z<=65535; z+=2) if(exists(z)) signal(z,my_signal); end end end ...would have been a reasonable solution. Though similar code in DLL form is faster and therefor better. I think this will not work because all process ID´s are greater than 65535, ur signal could only afcet the first process (65535). From version 0.84b the signal functions works like DIV, and they will affect the process when a frame; is found, so you can do: process pause( int main_id) begin signal(main_id, s_freeze_tree); signal(id, s_wakeup); frame; ..... end Where main_id is the ID of the main process... ____________ |
# |
February 9, 2006, 16:23 | |
Fiona
games are terrible -9616558 posts |
Hey Tristan, walcome to Boolean Soup. And thanks for clearing that up for us.
____________ laffo |
# |
February 9, 2006, 23:18 | |
Sandman
F3n!x0r 1194 posts |
Quoting Tristan: I think this will not work because all process ID´s are greater than 65535, ur signal could only afcet the first process (65535). Partially true. Process ID's are indeed >65535, so I would signal NO Process ID's at all, but by doing the for(z=0; z<=65535; z++) thing, it signals all Process Types, thus meaning all processes. And in my experience the main ID is always 65537 which makes sense. So your pause() function wouldn't even need that param. But wait! If I don't have the main program running anymore, I can't use it, since it signals a non existing process. That would suck. [EDIT] It was stated in a post, but wasn't all that clear, so here comes the updated code: Code: signal_those_bastards( s_freeze ) === process signal_those_bastards( int my_signal ) begin for(z=0; z<=65535; z++) if(exists(z)) signal(z,my_signal); end end end The if(exists(z)) is not really necessary, but when I tested it, it gave a speed improvement. z=0 could be z=1, if you want to exclude the main process. I did <=65535 because after that, the Process ID's start, so I figured it was the last Process Type ID. If there is some global var containing the total number of types of processes in the code, that would be more fit. [Edited on February 9, 2006 by Sandman] ____________ BennuWiki Yes, my avatar has grey borders in IE (so get a decent browser) ROOFLEZ ROOFLEZ |
# |
February 10, 2006, 10:20 | |
Momia que fuma
None 6 posts |
Another solution is declaring a global byte pause and replace aaaaaaaaaaall de frame instructions (except the frames on the process managing the pause) by a while(!pause)frame; end Hey Tristan! Otro ejpañó! Toros, paella, flamenco, arsa, ole, ole! XD [Edited on February 10, 2006 by Momia que fuma] ____________ Hey, how crappy is my english? Im spanish and all of your bases are belong to me! |
# |
February 10, 2006, 16:39 | |
Woody
HEAD BLACK MAN 722 posts |
What the hell... Fenix has an exists() function for processes? :enraged: ____________ boredome is the bitter fruit of too much routine |
# |
February 10, 2006, 16:42 | |
Fiona
games are terrible -9616558 posts |
Yeah it does. Why so mad?
____________ laffo |
# |
February 10, 2006, 17:23 | |
Deadmaster
Where is Johnny? 458 posts |
Yeah, Whood. Even I've used it.
____________ My site still needs updating and redesigning. My last.fm page. GO TO TEXTUAL ANARCHY II YOU FISHDOG YOU |
# |
February 10, 2006, 21:12 | |
Woody
HEAD BLACK MAN 722 posts |
Quoting Ferret: Yeah it does. Why so mad? Because it would have made my life 37% easier. ____________ boredome is the bitter fruit of too much routine |
# |
February 10, 2006, 22:31 | |
Sandman
F3n!x0r 1194 posts |
I have reason to believe your calculations are incorrect. It would be 41% at the minimum, sir!
____________ BennuWiki Yes, my avatar has grey borders in IE (so get a decent browser) ROOFLEZ ROOFLEZ |
# |
February 10, 2006, 23:36 | |
Deadmaster
Where is Johnny? 458 posts |
Yeah, I can sorta grip why it would have been useful. Next time, ask or something, Woed.
____________ My site still needs updating and redesigning. My last.fm page. GO TO TEXTUAL ANARCHY II YOU FISHDOG YOU |
# |
February 11, 2006, 00:27 | |
PEader
お前はもう死んでいる 1486 posts |
Quoting Woody: Quoting Ferret: Yeah it does. Why so mad? Because it would have made my life 37% easier.Does that mean you could have made a better game in 1 hour and 17 minutes? ____________ I see 57,005 people. |
# |
February 11, 2006, 16:58 | |
Tovi
I love you! 75 posts |
This DLL is awesome. It opens up so much potiential for fenix, that I officially couldn't program without it anymore. well, I could, but it's just so freaking handy to be able to just "pause" the entire game for a period of time, while you do something else. I've already begun integrating it into several aspects of the game. ____________ Zombie Robot Ninja Pirate Battlefield Extreme!!! |
# |
February 11, 2006, 17:36 | |
Sandman
F3n!x0r 1194 posts |
lol
____________ BennuWiki Yes, my avatar has grey borders in IE (so get a decent browser) ROOFLEZ ROOFLEZ |
# |
Message Board > Fenix / Bennu / Gemix / DIV > Functions...?