PDA

View Full Version : Questions for Jman



C-Dawg
10-16-2006, 09:11 AM
codes and examples


Jman, I can't seem to get your code to work. After some trial and error, I did the following:

1. I copied your global function, distancesq, and your ffc scripts, followlink and satellite, into a .txt document.

2. I changed the .txt extension to .z

3. I went to Complie ZScript -> Import and imported the .z file

4. I clicked on Compile! and it did so without error or complaint.

5. I then was given the option to assign followlink and satellite to FFC slots. Very slick, and I like how you allow up to 512 slots.

6. I assigned followlink to 1 and satellite to 2.

7. I then designed a test room and put two FFCs in the room at position 0,0. I left all options for the FFCs entirely default / blank except I assigned one of them Script 1, and one of them Script 2.

8. At runtime, when link enters the room, one of the FFCs (the one running satellite, I believe) shoots off the screen heading south at a high accelleration, while the other does not move.

What gives? I havn't seen any generic guide to applying FFC scripts other than your post, so I'm wondering if I'm missing a step somewhere along the line. The code looks perfect.

_L_
10-16-2006, 10:08 AM
No posting scripting problems in three-week-old topics instead of the scripting forum. Although, since this is directed entirely at jman2050, you should probably have just privately messaged him. Tsk, tsk.

ShadowTiger
10-16-2006, 10:18 AM
Eh. This can be moved to the General scripting Help Forum.


* Moves *

C-Dawg
10-16-2006, 03:00 PM
Actually, I think DarkDragon drafted the code and Jman made the post. I'm happy if anyone who is already schooled in FFC scripting can point out what I'm missing.

blue_knight
10-16-2006, 03:44 PM
There appears to be a bug when you have 2 ffc's using different scripts on the same screen. If you make a room with one of those ffc's it should work fine. An alternative is to make 1 script that controls multiple ffc's by using the Screen->LoadFFC(index) to get the pointer to the other ffc's on the screen.

C-Dawg
10-16-2006, 04:36 PM
What the... you mean you can't have two FFCs running different scripts on the same screen? What are the restrictions on this? As currently implemented, the Satellite script calls the Followlink script. Can I avoid problems by stopping one script from calling the other, and just making each one self-sufficent? Or will two independent FFCs self-destruct no matter what if they're each running a script on the same screen?

blue_knight
10-16-2006, 08:32 PM
I didn't test it very much, I just removed one of the scripts (ffc's) and rewrote the code to make it work. So you're right, it might work if each one was independent but it certainly doesn't work when one calls the other. I know they had to do something similar with the pong demo, but again it was probably one script relying on another one again.
So my suggestion would be to first try having one ffc with one independent script on screen to make sure you have the rest of the process correct (which I suspect you do because I had the EXACT same problem when I first tried it). If that works then try making two ffc's with completely independent scripts.

jman2050
10-17-2006, 12:26 PM
DarkDragon would better answer your question, as I just copied his post.

BTW, off-topic, nice to see you back C-Dawg. I know oyu've been busy, but can we expect a certain something this coming February or not >_> <_<

C-Dawg
10-17-2006, 12:51 PM
Something? Sure, every year. What you're hoping for? Not just yet. I'm tinkering with a new quest file just to learn about scripting and build up a library of scripting functions. Once I've got that down, I'm going to have to go back and overhaul alot of SD to accomodate the new features. If you want to help, that might be doable, but I'm reluctant to ever make something into a joint project because of the ensuing delays.

I'm really impressed with what's going on, though. PureZC is producing amazing tilesets like the Dance of Remberance set, and you guys are making ZClassic into a genuine programming system. It's evolved into a remarkable product, with an easy-to-use front end and a highly advanced back end letting everyone use it.

jman2050
10-17-2006, 12:56 PM
Nah, I won't ask to help out. I got too much on my plate with ZC, Royal Heart, and DOY: DX anyway. I DO want the opportunity to test it though, as the latest build of SD was extremely buggy (a recent playthrough just reminded me how buggy it was).

Thanks a bunch about ZC though. We're really trying to augment it's capabilities as much as possible without it becoming too n00b-unfriendly. Hopefully we succeed in that regard.

blue_knight
10-17-2006, 01:55 PM
Just out of curiosity, did you ever get scripts working C-Dawg?

C-Dawg
10-17-2006, 04:04 PM
I'm at work, but I'll check them out when I'm home or on break. (All of Zelda Classic and a quest file fits on a USB MP3 player. SCORE.)

DarkDragon
10-18-2006, 07:27 AM
:(
There is no reason that example should no longer work, besides the script compiler being buggy.

I am unable to debug the script myself but looking at the ASM output might shed some light on the problem.
Open ZQuest, compile the script, assign them to the two slots, quit ZQuest, then open allegro.log. The ASM source should be there in the log file; post it here.

C-Dawg
10-18-2006, 09:48 AM
The Followlink script works perfectly when it's the only script assigned to any FFC on the screen. Satellite, however, just rotates in a sad, slow circle in the upper left corner of the screen. It doesn't snap to Link's location.

I did some further testing. My compiler buffer now has the Followlink, Satellite, Vaccuum, and Chasertrap FFC scripts. The Followlink seems to work well if it's the only one on the screen, except that the FFC disappears as soon as it reaches Link. It also appears that, when this happens, FFCs on different screens suddenly behave differently, shooting off the screen at high speed. Satellite, provided you havn't let the Followlink FFC touch you on a previous screen, still does it sad little rotation. Chastertrap and Vaccuum don't seem to do anything on their own.

But! I assigned the Chasertrap and one other FFC to the same screen, I think "followlink", and it worked really well. The chaser trap moved towards Link, and when it lined up, it sped towards him. It would continue past link at high speed until hitting a wall and then resume moving towards link.

So it appears that FFCs are interacting. I'd post my .qst file so you could see what I'm experiencing, but I don't have any web space to upload it to.