PDA

View Full Version : Assigning Items To L/R Buttons



bob1000
06-06-2008, 09:50 PM
One thing I was going to put in one of my quests was a script that assigned the Roc's Feather to the L button and the sword to the R button. I'm hoping to assign an item class to each button, though, not a specific item. Also, I thought that was what rolling was, but it was really something different.
I know some script terminology (like InputL), but I can't make scripts. Can someone make it?

Russ
06-06-2008, 10:03 PM
Well first, welcome to ZC!

Second, I don't think it's possible. If you were to completely re-script jumping, then it would be possible. But I don't think assigning items to L and R is possible right now. Sorry.

bigjoe
06-06-2008, 10:16 PM
This highlights the need for a way to activate an item independently of activating it via the A or B buttons. Currently, theres no way to activate items in such a manner unless your items are scripted themselves. Scripted items can be tailored around global scripts that respond to both an item activation or a button press. Currently, though, you can't turn the L and R into functional and independent item buttons.

Gleeok
06-06-2008, 11:27 PM
Sure you can!

You can switch around the buttons all you like!



if(Link->InputR){Link->InputA=true;Link->InputR=false;}
if(Link->InputL){Link->InputB=true;Link->InputL=false;}
if(Link->InputA){Link->InputR=true;Link->InputA=false;}
if(Link->InputB){Link->InputL=true;Link->InputB=false;}


Note that while tecnically you can do what you are asking, it would require a bit of skill and manuevering to achieve, and likely that no one will make it for you.

C-Dawg
06-06-2008, 11:55 PM
russadwan doesn't know what he's talking about.

Yes, you can assign items to L and R. But you have to make your own scripts for everything: displaying the item, selecting the item, etc. Everything the engine does naturally, you have to script up.

Possible, but very time consuming and beyond you if you're new to scripting.

What isn't so hard is to just make a script that changes L to "Jump" and R to a sword attack using scripts. Many people are doing similar things with rolling or jumping.

Russ
06-07-2008, 12:20 AM
C-Dawg, that's what I was saying. I just didn't explain it very well.

Joe123
06-07-2008, 02:21 AM
http://www.armageddongames.net/forums/showthread.php?t=102336

