Jump to content

I Dunno

Photo

A plan sort of thing?


  • Please log in to reply
16 replies to this topic

#1 Plutia

Plutia

    CPU of Planeptune

  • Members
  • Real Name:Iris Heart

Posted 26 December 2014 - 11:46 AM

I've completed 2 more mini dungeons, but there's one thing I want to make happen before I release another demo.

Basically, I want it so each sword you pick up upgrades your sword. I've already tried using 'collecting 2 upgrades it' but it won't go above the White Sword that way. I want to replace all the sword pickups with wooden swords so that you don't just beeline for the place that has the master sword and instead have to upgrade it this way.

I want to do the same thing with rings.

I'm assuming there's some sort of script for this I might need? Would like help.

#2 Plutia

Plutia

    CPU of Planeptune

  • Members
  • Real Name:Iris Heart

Posted 26 December 2014 - 12:12 PM

Evan sent me his item combining script, which works perfect for rings and arrows and such, but only lets me get to the magic sword. Debating on what to do with the master sword, thinking on just throwing it behind a level 3 sword beam block or something like that.



#3 Twilight Knight

Twilight Knight

    Tell all with glee, Argon's on PureZC

  • Members
  • Real Name:Sven
  • Location:Rotterdam, NL

Posted 26 December 2014 - 12:13 PM

Yes, the easiest way would be a script indeed. A script that adds 1 to a counter when you pick up a sword. And from that counter the "final" sword is derived.

 

I could script this for you, but note that you can't add the items with the init data in order for this to work.



#4 Plutia

Plutia

    CPU of Planeptune

  • Members
  • Real Name:Iris Heart

Posted 26 December 2014 - 12:17 PM

Yes, the easiest way would be a script indeed. A script that adds 1 to a counter when you pick up a sword. And from that counter the "final" sword is derived.

 

I could script this for you, but note that you can't add the items with the init data in order for this to work.

That'd be much appreciated, thanks! None of the swords are given to you at the start, so it should work.



#5 Twilight Knight

Twilight Knight

    Tell all with glee, Argon's on PureZC

  • Members
  • Real Name:Sven
  • Location:Rotterdam, NL

Posted 28 December 2014 - 08:29 PM

My apologies, but I almost forgot I said I would make this.

int swordCounter = 0;
int swordMax = 4;
int swordId = 36;

item script swordUpgrade{
	void run(){
		swordCounter++;
		if(swordCounter >= swordMax){
			Link->Item[swordId] = true;
		}
	}
}

This is really the easiest way you could do this I think.

 

Just put this piece of code in your script file. Change the value of swordMax if you want a different amount of swords collected before you get the final sword. Change the value of swordId to the id of the final sword (by default, the L4 sword (master) is 36). Then go to the item editor and set this script as pickup script.

 

I think that will suit your needs. I tested it and it works perfectly. If you need the item message script integrated in this, let me know.



#6 Plutia

Plutia

    CPU of Planeptune

  • Members
  • Real Name:Iris Heart

Posted 28 December 2014 - 11:12 PM

Oh, thanks! I'll implement it tomorrow.

Speaking of messages, how does one add a background to the messages? i've been unable to figure this out so far. I'm assuming this is the reason the messages were always in black rooms in the original.



#7 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 28 December 2014 - 11:33 PM

There's a black box beneath "SFX" in the Attributes tab of the string editor. You can click on that and choose a tile for your string. It needs to be the top left of a 2 by 2 block. And that box you see on page 0 of the Classic tileset has a transparent, not black background, just so you know.



#8 Plutia

Plutia

    CPU of Planeptune

  • Members
  • Real Name:Iris Heart

Posted 28 December 2014 - 11:52 PM

I... probably would never have found that. Thanks for the help!



#9 Plutia

Plutia

    CPU of Planeptune

  • Members
  • Real Name:Iris Heart

Posted 29 December 2014 - 08:58 AM

My apologies, but I almost forgot I said I would make this.

int swordCounter = 0;
int swordMax = 4;
int swordId = 36;

item script swordUpgrade{
	void run(){
		swordCounter++;
		if(swordCounter >= swordMax){
			Link->Item[swordId] = true;
		}
	}
}

This is really the easiest way you could do this I think.

 

Just put this piece of code in your script file. Change the value of swordMax if you want a different amount of swords collected before you get the final sword. Change the value of swordId to the id of the final sword (by default, the L4 sword (master) is 36). Then go to the item editor and set this script as pickup script.

 

I think that will suit your needs. I tested it and it works perfectly. If you need the item message script integrated in this, let me know.

It only upgrades to master once all four have been found, but what I want is for it to upgrade with each wooden sword found, ending at master sword. The way I have it set up now it upgrades to White after the first two have been found but then doesn't upgrade to Magic when the third has been found. I'll try some more stuff to see if I can get it to work, though.



#10 justin

justin

    Adept

  • Members

Posted 29 December 2014 - 09:21 AM

try this.  just set the constants to the values of your swords.  

create a dummy item with your wooden sword graphic.  set the item class as one of the custom classes. attach the script to the pickup script of this dummy item.

 

// set these to the Item#s of your swords.  Wood = lvl1, White = lvl2, Magic = lvl3, Master = lvl4
const int SWORDWOOD = 0;
const int SWORDWHITE = 0;
const int SWORDMAGIC = 0;
const int SWORDMASTER = 0;
 
item script swordUpgrade{
       void run(){
              if(!Link->Item[SWORDWOOD]){
                     Link->Item[SWORDWOOD] = true;
              }else if(!Link->Item[SWORDWHITE]){
                     Link->Item[SWORDWHITE] = true;
              }else if(!Link->Item[SWORDMAGIC]){
                     Link->Item[SWORDMAGIC] = true;
              }else if(!Link->Item[SWORDMASTER]){
                     Link->Item[SWORDMASTER] = true;
              }       
       }
}

Edited by justin, 29 December 2014 - 10:09 AM.


#11 Plutia

Plutia

    CPU of Planeptune

  • Members
  • Real Name:Iris Heart

Posted 29 December 2014 - 09:32 AM

Gives me a compiling error at

                     Link-Item[SWORDWHITE] = true;



#12 justin

justin

    Adept

  • Members

Posted 29 December 2014 - 09:37 AM

whoops.  edited above.



#13 Plutia

Plutia

    CPU of Planeptune

  • Members
  • Real Name:Iris Heart

Posted 29 December 2014 - 09:41 AM

It sends me directly to White Sword after picking up the first sword.. which is probably something I could just work around, since the first two swords are very close to each other.



#14 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 29 December 2014 - 09:44 AM

Might be easier to just have some dummy item increment a script counter, and give swords based on that. It would let you give them all different graphics, too, instead of having four wooden swords lying around.



#15 justin

justin

    Adept

  • Members

Posted 29 December 2014 - 10:11 AM

It sends me directly to White Sword after picking up the first sword.. which is probably something I could just work around, since the first two swords are very close to each other.

 

yup.  that was an oversight on my part.  if i had actually stopped to think for a second...  the coffee is finally coursing through my veins and the cloud of sleep leaving my brain.

edited above again, read the instructions again because they are different.

 

 

Might be easier to just have some dummy item increment a script counter, and give swords based on that. It would let you give them all different graphics, too, instead of having four wooden swords lying around.

 

dummy item was needed.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users