Jump to content

Photo

A few questions


  • Please log in to reply
9 replies to this topic

#1 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 20 May 2017 - 04:41 PM

Okay, so I'm getting started on the new scripts for my quest, as well as redesigning dungeons, and I'm wondering about a few things:
 
I'm using an edited version of Mero's Lava/Pit script (Yeah, I know there are better ones out there, but I've been using this one for years, and am very familiar with how to edit it in order to make it suit my needs), and I wanted to make a central room in the Deku Tree that has webbing that covers a pit warp down to the basement level (You know, since there's one in the actual dungeon from OoT), and I'm already clear on how to change the webbing combos to the pit combos, but I'm not so clear on whether or not it's possible to make the webbing only break only when you fall from the third floor, is that something doable? So, in other words, if you fall through the pit warp on the second floor, the webbing won't change, but if you fall through the third floor's pit warp and THEN the second-floor pit, without touching any non-pit combos, then webbing will change to pit combos (permanently, if possible), and the pit warp will activate. If not, I think I can come up with a workaround, although it may be a bit messy, and I'm not sure if I can make it permanent. Figured it out, I think.
 
On a similar note, I'm duplicating and editing Mero's Hot Room script to make underwater rooms that you need the Zora Tunic to be in, and I'm planning to add Iron Boots that you need to walk around in said rooms, and that's easy enough (just have the floor combos change to a warp if you don't have the boots), but I was also thinking of using the opportunity to make Silver/Gold Scales That allow you to be in those rooms for a short period of time, figured it could make for some interesting puzzles involving the unequipping/re-equipping of the boots. If I were to do that, I'd need to do a few things that I'm not certain how to pull off (This really isn't mandatory to pull off the underwater room, but it adds a lot more polish):

 

-Create a timer that counts down based on which scale item you have

 

