PDA

View Full Version : Discuss FF Combo Scripting Ideas HERE



jman2050
08-14-2006, 06:22 PM
Go!

ZoraJolteon
08-14-2006, 08:30 PM
I'm pretty much clueless about these things, but would it be possible to create puzzles similar to the ones in the Oracle Games where you have to walk over a set of tiles in a paticular patten to light them all up in one line?

The_Amaster
08-14-2006, 08:35 PM
Geez Jman, you enjoy doing threads like that, dont you. First the revolution, now this...
I dont know to much, but it seems entierly plausable to create puzzles where blocks have to be pushed into a certain order. (Also oracles games)
And I know with this, moving platforms could be done. The only problem is making the pit around them(See my suggestion in the Beta Suggestions forum. It would actully be easy to medium difficult to implement)

Sir_Johnamus
08-14-2006, 09:19 PM
I agree with the above, but how about an option to change the scripting language?
I pretty much only know C++, so it could help.

Nick
08-14-2006, 09:20 PM
Uh... port this baby to C/C++ syntax or something and I might have a clue how I could use it. :blah:

Your test script really didn't give me any ideas other than the fact that it could be flexible. I just have no clue how flexible it is regarding everything that can be done. But then again... that's because I'm not that great with ASM and there is only one example of the possibilities in front of me (though I thought of someone making a game of pong, for some reason).

It's exciting to see some sort of scripting floating around now, even though I won't be able to use it unless I either learn ASM or wait for a different language.

jman2050
08-15-2006, 12:17 AM
DD is making a C compiler for the language. This thread is just for discussing ideas, not neccesarily how to USE them. As for other examples, take a look at the moving platform code I made earlier today:

http://www.cgi101.com/~jman2050/testscript2.txt

_L_
08-15-2006, 11:23 AM
How hard would it be to make a FFC that constantly circles Link's position?

Master_of_Power
08-15-2006, 02:33 PM
It doesn't detect Link yet

jman2050
08-15-2006, 06:20 PM
It doesn't detect Link yet

Um, the lx and ly arguments ad Link's X and Y positions. So yeah, in theory something constantly rotating Link would work.

beefster09
08-15-2006, 06:29 PM
How about
VOIDPOS and then you could add 1 or 0 (or true/false)
This would void the use of hitboxes behind/in front of the FFC. (maybe by 8x8 tile)
In other words, it would not be solid or a pit there.

DarkDragon
08-15-2006, 07:52 PM
Yes, I've whipped out Ye Olde Flex&Bison and so the next beta will hopefully let you specify scripts in C-like syntax (with high level features like loops, function calls, etc.) Thus if you have any suggestions for what should go in the high-level language, please let me know.

Master_of_Power
08-15-2006, 08:07 PM
detect link works? I thought it didn't... bah my eyes suck >_>;

Freedom
08-15-2006, 08:15 PM
Anyone come up with the idea to have a pool of some general scripts that people can grab and use?

ShadowTiger
08-15-2006, 08:24 PM
Perhaps an automatic scripter that analyzes what you're typing, and provides the proper input based on what you've typed. For example: (And pretend the ____ is four spaces.)



____SETV d0,100 <-- Correct Sets variable d to 100
____SETV dx,1 <-- Unknown
____SETV yd,1 <-- Correct Sets vertical speed to 1 - down
____WATFRAME <-- Unknown
____SUBV d0,1 <-- Correct Subtracts 1 from variable 0
____COMPAREV d0,0 <-- Correct Compares variable 0 to 0
____GOTOTRUE 9 <-- Correct Goes to line 9 in the script
____GOTO4 <-- Syntax Error
____SETV d,100 <-- Missing Variable
____SETV xd-1 <-- Missing Component
____SETV yd,-1 <-- Correct Sets vertical speed to -1 - up
____WAITFRAME <-- Correct Waits (Or whatever this does...)
____SUBV d0,1 <-- Correct Subtracts 1 from variable 0
____COMPARE d0,0 <-- Missing Component
____GOTOTRUE 1 <-- Correct Goes to line 1 in the script if the above value is true
____GOTO 12 <-- Correct Goes to line 12 in the script
____QUIT <-- Correct Quits the script