That'll put jump on your L button.
If you want to make it look like it only happens when you get an item, it wouldn't be very hard.
All you'd need to do is add 'if(Link->Item[whatever]){' around the main block of the code in the global script, and then put a current item on your passive subscreen next to where it says 'L' or something.




This highlights the need for a way to activate an item independently of activating it via the A or B buttons.
This would make me very happy.



Sure you can!

You can switch around the buttons all you like!
Yeah, but it just ain't practical is it ¬_¬



Scripting a sword attack onto your R button shouldn't be too hard either.
I have a spear already made if you want to look.
As an item though, not as an R button.

Not that it would be difficult to modify.

bob1000
06-08-2008, 02:52 PM
"and then put a current item on your passive subscreen next to where it says 'L' or something."-Joe123

Actually, I already created a subscreen like that. I knew that the "Button Item" option didn't have "L" or "R", so I used "Current Item".

I mainly figured that it would say, "if...(InputR)...[then](IC_SWORD) or something. I guess I'll have to learn how to script first and then make it...

EDIT: Can someone provide a script assigning a scripted item to a button? If I have an example, I should be able to make it.

bob1000
07-07-2008, 01:24 PM
I'm posting again so that you can see the new post at the thread list without checking for the edit I did. Anyway, can someone (again) provide an example of a scripted item being assigned to the L/R button?

Joe123
07-07-2008, 01:30 PM
http://www.armageddongames.net/forums/showthread.php?t=102336
Jump (Roc's Feather if you like) assigned to the L button.

bob1000
07-08-2008, 11:05 PM
I wasn't asking for the jump script, and besides, it's useless in top-down. (It does nothing unless you're touching a wall south of you, and even then, it just plays the jump SFX.)

I was asking for a script assigning, say, the Flameshot or Guided Ice Missile, to a button.

Better yet, is there a variable that causes Link to use an item? I know the Item and Item Class IDs.

Joe123
07-09-2008, 03:01 AM
You asked for an example of a scripted item assigned to the L/R button.
You didn't specify what it was.

bob1000
07-09-2008, 12:55 PM
I was assuming the jump script wasn't an item. I actually used "Ctrl+F" to search for "roc", "feather" and "item". It came up blank.

Never mind, forget the examples. Just what's the variable that makes Link use an item?

Joe123
07-11-2008, 12:35 PM
There isn't a variable to do that.



I was asking for a script assigning, say, the Flameshot or Guided Ice Missile, to a button.
Ohhh! You just want me to stick a script I already wrote for an item onto a button!
Heh, that's easy.


//fire input
const int I_FLAMESHOT = 0; //set the item ID of your Flameshot item here.
const int firetile = 0; //set the tile for your fire projectile here.
const int firecset = 0; //set the CSet of the projectile here.
const int fireframes = 1; //set the number of frames of animation here.
const int firespeed = 0; //set the speed of animation here.
const int firemp = 8; //set the amount of magic for it to use here.
const int firedam = 1; //set the damage for it to deal here.


global script slot_2{
void run(){
int fireflagcheck;
while(true){
if(Link->InputL && Link->MP >= firemp && Link->Item[I_FLAMESHOT]){
Game->PlaySound(32);
Link->Action = LA_ATTACKING;
Link->InputL = false;
Waitframe();
while(Link->InputL && Link->MP >= firemp){
Link->Action = LA_FROZEN;
if(Screen->NumNPCs() > 0){
npc e = Screen->LoadNPC(Rand(Screen->NumNPCs())+1);
Fire(e->X,e->Y,firetile,firecset,fireframes,firedam,firespeed);
}else{
for(i=0;i<176;i++){
if(Screen->ComboF[i] == 76 || Screen->ComboI[i] == 76){
fireflagcheck = i;
i = 176;
}
}
if(fireflagcheck>0) Fire((fireflagcheck%16)*16,(Floor(fireflagcheck/16))*16,firetile,firecset,fireframes,firedam,fires peed);
else Fire(Rand(256)+1,Rand(168)+1,firetile,firecset,fir eframes,firedam,firespeed);
}
Link->MP -= firemp;
for(i=0;i<10;i++){
Link->InputL = false;
Waitframe();
}
}
Link->Action = 0;
}
Waitframe();
}
}
//fireball shooting code
void Fire (int x,int y,int ft,int c,int fr,int d,int fs){
lweapon f = Screen->CreateLWeapon(13);
f->Tile = ft; f->OriginalTile = ft;
f->NumFrames = fr; f->ASpeed = fs;
f->CSet = c;
f->Step = 3;
f->Damage = d;
f->X = Link->X;
f->Y = Link->Y;
f->Z = Link->Z;
f->Angular = true;
f->Angle = ArcTan((x-Link->X),(y-Link->Y));
}
}

Should work.
I can do the ice one for the R button sometime too if you like.
Not now though.
I'm lazy.

Anyway, inputs are noted at the top.
Do with them as you will.
If it doesn't work, let me know what the compiler says and I'll fix it up; I haven't actually checked it.
Should be fine though really.



And just incase you're reading C-Dawg, it's rapid-fire now ;-)

bob1000
07-13-2008, 09:08 PM
Okay, I modified a script I found and came up with this...


global script ljump{

void run(){
;
{
if (Link->InputL);{
Link->Jump = Link->2;
}
}
}

It compiles, but it just causes Link to start in the air and after that, it does nothing. How can I fix this?

Mega Link
07-14-2008, 04:46 PM
global script ljump{
void run(){
if (Link->InputL) {
Link->Jump = Link->2;
}
}
}
Try that.