-If the timer hits 0, it warps Link to his current position or to a warp point on the associated dmap/screen (so that he can surface in the same spot he was in underwater, again, for puzzle-solving), and sets Link->Action to LA_SWIMMING (if I remember correctly, warps used to water combos usually leave Link standing on top of the water, if I'm wrong about this, ignore this part)

 

-Make Link ignore walkability if he doesn't have the Iron Boots, but not enemies. Replace Link's walking animation with a swimming animation (not the normal swimming tiles, cuz this is underwater swimming), unless he has Iron Boots on.

 

-Make an FFC that prevents you picking up items in the room unless they're the right "depth", i.e. Silver Scale can pick up some items, Golden Scale can pick up other items in addition to the ones the Silver Scale can, and the Iron Boots let you pick up any items in the room

 

-Set boot-switching to "L" (would assume that would consist of giving/taking away boot items in a cycle, the first press would add iron boots, second would add hover boots, and take away iron boots, third would take away hover boots). May also need to add scripts to both items to make Link slower or make his steps slippery.

 

-Set tunic-switching to "R": More for fun than anything, right now the underwater/hot rooms auto-equip the proper tunic if you have it, which is perfectly serviceable, but maybe some people want to run around in blue or red on the overworld, I know I wore the Zora Tunic EVERYWHERE in OoT. Which actually brings me to a point I needed to ask about (non-scripting-related), do the ring damage divisors stack if you have "keep lower level items" checked? Using the L2 ring for my "adult Link" LTMs, because it changes the game icon, and Level 3 rings for the Goron/Zora tunics (Actually not 100% certain if I can make both L3, since you'll never have them both in your inventory at the same time, and the dummy items which ARE in your subscreen will have different levels, but it may still add both rings every time you put one on... I think I had that issue with Arrows. May have to make the Zora Tunic L4, which kinda sucks for a later plan I had, but there are only 4 game icons, so... I could still add it in, though, it just wouldn't change the game icon), anyways, I need to know if I should be setting the damage divisors to 1 or 2 (Adult Link takes half the damage young Link does), so that his defenses stay the same, regardless of which tunic he has on.

 

Also trying to figure out a way to spawn more than one item per screen and make an item appear after a combo is triggered, have one screen in the lost woods which has a custom whistle trigger that leads to a heart piece in a cave and an arrow trigger that leads to a bigger quiver in a cave, but I would like to just make both items spawn either right on top of Link, or in a specific location on-screen

 

Is there any way to draw an entire layer in one combo and transparent via scripting? Adding the Song of Storms in, wanted to use layers 5 and 6 to make the rain/lightning effect (maybe with a nice recurring thunder SFX)

 

Regarding Moosh's Bottle script, wondering about how I'd go about adding a double serving of Milk into the mix, also a fish that has 1/x chance of spawning when you scoop up water, or a 1/y chance if you scoop up water with a fish hopping out of it (which would just be a different water combo), and maybe a Poe Soul you can put in a bottle which can have random effects (mostly negative, but with a 1/x chance of healing you completely), and then someone who will buy/take certain bottled items, if you talk to them.

 

I think I had more questions, but I've forgotten them, at the moment. Anyways, if anyone can point me in the right direction, I would very much appreciate it.


Edited by Binx, 22 May 2017 - 04:53 PM.


#2 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 21 May 2017 - 07:06 AM

Ring divisors do not stack, but you may write to them by script:
 
 
void SetRingDivisor(int ring_item_id, int divisor){
    itemdata id = Game->LoadItemData(ring_item_id);
    id->Power = divisor;
}
 
int RingStack(){
    itemdata id; int pow;
    id = Game->LoadItemData(I_RING1); pow += id->Power;
    id = Game->LoadItemData(I_RING2); pow += id->Power;
    return pow;
}
 
bool stacked;
 
void DoRingStack(int ring){
    if (!stacked) {
        SetRingDivisor(ring, RingStack());
        stacked = true;
    }
}
 
You can handle multiple items per screen easily with ffcs:
 
 
ffc script itemmaker{
    void run(int itm_id, int reg){

        //If the screen register is set, quit.
        if ( Screen->D[reg] ) Quit();

        //Determine what triggers making the item, and make the ffc wait until the trigger occurs.
        while( whatever conditions require waiting ) Waitframe();

        //The trigger occurred, so make the item.
        item i = Screen->CreateItem(itm_id);
        i->X = this->X; i->Y = this->Y;

        //Wait for link to collect the item.
        while(i->isValid()) Waitframe(); 
 
        //Link has it.
        Screen->D[reg] = 1; //Ensure that the item does not respawn once collected.
        
        //Free this ffc slot.     
        this->Data = 0; this->Script = 0; Quit();
    }
}
,
 

Is there any way to draw an entire layer in one combo and transparent via scripting? Adding the Song of Storms in, wanted to use layers 5 and 6 to make the rain/lightning effect (maybe with a nice recurring thunder SFX)


Run a for loop using that combo and raw it to all 176 positions.

 
//Call before Waitdraw() if raining.
void DrawRain(int combo_id, int cset, int frame, int layer){
    int x; int y; int q;
    for ( q = 0; q < 176; q++ ) {
        int x = ComboX(q); int y = ComboY(q);
        Screen->DrawCombo(layer, x, y, combo_id, 1, 1, cset, -1, -1, 0,0,0, frame, 0, true, 64);
    }
}
Run a timer for the frame if the combo is animated. This uses 176/1000 draws per frame.

I advise using the Ex buttons for shifting tunics, boots, and other gear; or an equip menu, so that the player may still use L and R freely to shift button items.

I also advise breaking up the text wall in your post, into paragraphs, if you want more people to read it. :P

I'm a bit lost at what you want to do with boots and tunics. If you want to make boots turn water into walkable combos, then you need to globally change the combo type of all walkable water to 'none' while the boots are active, and back to walkable water when the boots are inactive.

Edited by ZoriaRPG, 21 May 2017 - 07:32 AM.

  • Binx likes this

#3 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 21 May 2017 - 03:03 PM

I found one of my older ffcs for extra secret items:

//Additional Items on a Screen
//v0.2

const int KEY_PRIORITY_LEVEL_NORMAL = 0; //Level keys have priority, when using a key.
const int KEY_PRIORITY_NORMAL_LEVEL = 1; //Normal keys have priority, when using a key.

const int SFX_SECRET_ITEM = 63;
const int COND_KILL_ALL_ENEMIES = 1;
const int COND_KILL_SPECIFIC_ENEMY = 2;
const int COND_TRIGGERED_BY_ITEM = 3;
const int COND_TRIGGERED_BY_LWEAPON = 4;
const int COND_TRIGGERED_BY_EWEAPON = 5;
const int COND_TRIGGERED_BY_COLLISION = 6;
const int COND_TRIGGERED_BY_COMBO = 7;
const int COND_CHEST_UNLOCKD = 8;
const int COND_CHEST_UNLOCKD_SLASH = 9;
const int COND_CHEST_LOCKED = 10;
const int COND_CHEST_BOSSLOCKED = 11;



const int COLLISION_PAIR_

ffc script ExtraItem{
	void run(int condition, int itm, int reg, int dat, int collision_pair, int sfx, int required_pointer, int item_needed_first, int combo){
		bool triggered = false;
		bool ignore_npx = false;
		bool itemCreated = false;
		bool itemTaken = false; 
		item i;
		while(true){
			if ( ! triggered ) {
				if ( condition == COND_KILL_ALL_ENEMIES ) {
					if ( !Screen->NumNPCs ) triggered = true;
					for ( int q = 1; q < Screen->NumNPCs(); q++ ) {
						npc n = Screen->LoadNPC(q);
						if ( q->Type == NPCT_GUY || q->Type == NPCT_TRAP || q->Type == NPCT_ROCK 
							|| q->Type == NPCT_FAIRY ) {
								ignore_npc = true;
								continue;
						}
						else {
							ignore_npc = false; 
							break;
						}
					}
					if ( ignore_npc ) triggered = true;
				}
				
				//If a chest type
					//If a normal chest
					//check if Link is standing in front of it
					//If so,a nd hepresses a button
					//change the chest combo ++
					//make the item
				
					//if it is a slash chest 
					//if link slashes it
					//change the chest combo ++
					//make the item
				
					//if it is a locked chest
					//and link is in front of it
					//and has a key or Lkey
					//and presses up for a few seconds
					//remove a key, normal keys have priority
						//or lkeys have priority
						//! WE NEED AN OPTION FOR THIS
					//change the chest combo ++
					//make the item
				
					//if it is a boss lock chest
					//and link has LItem BOSSKEY
					//and is standing in front of it for a few seconds
					//open it, and change the chest combo ++
					//make the item
				
				Waitframe();
			}
			if ( triggered && !itemTaken && !itemCreated ) {
				itemCreated = true;
				if ( sfx ) Game->PlaySound(sfx);
				else Game->PlaySound(SFX_SECRET_ITEM);
				i = Screen->CreateItem(itm);
				i->X = this->X;
				i->Y = this->Y;
				if ( LinkCollision(i) ) itemTaken = true;
				Waitframe();
			}
			if ( triggered && itemCreated && !itemTaken && LinkCollision(i) ) itemTaken = true; 
			Waitframe();
		}
	}
}

  • Binx likes this

#4 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 21 May 2017 - 11:47 PM

I don't need to write to the rings via script, I can just set the ring items to the same damage divisor, but thanks, anyway.
 
Regarding the boots, I think I have an idea of what I'm going to do there; say you've got a room with blocks in it blocking off where you need to get to go, you'd remove the boots, which would change the block combos to walkable versions (and back if you put the boots back on). I could even use multiple block combos for representing different depths, rendering certain blocks impassable regardless of whether you're "swimming" or walking, and make puzzles where you have to get through an area before you surface, or you could activate your boots and reset the timer, which works in conjunction with the Gold and Silver Scale items to determine how long Link can stay underwater without the iron boots without being brought to the surface.

 

Then I'd make Link invisible, and use DrawTile to put the "underwater swimming" tiles over where the invisible Link is. At no point will I be using the actual built-in swimming action (except when warping back to a surface screen, because Link will be on water combos, obviously). The only thing I'm not sure about is the warping back to the associated above water screen (given potential issues with walkability, but I do want Link's position to stay constant, for puzzle solving purposes, like if you can't get across a room, you may be able to dive under the obstacles), and how to make the timer work.


Edited by Binx, 22 May 2017 - 02:48 PM.


#5 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 22 May 2017 - 03:53 AM

I don't need to write to the rings via script, I can just set the ring items to the same damage divisor, but thanks, anyway.


Ah, well, I thought that you wanted Ring-2 to have a different modifier if the player also has Ring-1.
 

Regarding the boots, I think I have an idea of what I'm going to do there; say you've got a room with blocks in it blocking off where you need to get to go, you'd remove the boots, which would change the block combos to walkable versions (and back if you put the boots back on). I could even use multiple block combos for representing different depths, rendering certain blocks impassable regardless of whether you're "swimming" or walking, and make puzzles where you have to get through an area before you surface, or you could activate your boots and reset the timer, which works in conjunction with the Gold and Silver Scale items to determine how long Link can stay underwater without the iron boots without being brought to the surface.

Then I'd make Link invisible, and use DrawTile to put the "underwater swimming" tiles over where the invisible Link is. At no point will I be using the actual built-in swimming action (except when warping back to a surface screen, because Link will be on water combos, obviously). The only thing I'm not sure about is the warping back to the associated above water screen (given potential issues with walkability, but I do want Link's position to stay constant, for puzzle solving purposes, like if you can't get across a room, you may be able to dive under the obstacles), and how to make the timer work.



#6 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 22 May 2017 - 02:56 PM

Ah, well, I thought that you wanted Ring-2 to have a different modifier if the player also has Ring-1.
 

Basically, what I'm doing is using the higher level rings for the cset swap, all I need is for Link's defenses to not change when he puts on the tunics. I didn't want to put a damage divisor of 1 if they don't stack, or a damage divisor of 2, if they did; and have it mess up my defenses. Besides, you can use Peril Rings to mess with defenses if you need to stack divisors (which I plan to do for the defense upgrade near the end of the quest).



#7 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 22 May 2017 - 04:40 PM

Basically, what I'm doing is using the higher level rings for the cset swap, all I need is for Link's defenses to not change when he puts on the tunics. I didn't want to put a damage divisor of 1 if they don't stack, or a damage divisor of 2, if they did; and have it mess up my defenses. Besides, you can use Peril Rings to mess with defenses if you need to stack divisors (which I plan to do for the defense upgrade near the end of the quest).

 

Now you see why I spent the time ensuring that you can now write to the CSet and Link Tile Modifier values for those bastards.  :D


  • Binx likes this

#8 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 22 May 2017 - 05:09 PM

Yeah. On a similar note, is there a way to allow players to lose higher level items if they pick up a lower-level item? More out of curiosity than anything.



#9 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 22 May 2017 - 05:36 PM

Yeah. On a similar note, is there a way to allow players to lose higher level items if they pick up a lower-level item? More out of curiosity than anything.

 

You could run a for loop in an item pick up script, and disable items of the same this->Family that have a level greater than this->Level. Fester's Quest kek?



#10 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 22 May 2017 - 05:54 PM

Considering adding (to a different quest) a low-level ring item with a script that increases damage, and reduces MP cost of items that use MP, but provides no defense bonus. Not sure if I will, but it might be a nice touch, The backstory of the main character is that he recently discovered a latent affinity for magic, and the L1 ring described above would be a set of mage's robes, while the level 2 and 3 will be chainmail and platemail, respectively (and will be regular rings). So I wanted players to be able to switch between armors. If an area's enemies hit too hard, wear heavier armor, if they have too much health, wear the robes. Of course, I may not do this at all, given that I'm trying to use as few scripts as possible, and this is a bit beyond the necessary.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users