By "Automatic," I mean it'll mark up each line as you make it to make sure you're not making any errors as you type, and would also provide a description of what you're doing in layman's terms.



Anyone come up with the idea to have a pool of some general scripts that people can grab and use?I, for one, would relish such a thing. I'll be thinking about this quite a bit over the coming weeks in my spare time. A few brave souls can indeed make a world of difference in making FF Scripting easier for everyone. Thankfully, comments are indeed allowed in FF Scripting. It's just a matter of seeing how it all works, as well as why.

beefster09
08-17-2006, 05:50 PM
What about sound and lists/sequences (or whatever they are in C)

4matsy
08-18-2006, 03:25 AM
Okay, so I fired up beta 12c and attempted to make a simple homing trap. W00t. :p


SETV xd,0 ; clear x speed
SETV yd,0 ; clear y speed
COMPARER ly,y ; check if link is above/below trap
GOTOTRUE 9 ; if link y = trap y, skip <> checks because no up/down speeds need to be set
GOTOMORE 8 ; if link y > trap y, skip next 2 lines
SETV yd,-0.5 ; link y < trap y, so trap moves up
GOTO 9 ; skip next line
SETV yd,0.5 ; link y > trap y, so trap moves down
COMPARER lx,x ; check if link is to left/right of trap
GOTOTRUE 15 ; if link x = trap x, skip <> checks because no left/right speeds need to be set
GOTOMORE 14 ; if link x > trap x, skip next 2 lines
SETV xd,-0.5 ; link x < trap x, so trap moves left
GOTO 15 ; skip next line
SETV xd,0.5 ; link x > trap x, so trap moves right
WAITFRAME ; to give the trap time to move :p
GOTO 1 ; reset the speeds to 0 and pick new direction
QUIT ; self-explanatory. :)

I'm having two weird problems with this, though:

1.
Although I didn't seem to break the comment syntax (as specified in jman's post in the beta 12 thread), the script won't work in ZQuest unless I remove the comments...if I try to load it with the comments intact, ZQuest hangs. :odd:

