PDA

View Full Version : Freeform Combo Scripting System Wishlist



_L_
08-18-2006, 10:04 AM
Current Wishlist:

Arguments:

script - the script number of the FFC. When this is changed, flow switches to the first instruction of the newly referenced script.
strike - this one is 0 unless the FFC is colliding with a weapon, in which case it returns a number corresponding to which weapon it was (wooden sword = 1, boomerang = 5 etc.) With this one, we could conceivably make FFCs into custom enemies.
button - contains a bitfield corresponding to which buttons (up, down, left, right, A, B) are being pressed by the player.

Instructions (# denotes a value, R denotes a register.):

COLLIS - One that sets the TRUEFLAG if the FFC collides with Link.
LTOGGLE - Toggles the player's ability to control Link on and off. When off, you cannot move Link or use items. Good for cutscenes!
GOSUB # - Stores the current line number somewhere and goes to line number #.
RETURN - Goes to the line number stored by GOSUB.
CD R1,R2 - finds the room combo data number at coordinates (R1,R2), and stores it in R1. Highly sought after!
MAKEITEM # - Creates item number # at the FFC's X and Y coordinates.
SND # - Starts playing sound number # from sfx.dat. Extremely sought after!

Dark Nation
08-18-2006, 04:28 PM
Here are the latest new commands for the scripting language:

MODR
MODV - These do modulus operations, basically the remainder after a division.
SINR
SINV
COSR
COSV
TANR
TANV - sine, cosine, and tangent trig functions
ABSR - Sets a register to its absolute value.
MINR
MINV - Sets a register to the lower of itself and another number.
MAXR
MAXV - Sets a register to the higher of itself and another number.
RNDR
RNDV - As stated above, sets a register to a random number between 0 and another number (not including the other number).

Praethus
08-18-2006, 04:45 PM
w00t! Random number generator and trig functions. So many possibilities... ^_^

idontknow
08-18-2006, 05:54 PM
i haven't even bothered toying around with this feature (FFC scripting) yet. Can anyone list a few examples of what you can do with it that you couldn't do before?

jman2050
08-18-2006, 06:38 PM
Script: Give a starting radius(X accel), starting angle(Y accel x 90), and starting rotation speed(Y speed), attach it to FFC #1 as a center point, assume the FFCs are 16x16 pixels. Result: Rotation around a central (even moving) point. In my case, I combned it with the moving platform script I made to make two FFCs that rotating around a moving platform.



SETV a1,1
SETR d2,xd2 ; d2 is the radius
SETV xd2,0
SETR d3,yd2 ; d3 is the current angle
SETV yd2,0
MULTV d3,90
SETR d4,yd ; d4 is the speed of rotation
SETV yd,0
DoRotation LOAD1 d0,x ; d0 is center x based on FFC 1
LOAD1 d1,y ; d1 is center y based on FFC 1
LOAD1 d7,xd
ADDR d0,d7 ; Since FFC scripts are executed BEFORE the movement variables are applied, apply the movement variables yourself to the center point to ensure perfect rotation
LOAD1 d7,yd
ADDR d1,d7 ; And do the same with the X position
ADDV d0,8 ; Add 8 to the center X/Y point since FFC X/Y is top-left jutified
ADDV d1,8
COSR d7,d3 ; Calculate final X position FFC
MULTR d7,d2
ADDR d7,d0
SETR x,d7
SUBV x,8 ; Subtranct 8 to ensure rotation occurs at center of FFC, not at origin point
SINR d7,d3 ; Calculate final Y position of FFC
MULTR d7,d2
ADDR d7,d1
SETR y,d7
SUBV y,8 ; Do the same for Y as above
ADDR d3,d4 ; Add the rotation speed to the angle
COMPAREV d3,360 ; This whole section rolls around the angle value if it's >=360 or <0
GOTOLESS DoRotation2
SUBV d3,360
DoRotation2 COMPAREV d3,0
GOTOMORE DoRotation3
ADDV d3,360
DoRotation3 WAITFRAME
GOTO DoRotation ; Repeat he whole thing
QUIT

_L_
08-21-2006, 12:46 AM
I've thought of something else to add:
* GOSUB and RETURN. GOSUB X would store the current line number somewhere and GOTO X. RETURN would simply GOTO the stored line number. This would be helpful for large scripts.

jman2050
08-21-2006, 12:40 PM
Since we plan on implementing a stack, that's certainly not far away at all.

_L_
08-21-2006, 01:06 PM
I've taken to the habit of listing my new wishes in the first post. But here's what the newest ones are:

Arguments:

button - contains a bitfield (or whatever it's called) corresponding to which buttons (up, down, left, right, A, B) are being pressed by the player. Combine with LTOGGLE below for unlimited entertainment!

Instructions:

COLLIS - One that sets the TRUEFLAG if the FFC collides with Link.
LTOGGLE - Toggles the player's ability to control Link on and off. When off, you cannot move Link or use items. Good for cutscenes!
CD R1,R2 - finds the room combo data number at coordinates (R1,R2), and stores it in R1. Highly sought after!
MAKEITEM # - Creates item number # at the FFC's X and Y coordinates. Useful for ammunition-requiring bosses?
SND # - Starts playing sound number # from sfx.dat. Extremely sought after!

beefster09
08-21-2006, 06:45 PM
What about:

lh ;Link's Health
lm ;Link's Magic

As variables?

Rakki
08-27-2006, 04:10 PM
These seem like good additions to me.

HASITEM #; Returns true if the player has a specific item #, false if not (equipment counts as well).
ONUSE #; When the item equal to number is used (only useable items would be able to trigger this), it'll execute the line below it, otherwise, it'll skip over it. This could be used with a GOTO underneath to achieve the effect of doing something specific on use of an item. Or even better would be if we could use brackets ({}) to designate what should be run when the item is used.