2.
The trap works perfectly with a speed of 1...unfortunately, this makes it near-impossible to outrun (as in...you can outrun it, but literally won't have time to do anything else :sweat:), and this is in a dungeon room with no solid blocks or anything (save for the walls themselves).
However, if I lower the speed to 0.5, it quits working correctly. :rolleyes:
At that speed, it only goes down or right, or stands still if it's right on Link. Never moves up or left. :odd:
This has stumped me quite a bit, since I don't see any logic problems in the script. Although I wouldn't be surprised if I missed something completely obvious, considering the maze of GOTOs I had to use to do the "equal, greater than, or less than" checks...:laughing:

Praethus
08-18-2006, 04:27 AM
Here is a homing trap script, if you want one.



SETV d0,0.5
START WAITFRAME
COMPARER lx,x
GOTOMORE XMORE
SUBR x,d0
GOTO CHECKY
XMORE ADDR x,d0
GOTO CHECKY
CHECKY COMPARER ly,y
GOTOMORE YMORE
SUBR y,d0
GOTO START
YMORE ADDR y,d0
GOTO START
QUIT


It will follow Link around the screen at a speed of 0.5. If you want it at a different speed just change the value in the first line. This script really doesn't need to involve the speed registers. Just update the position of the trap every frame so that it is closer to Link.

Also it's much easier to use labels for GOTO statements than to keep track of line numbers.

I will be writing a FFScript tutorial very soon for those who don't really understand how to do it.

Enjoy.

_L_
08-18-2006, 06:00 AM
That's quite good, but I feel that there should be GOTOTRUE checks as well so that it doesn't needlessly add and subtract 0.5 whenever Link happens to be on the same axis as it.
COMPARER lx,x
GOTOLESS 11; if lx < x, x -= 0.5
GOTOTRUE 5
ADDV x,0.5; if lx > x, x += 0.5
COMPARER ly,y
GOTOLESS 13; if ly < y, y -= 0.5
GOTOTRUE 9
ADDV y,0.5; if ly > y, y += 0.5
WAITFRAME
GOTO 1
SUBV x,0.5
GOTO 5
SUBV y,0.5
GOTO 9
QUIT

4matsy
08-18-2006, 10:30 PM
This script really doesn't need to involve the speed registers. Just update the position of the trap every frame so that it is closer to Link.
...

Excuse me while I go bang my head on a wall repeatedly for not thinking of this obvious course of action. :sweat:

Seriously though, yours and _L_'s are much better...I was pretty sure there was an easier way to begin with, but couldn't figure out what it was...:p

The_Amaster
08-19-2006, 02:13 PM
Could someone please help me understand JMans Moving platform script, like how I change speed or direction. I have almost no understanding of the scripting.

Dark Nation
08-19-2006, 10:53 PM
These are the new/planned additions to the script language command set:

EXP - Sets arg1 to arg1! (ie. 3!=3x2x1)
POWERR
POWERV - Sets arg1 to arg1 to the arg2 power (arg1^arg2)
IPOWERR
IPOWERV - Sets arg1 to arg1 to the 1 over arg2 power (arg1^(1/arg2))
NOT - Sets arg1 to the bitwise-not of arg1 (!arg1)
ANDR
ANDV - Sets arg1 to arg1 bitwise-and arg2 (arg1&arg2)
ORR
ORV - Sets arg1 to arg1 bitwise-or arg2 (arg1|arg2)
XORR
XORV - Sets arg1 to arg1 bitwise-exclusive-or arg2 ((arg1|arg2)&!(arg1&arg2))
NANDR
NANDV - Sets arg1 to arg1 bitwise-nand arg2 (!(arg1&arg2))
NORR
NORV - Sets arg1 to arg1 bitwise-nor arg2 (!(arg1|arg2))
XNORR
XNORV - Sets arg1 to arg1 bitwise-exclusive-or arg2 (!((arg1|arg2)&!(arg1&arg2)))
LSHIFTR
LSHIFTV - Bit-shifts arg1 left by arg2 positions (fills with zeroes) (arg1<<arg2)
RSHIFTR
RSHIFTV - Bit-shifts arg1 right by arg2 positions (fills with zeroes) (arg1>>arg2)
LROTR
LROTV - Bit-shifts arg1 left by arg2 positions (fills with shifted bits) (similar to arg1<<arg2)
RROTR
RROTV - Bit-shifts arg1 right by arg2 positions (fills with shifted bits) (similar to arg1>>arg2)
PUSHR
PUSHV - Pushes arg1 onto the internal stack (first in, last out)
POP - Pops the top value from the internal stack and places it in arg1
ENQUEUER
ENQUEUEV - Adds arg1 to the internal queue (first in, first out)
DEQUEUE - Removes the first value from the internal queue and places it in arg1

These are the new arguments available:
sd0-sd7 - Persistent screen data. These values hold their data assigned to them for the current screen, even after going to another screen and coming back.
gd0-gd255 - Persistent global data. These can be set or read anywhere. So, you could set a global variable in one room then do something in another room based on that value.


Thoughts?

_L_
08-19-2006, 11:20 PM
Thoughts?
I'm at a loss to think of what FFC implementation would require so many binary operations. (I privately suspect that half of the reason why we're getting so many of them is because they're easy for the developers to implement.)

Could we also have something that the non-computer scientists can understand? Like "SFX - commences playing one of the sounds in sfx.dat, with argument 1 being the ID of the sound, and argument 2 being the volume."

idontknow
08-19-2006, 11:32 PM
Wait, so which of the following are possible with FFC scripting, just to get an idea of what you can do:

-An object, such as a trap, that moves in a circle (without using billions of FF attribute change combos)?
-A character that follows Link (such as a fairy)?
-An object that continually circles Link?
-An object that randomly roams around the screen with no predetermined path?
-An object/character that moves opposite or away from Link?
-An object that warps around the screen, disappearing & reappearing at random locations?

jman2050
08-20-2006, 01:03 AM
Wait, so which of the following are possible with FFC scripting, just to get an idea of what you can do:

-An object, such as a trap, that moves in a circle (without using billions of FF attribute change combos)?
-A character that follows Link (such as a fairy)?
-An object that continually circles Link?
-An object that randomly roams around the screen with no predetermined path?
-An object/character that moves opposite or away from Link?
-An object that warps around the screen, disappearing & reappearing at random locations?

All of the above :)

Praethus
08-20-2006, 02:32 AM
If you want any specifically, I can probably write scripts for them once the new beta is out.

_L_
08-20-2006, 04:28 AM
-An object, such as a trap, that moves in a circle (without using billions of FF attribute change combos)?
-A character that follows Link (such as a fairy)?
-An object/character that moves opposite or away from Link?

I have created all three of these in the example dungeon I mentioned in another topic.


-An object that continually circles Link?

It will become possible when the next beta introduces trigonometric functions.


-An object that randomly roams around the screen with no predetermined path?
-An object that warps around the screen, disappearing & reappearing at random locations?Not possible until the next beta introduces RNDV.

idontknow
08-20-2006, 03:33 PM
Hmm...could it be possible to have an entire dungeon where a friend follows you around, except for when you need him to stand on certain triggers? This could make for a fun, Winder Waker-esque type dungeon.

And L, in your example dungeon, you have an elevator at one point that Link can ride. However, you still need to press UP to use it. I'm wondering if its possible, or will be possible at any point, to have FFCs scripted to effect Link's movement. In other words, having moving platforms where once Link steps on them, he takes on the movement of whatever's in the script. So in your example, once he were to step on the elevator, he & the elevator would both rise automatically.

jman2050
08-20-2006, 03:44 PM
Hmm...could it be possible to have an entire dungeon where a friend follows you around, except for when you need him to stand on certain triggers? This could make for a fun, Winder Waker-esque type dungeon.

And L, in your example dungeon, you have an elevator at one point that Link can ride. However, you still need to press UP to use it. I'm wondering if its possible, or will be possible at any point, to have FFCs scripted to effect Link's movement. In other words, having moving platforms where once Link steps on them, he takes on the movement of whatever's in the script. So in your example, once he were to step on the elevator, he & the elevator would both rise automatically.

Once again, all of that is tecnically possible. What we DO need though is a way to tell which way Link is facing at any given moment if we want to do something.

Dark Nation
08-20-2006, 03:52 PM
LD variable? Link's direction. Sound good?

jman2050
08-20-2006, 03:57 PM
How about a general bitmask of Link's various actions. For example, two bits for direction, 1 bit for whether he's swimming or not, 1 bit for whether e's attacking or not, etc.

ShadowTiger
08-20-2006, 04:03 PM
Perhaps a way to have Freeform Combos attack just like you can? ... Rather, a way for something to damage enemies like your weapons can. Therefore, you could have soldier allies who attack enemies with you. (Albeit poorly. We all know Link is the ONLY man who can be called "The man." ;) )

The_Amaster
08-20-2006, 04:44 PM
In other words, having moving platforms where once Link steps on them, he takes on the movement of whatever's in the scriptWait....Didn't Jman post a moving platform script. I haven't tested it yet. Do you have to walk with the platforms?

jman2050
08-20-2006, 04:45 PM
No, you don't.

idontknow
08-20-2006, 08:32 PM
Jman, the platform doesn't work for me. I mean, the tile does move diagonally back & forth, but has no effect on link (He doesn't move w/ it)

ShadowTiger
08-20-2006, 09:13 PM
Yeah, that's not the script that does that. o.o It's the most barebones of example scripts. Look around the Beta Discussion forum for more scripts. They're all scattered 'round here somewhere...

beefster09
08-21-2006, 06:29 PM
This is getting so complicated, (with so many operations of which half I still haven't got to in math) I will probably use the C compiler.

idontknow
08-21-2006, 08:24 PM
Whats a C compiler?

_L_
08-21-2006, 09:57 PM
It's a script compiler that the devs are supposedly working on which will allow you to use syntax similar to that used by the C programming language. Y'know, like:


repeat {
while ((lx - x) > 16) {
waitframe;
}
data = 45;
while (lx < 100) {
lx+=1;
waitframe;
}
data = 44;
}

Dlbrooks33
08-21-2006, 10:15 PM
will someone make a notepad, wordpad, whatever tutorial to explain how to use C++ and Allegro? Game Maker, RPGMaker 2003/XP, DreamMaker, and Visual Basic is nothing like that :(.

Dark Nation
08-22-2006, 12:59 AM
Below are the new variables I have planned for the scripting language:

LINKX
LINKY
LINKDIR
LINKHP
LINKMP
LINKMAXHP
LINKMAXMP
LINKACTION
LINKFROZEN
WPNX
WPNY
WPNDIR
WPNSTEP
WPNANGULAR
WPNANGLE
WPNDRAWTYPE
WPNPOWER
WPNDEAD
WPNID
WPNTILE
WPNCSET
WPNFLASHCSET
WPNFRAMES
WPNFRAME
WPNASPEED
WPNFLASH
WPNFLIP
WPNCOUNT
ITEMX
ITEMY
ITEMDRAWTYPE
ITEMID
ITEMTILE
ITEMCSET
ITEMFLASHCSET
ITEMFRAMES
ITEMFRAME
ITEMASPEED
ITEMDELAY
ITEMFLASH
ITEMFLIP
ITEMCOUNT
NPCX
NPCY
NPCDIR
NPCRATE
NPCFRAMERATE
NPCHALTRATE
NPCDRAWTYPE
NPCHP
NPCID
NPCDP
NPCWDP
NPCTILE
NPCENEMY
NPCWEAPON
NPCITEMSET
NPCCSET
NPCBOSSPAL
NPCBGSFX
NPCCOUNT

There will be some new commands for these. LOADWPN, LOADITEM, and LOADNPC each take one argument (the index in the weapon, item, or npc list of the item to reference). BTW, an NPC is either a guy, enemy, or friendly character. There will also be CREATEWPN, CREATEITEM, and CREATENPC. These will create a new object and begin to reference it. Once an object is referenced, you can change attributes of the objects with the SET command.

An object is only referenced while the script is running. So, WAITFRAME or QUIT will cause an object reference to become invalid (because objects disappear from their lists either from being collected, killed, or fading away) to prevent data corruption. The ITEMCOUNT, WPNCOUNT, and NPCCOUNT tell how many of those objects are on the screen presently (so you can loop through all the enemies on the screen and triple their HP when Link enters the room).

Thoughts?

Praethus
08-22-2006, 01:25 AM
Holy Crap! O_O

And that's all I have to say about that...

_L_
08-22-2006, 03:21 AM
Does "weapon" include such things as:
* Link's sword-slash?
* Link's sword beam?
* Enemy projectiles?

Also, howlonguntilthenextbeta.

Dark Nation
08-22-2006, 07:28 AM
Weapons actually only refer to the enemy weapons on the screen. I suppose I could split the list into EWPN and LWPN commands since the enemy and Link weapons are stored in separate lists internally.

The_Amaster
08-22-2006, 09:07 AM
Game Maker, RPGMaker 2003/XP, DreamMaker, and Visual Basic is nothing like that .
Trust me, I work with RPGMaker XP also. If you can program in ruby, you can program in C. It's actually easier in my opinion. Ive never needed Gamemakers scripting, and I just got Dreammaker, but I can assume they're not to difficult either.

Shimono
08-22-2006, 08:41 PM
sd0-sd7 - Persistent screen data. These values hold their data assigned to them for the current screen, even after going to another screen and coming back.
gd0-gd255 - Persistent global data. These can be set or read anywhere. So, you could set a global variable in one room then do something in another room based on that value.

YES. Oh my GOD yes. This might actually get me seriously working on a quest. I have several ideas that would be difficult, if not impossible, to implement without some sort of screen-local or game-global variables to keep track of world state. The idea of replicating the entire world just to allow a small part of the map to change permanently is irritating (and impractical if multiple of these changes may be independent of each other), and the compromises (room state carryovers and remote boss/kill-all trigger/dmap tomfoolery) can't do everything. I hadn't yet bothered to take a really close look at FFC scripting, as I figured without any persistent store they still wouldn't help me out, but this....this is GREAT news. Time for me to study the possibilities!

koopa
08-24-2006, 07:45 AM
SETV fx,100
SETV fy,100
SETR d0,linkx
SETR d1,linky
SETV d4,5
loop WAITFRAME
SUBV d4,1
COMPAREV d4,0
GOTOFALSE loop
SETV d4,5
SETR d2,d0
SETR d3,d1
SETR d0,linkx
SETR d1,linky
COMPARER d0,d2
GOTOTRUE updown
COMPARER d0,d2
GOTOLESS left
COMPARER d0,d2
GOTOMORE right
GOTO updown
right COMPAREV fx,0
GOTOMORE updown
SUBV fx,1
GOTO updown
left COMPAREV fx,200
GOTOLESS updown
ADDV fx,1
updown COMPARER d1,d3
GOTOTRUE loop
COMPARER d1,d3
GOTOLESS up
COMPARER d1,d3
GOTOMORE down
GOTO loop
up COMPAREV fy,200
GOTOLESS loop
ADDV fy,1
GOTO loop
down COMPAREV fy,0
GOTOMORE loop
SUBV fy,1
GOTO loop
QUIT


Combo that mirrors Link's movement, but like in a mirror - you stand still, he does too. You move up, he goes down. And so on.

_L_
08-24-2006, 09:30 AM
Combo that mirrors Link's movement, but like in a mirror - you stand still, he does too. You move up, he goes down. And so on.

Your script is needlessly complex, and doesn't seem to take into account conveyor belts. Try this:
SETR d0,lx; record Link's position.
SETR d1,ly
WAITFRAME; Let Link move...
SUBR d0,lx; and record his new position.
SUBR d1,ly
ADDR x,d0; apply the change of position to self, in reverse
ADDR y,d1
GOTO 1
QUIT

koopa
08-24-2006, 10:11 AM
you're right there, thanks. I created it more as an example for a thread at ZCU.

redmage777
08-24-2006, 03:09 PM
Note I've yet to spend a great deal of time with the FFC Code so thes sugestion are just as much questions...

Can the Code be linked to the Misc1 & 2 Items? If the Misc 1 & 2 Items could be equiped to the "B" button and used to triger FFC code then we have custom items... I assume not, but if it were implemented then it truely would be an (even more) revolutionary feature.

Can FFC code can be used to create FFCs that damage enemies?

Saffith
08-24-2006, 08:05 PM
If I might suggest some additions, there are a couple of things I think'd be useful, but haven't seen listed anywhere as either present or planned...

this - Unless I just missed it, there's no way for an FFC to see its own ID, which means no references to others based on their relative positions in the list. Obviously, scripts would be more versatile if they didn't rely on hard-coded ID numbers.
PLAY - Unlikely, perhaps, but it'd be nice. We've already got FFC-based bosses and such... They'd be a lot more convincing if they could make sounds. And then, of course, there's the possibility of sound-based puzzles. Separate wav files might be nice, but even just using sounds from sfx.dat would be great.
RAND - I saw RNDR and RNDV are planned, but I'm not certain whether those are random or round. If they're the latter, we still need a way to get random numbers.

Hm... I think I'm forgetting one. Eh, maybe I'll think of it later.

Dark Nation
08-24-2006, 09:23 PM
PLAYSOUNDR and PLAYSOUNDV will play sounds in beta 13, thanks to jman.
RNDR and RNDV are for generating random numbers.

Tygore
08-24-2006, 09:36 PM
will someone make a notepad, wordpad, whatever tutorial to explain how to use C++ and Allegro? Game Maker, RPGMaker 2003/XP, DreamMaker, and Visual Basic is nothing like that :(.

C++ is not something you can learn easily. As in, you are better off buying a book or taking a class. It's far too complex for a simple .txt tutorial.

However, think of RPG Maker XP: you don't NEED to know Ruby to use it, but knowing it opens up a whole new realm of possibilities. It's the same here: ZC will still be ZC, and ZQuest isn't going to REQUIRE you to ever know a lick of programming to make your own Zelda-style game. Those who know how, however, have more flexibility with their quests.

bigjoe
08-25-2006, 12:36 AM
ZC will still be ZC, and ZQuest isn't going to REQUIRE you to ever know a lick of programming to make your own Zelda-style game. Those who know how, however, have more flexibility with their quests.

And those who don't know how can still import and use scripts provided by others. So everyone wins! :D

I'm hoping that a large database of cool scripts comes to to exist.

Saffith
08-26-2006, 02:10 PM
Oh, I remember the other: GOTOR. We can write more generic subroutines if we can store return addresses.
A way of reading line labels into registers to go along with that would be good, too.