Jump to content

Photo

1 time item shop, paywall, level specific keys contained in other leve


  • Please log in to reply
18 replies to this topic

#1 Smiles the Death Bringer

Smiles the Death Bringer

    The smiling demon!

  • Members
  • Real Name:William
  • Location:Dream Land

Posted 15 January 2018 - 07:05 PM

I didn't realize there was a size limit on forums titles, so just consider this "Four solutions to one problem"

The new quest I'm working on is only going to have a finite amount of money, so it will also need a finite amount of items to buy so you don't waste money buying the same item over again.

 

I thought of 4 ways to tackle this problem (in the order I'd most like to least like):

1. The ability to get level x keys in level y, and lock blocks that use multiple keys, that way I can lock the shops.

2. A lock block that unlocks with money.

3. Shops where you can only buy an item once (I tried using Zoria's Uber Shop, but after 2 hours of trying, I can't get it to work).

4. That you don't lose the money you spend, that way re-buying items doesn't screw you out of others. So, it'll be more like experience instead of money.

 

Feel free to use any of these, or if you can think of another way around my problem, please let me know.


Edited by Smiles the Death Bringer, 15 January 2018 - 07:39 PM.


#2 judasrising

judasrising

    I play guitar

  • Members
  • Location:Sweden but born in Finland

Posted 16 January 2018 - 04:07 AM

I didn't realize there was a size limit on forums titles, so just consider this "Four solutions to one problem"

The new quest I'm working on is only going to have a finite amount of money, so it will also need a finite amount of items to buy so you don't waste money buying the same item over again.

 

I thought of 4 ways to tackle this problem (in the order I'd most like to least like):

1. The ability to get level x keys in level y, and lock blocks that use multiple keys, that way I can lock the shops.

2. A lock block that unlocks with money.

3. Shops where you can only buy an item once (I tried using Zoria's Uber Shop, but after 2 hours of trying, I can't get it to work).

4. That you don't lose the money you spend, that way re-buying items doesn't screw you out of others. So, it'll be more like experience instead of money.

 

Feel free to use any of these, or if you can think of another way around my problem, please let me know.

Hm i have also several shops in my quest and those just sells one item once then the shop closes off and i am using Zorias Uber shop..

i belive you missed something in the setup for it.



#3 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 16 January 2018 - 06:13 AM

If you want a very simple one item shop, make a special item room and have a rupee decrease on the item in the pickup tab.

 

EDIT: See following posts in this thread for correction


Edited by Cukeman, 31 January 2018 - 06:00 PM.

  • Anthus likes this

#4 Smiles the Death Bringer

Smiles the Death Bringer

    The smiling demon!

  • Members
  • Real Name:William
  • Location:Dream Land

Posted 16 January 2018 - 08:39 AM

If you want a very simple one item shop, just make a special item room and have a rupee decrease on the item in the pickup tab. Just sharing for anyone who might want to know that (because I recently realized that).

I just tested it, you can still pick up the item even if you don't have enough rupees.


Edited by Smiles the Death Bringer, 16 January 2018 - 08:46 AM.


#5 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 16 January 2018 - 11:07 AM

rats. thanks for letting me know though



#6 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 31 January 2018 - 04:36 AM

Actually I think you could make the special item subtracting rupees work with some clever string control code use:

 

https://www.purezc.n...73299&p=1032118

 

Message string plays when you enter room.

If you have enough rupees to buy the item (go to if counter), switch to (give item) string that gives Link the kill all enemies item.

Kill all enemies triggers warp to screen with the special item when you dismiss the message.

So Link won't have access to the item unless he has enough rupees to "buy it", and it won't reappear after he picks it up and "buys it".


Edited by Cukeman, 31 January 2018 - 01:33 PM.

  • Anthus and strike like this

#7 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 01 February 2018 - 03:56 AM

I didn't realize there was a size limit on forums titles, so just consider this "Four solutions to one problem"
The new quest I'm working on is only going to have a finite amount of money, so it will also need a finite amount of items to buy so you don't waste money buying the same item over again.
 
I thought of 4 ways to tackle this problem (in the order I'd most like to least like):
1. The ability to get level x keys in level y, and lock blocks that use multiple keys, that way I can lock the shops.
2. A lock block that unlocks with money.
3. Shops where you can only buy an item once (I tried using Zoria's Uber Shop, but after 2 hours of trying, I can't get it to work).
4. That you don't lose the money you spend, that way re-buying items doesn't screw you out of others. So, it'll be more like experience instead of money.
 
Feel free to use any of these, or if you can think of another way around my problem, please let me know.


Did you compile all of the included Tango.zh headers, and assign the global script?

#8 Smiles the Death Bringer

Smiles the Death Bringer

    The smiling demon!

  • Members
  • Real Name:William
  • Location:Dream Land

Posted 05 February 2018 - 05:29 PM

I took the code out of the example quest:

																												import "std.zh"
import "ffcscript.zh"
//import "string.zh"
import "stdExtra.zh"
import "ghost.zh"
import "Laser.zh"
import "styles.zh"
import "Tango.zh"


import "script/pickUp.z"
import "script/pickUpHCP.z"
import "script/RealNPC.z"
import "script/readsign4.z"
import "script/Titlescreen.z"
import "script/potscript.z"
//import "script/newshopnew2.z"
//import "script/doorshop2.z"
import "JudasRising_Shop_v0.7.3.zs"



//import "script/slot_2shop.z"
//import "script/slot_3shop.z"

I put all the scripts I could find in the same file and those I couldn't find, I would comment out.

But I still get a compile error.



#9 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 06 February 2018 - 08:17 AM

I took the code out of the example quest:

																												import "std.zh"
import "ffcscript.zh"
//import "string.zh"
import "stdExtra.zh"
import "ghost.zh"
import "Laser.zh"
import "styles.zh"
import "Tango.zh"


import "script/pickUp.z"
import "script/pickUpHCP.z"
import "script/RealNPC.z"
import "script/readsign4.z"
import "script/Titlescreen.z"
import "script/potscript.z"
//import "script/newshopnew2.z"
//import "script/doorshop2.z"
import "JudasRising_Shop_v0.7.3.zs"



//import "script/slot_2shop.z"
//import "script/slot_3shop.z"

I put all the scripts I could find in the same file and those I couldn't find, I would comment out.
But I still get a compile error.

 
 
Here's an updated package of the Menu Shop that includes all of the headers that you'll require, and a readme file for versions of ZC that do not include string.zh by default.
 
If you are already using ghost.zh in your quest, you will not want to replace it with the ghost.zh in the package.
 
Likewise, if you are already using ffcscript.zh, do not use the one in the ZIP.
 
The settings for the menu backdrop, the cursor combo, and the menu sounds are in the file styles.zh.
 
Cursor and sound settings:
 
    Tango_SetStyleAttribute(style, TANGO_STYLE_MENU_CURSOR_COMBO, 22912);
    Tango_SetStyleAttribute(style, TANGO_STYLE_MENU_CURSOR_CSET, 0);
    Tango_SetStyleAttribute(style, TANGO_STYLE_MENU_CURSOR_WIDTH, 8);
    Tango_SetStyleAttribute(style, TANGO_STYLE_MENU_CURSOR_MOVE_SFX, 5);
    Tango_SetStyleAttribute(style, TANGO_STYLE_MENU_SELECT_SFX, 35);
    Tango_SetStyleAttribute(style, TANGO_STYLE_MENU_CANCEL_SFX, 44);
 
Window backdrop settings:
        Tango_SetStyleAttribute(style, TANGO_STYLE_BACKDROP_TILE, 62740);
        Tango_SetStyleAttribute(style, TANGO_STYLE_BACKDROP_WIDTH, 8);
        Tango_SetStyleAttribute(style, TANGO_STYLE_BACKDROP_HEIGHT, 3);
        
        Tango_SetStyleAttribute(style, TANGO_STYLE_TEXT_WIDTH, 112);
        Tango_SetStyleAttribute(style, TANGO_STYLE_TEXT_HEIGHT, 24);
        //Tango_SetStyleAttribute(style, TANGO_STYLE_FLAGS, TANGO_FLAG_FREEZE_SCREEN);
    }
    else if (size==SIZE_WIDE)
    {
        Tango_SetStyleAttribute(style, TANGO_STYLE_BACKDROP_TILE, 29440);
        Tango_SetStyleAttribute(style, TANGO_STYLE_BACKDROP_WIDTH, 14);
        Tango_SetStyleAttribute(style, TANGO_STYLE_BACKDROP_HEIGHT, 3);
        
        Tango_SetStyleAttribute(style, TANGO_STYLE_TEXT_WIDTH, 112);
        Tango_SetStyleAttribute(style, TANGO_STYLE_TEXT_HEIGHT, 24);
        //Tango_SetStyleAttribute(style, TANGO_STYLE_FLAGS, TANGO_FLAG_FREEZE_SCREEN);
    }
    else
    {
        Tango_SetStyleAttribute(style, TANGO_STYLE_MENU_CURSOR_MOVE_SFX, 104);
        Tango_SetStyleAttribute(style, TANGO_STYLE_BACKDROP_TILE, 62749);
        Tango_SetStyleAttribute(style, TANGO_STYLE_BACKDROP_WIDTH, 8);
        Tango_SetStyleAttribute(style, TANGO_STYLE_BACKDROP_HEIGHT, 5);
        
        Tango_SetStyleAttribute(style, TANGO_STYLE_TEXT_WIDTH, 112);
        Tango_SetStyleAttribute(style, TANGO_STYLE_TEXT_HEIGHT, 64);
 
This does not work with the normal distribution of Tango.zh.  If you are already using Tango, then avoid using this script, as the modifications needed, are too complex for a non-scripter to perform.

If you encounter errors, post them. You can find them, automatically saved, inside of allegro.log.

If you have an existing global active script, you will need to merge global script Tango, into it.

If you have a global Init script, you will need to do the same with the included Init script.


All settings related to the shop script are in the file JudasRising_Shop_v0.7.3.zs.
  • ShadowTiger likes this

#10 Smiles the Death Bringer

Smiles the Death Bringer

    The smiling demon!

  • Members
  • Real Name:William
  • Location:Dream Land

Posted 06 February 2018 - 10:10 AM

This is all of the scripts I'm using.

import "std.zh"
																												import "std.zh"
import "ffcscript.zh"
import "string.zh"
import "stdExtra.zh"
import "ghost.zh"
import "Laser.zh"
import "styles.zh"
import "Tango.zh"


//import "script/pickUp.z"
//import "script/pickUpHCP.z"
//import "script/RealNPC.z"
//import "script/readsign4.z"
//import "script/Titlescreen.z"
//import "script/potscript.z"
//import "script/newshopnew2.z"
//import "script/doorshop2.z"
import "JudasRising_Shop_v0.7.3.zs"



//import "script/slot_2shop.z"
//import "script/slot_3shop.z"





//=============================================================================================
//======================================= *FFC Scripts* =======================================
//=============================================================================================

// 1.- Signpost Script by Joe123

//FUNCTIONALITY: Attach this script to an FFC and edit its Arguments to your needs.

ffc script Signpost{
    void run(int m,int input){
        int loc = ComboAt(this->X,this->Y);
        while(true){
            while(!AgainstComboBase(loc) || !SelectPressInput(input)) Waitframe();
            SetInput(input,false);
            Screen->Message(m);
            Waitframe();
        }
    }
    bool AgainstComboBase(int loc){
        return Link->Z == 0 && (Link->Dir == DIR_UP && Link->Y == ComboY(loc)+8 && Abs(Link->X-ComboX(loc)) < 8);
    }
}

//!!These functions should only be included in your script file once!!
bool SelectPressInput(int input){
    if(input == 0) return Link->PressA;
    else if(input == 1) return Link->PressB;
    else if(input == 2) return Link->PressL;
    else if(input == 3) return Link->PressR;
}
void SetInput(int input, bool state){
    if(input == 0) Link->InputA = state;
    else if(input == 1) Link->InputB = state;
    else if(input == 2) Link->InputL = state;
    else if(input == 3) Link->InputR = state;
}

//----------------------------------------------------------------------------------
//2.- Advanced Grass by Raiu

//FUNCTIONALITY: Attach this script to an FFC and edit the Arguments to your needs.
//               (The suggested arguments are fine by default with DoR Hybrid).

// AdvGrass.z
// A script that correctly displays tall grass combos relationally
// (Searches layer 0 for tall grass combos, and draws new combos over them
// Good for grass combos that have a "border" of sorts around them)
// By Raiu
//
// Arrange tiles like this:
// Lone, DownVertEnd, UpVertEnd, Vertical, RightHorzEnd, DownRight, UpRight, Right, LeftHorzEnd, DownLeft, UpLeft, Left, Horizonal, Down, Up, Middle
// (this script does not support inside corner graphics...)
//
// D0 = Combo Type
//		Tallgrass = 57
//		Tallgrass continuous = 136
//		Tallgrass -> next = 141
// D1 = First Tile of the above (DoR Hybrid Default: 13144)
// D2 = Cset to use (DoR Hybrid Default: 3)
// D3 = Layer to Draw on: 0

ffc script AdvGrass{
	void run(int inType, int inTile, int inCset, int inLayer){
		Waitframe();
		int adj=0;
		while(true){
			for(int x = 0; x<16; x++){
				for(int y = 0; y<11; y++){
					if(Screen->ComboT[CIndex(x,y)]==inType){
						if(Screen->ComboT[CIndex(x,y-1)]==inType) adj+=1;
						if(Screen->ComboT[CIndex(x,y+1)]==inType) adj+=2;
						if(Screen->ComboT[CIndex(x-1,y)]==inType) adj+=4;
						if(Screen->ComboT[CIndex(x+1,y)]==inType) adj+=8;
						if(adj!=15){
							Screen->DrawTile(inLayer, x*16, y*16, inTile+adj, 1, 1, inCset, -1,-1, 0, 0, 0, 0, 1, 128);
						}
					adj=0;
					}
				}	
			}
			Waitframe();
		}
	}
	int CIndex(int x, int y){
		if(x<0||x>15||y<0||y>10) return -1;
		return y*16 + x;
	}
}

// This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
//----------------------------------------------------------------------------------





//==============================================================================================
//======================================= *Item Scripts* =======================================
//==============================================================================================

// 1.- Item Pickup Sting by Joe123

//FUNCTIONALITY: Attach this script to the Action slot of an Item within the Scripts Tab.
//               D0 is the string to display for a certain item. 

item script Message{
	void run(int m){
		Screen->Message(m);
	}
}

//----------------------------------------------------------------------------------
// 2.- Heart Piece Message by Moscowmodder

//FUNCTIONALITY: Attach this to the Pickup script slot of an item within its Scripts Tab.
//               Set the arguments to your needs.

//Old version: supports only 4-piece heart containers
//Messages can be set automatically or manually
//D0 = First message
//D1-3 = Second-fourth messages; default to strings after D0

item script heartPieceMessageOld{
	void run (int m1, int m2, int m3, int m4){
		//Set m2-4 to follow m1 if not set explicitly
		if ( m2 == 0 ) m2 = m1+1;
		if ( m3 == 0 ) m3 = m1+2;
		if ( m4 == 0 ) m4 = m1+3;
		
		//Play the appropriate message
		if ( Game->Generic[GEN_HEARTPIECES] == 0 )
			Screen->Message(m1);
		if ( Game->Generic[GEN_HEARTPIECES] == 1 )
			Screen->Message(m2);
		if ( Game->Generic[GEN_HEARTPIECES] == 2 )
			Screen->Message(m3);
		if ( Game->Generic[GEN_HEARTPIECES] == 3 )
			Screen->Message(m4);
	}
}

//FUNCTIONALITY: Attach this to the Pickup script slot of an item within its Scripts Tab.
//               Set the arguments to your needs.

//New version: supports any number of heart containers
//D0 = String # of first message
//All other messages *MUST* follow the first

item script heartPieceMessage{
	void run ( int message ){
		Screen->Message ( message + Game->Generic[GEN_HEARTPIECES] );
	}
}

//-----------------------------------------------------------------------------
// 3.- Item Bundle Script by Nick

//FUNCTIONALITY: Attach this to the Pickup script slot of an item within its Scripts Tab.
//               Set the arguments to your needs.

// This script is a pickup script that will give some items.
// This was mostly made to bundle the Bow and Arrows into one item,
// but it could have other uses.
// Bundle this with an item that increases a counter to also increase counters.
// 	   D0-D7: Items to give.
//		D0: If D0 is negative, it will display an item pickup message containing the positive version of the number entered...
item script itemBundle{
	void run(int item1, int item2, int item3, int item4, int item5, int item6, int item7, int item8)
	{
		if(item1 > 0)
			Link->Item[item1] = true;
		if(item2 > 0)
			Link->Item[item2] = true;
		if(item3 > 0)
			Link->Item[item3] = true;
		if(item4 > 0)
			Link->Item[item4] = true;
		if(item5 > 0)
			Link->Item[item5] = true;
		if(item6 > 0)
			Link->Item[item6] = true;
		if(item7 > 0)
			Link->Item[item7] = true;
		if(item8 > 0)
			Link->Item[item8] = true;
			
		// Display Item pickup message?
		if(item1 < 0)
		{
			Screen->Message(item1 * -1);
		}
	}//!End void run()
}//!End item script itemBundle
//----------------------------------------------------------------------------

const int CR_SWORDPART = 10; //The 'Script / Custom 4' counter.
int I_HUNDRED_PIECE_SWORD = 123; //Custom item 1
 
const int HUNDRED_PIECE_SWORD_BASE_POWER = 1; //The minimum damage of the sword, before it is upgraded.
 
//A pick-up/collect script. Attach to a sword piece item.
//If you want ZC to display a screen string when the player picks it up, assign the ZQuest String ID
//to the D0 arg.
//If you want a special message when the player collects ten pieces, assign that ZQuest
//string to the D1 arg.
//If you want this to play a special sound if the player picks up ten pieces, assign that Sound Effect
//ID to the D2 arg.
//!Dimentio Edit: Fixed decimal values being passed to sword->Power,
//!Fixed bug where having 10-19 sword pieces is the same as having 0-9.
item script swordpart
{
    void run(int msg_id, int special_msg_id, int special_sfx)
    {
        ++Game->Counter[CR_SWORDPART];
        itemdata sword = Game->LoadItemData(I_HUNDRED_PIECE_SWORD);
        sword->Power = Max((Floor(Game->Counter[CR_SWORDPART] / 10) + 1), HUNDRED_PIECE_SWORD_BASE_POWER);
        
        
        if ( Game->Counter[CR_SWORDPART] % 10 || special_msg_id < 1 )
        {
            Screen->Message(msg_id);
        }
        else
        {
            Screen->Message(special_msg_id);
            if ( Game->Counter[CR_SWORDPART] % 10 == 0 && special_sfx )
            {
                Game->PlaySound(special_sfx);
		++I_HUNDRED_PIECE_SWORD;
		Link->Item[I_HUNDRED_PIECE_SWORD] = true;
            }
        }
        
    }
}
 
//Assign this to global slot 4 ('onContinue')
//This re-applies the power modifications to the sword, every time that the player returns to
//the game, after exiting.
//!Dimentio Edit: Fixed decimal values being passed to sword->Power,
//!Fixed bug where having 10-19 sword pieces is the same as having 0-9.
global script OnContinue
{
    void run()
    {
        itemdata sword = Game->LoadItemData(I_HUNDRED_PIECE_SWORD);
        sword->Power = Max((Floor(Game->Counter[CR_SWORDPART] / 10) + 1), HUNDRED_PIECE_SWORD_BASE_POWER);
    }
}
    
//!Dimentio Edit: This entire ffc script + comments. Sorry Zoria, I don't think your method was the most efficient.
//D0: Number of pieces you need to own to trigger
//D1: Flag to trigger
//The way this works is that it changes all combos with flag D1 to the wooden sword trigger flag.
//Leaving things to the engine is generally a safe way to do thing.
//This also means you only need one script of this running.

const int HUNDRED_PIECE_SWORD_FLAG = 102; //Script 5

ffc script sword_power_triggers
{
    void run(int power, int flag)
    {
        if ( flag < 1 ) flag = HUNDRED_PIECE_SWORD_FLAG;
	{
       			while(true)
        		{
	    			if (Game->Counter[CR_SWORDPART] >= power)
	    			{
					for (int i = 0; i < 176; i++)
                			{
                    				if (Screen->ComboF[i] == flag)
                    				{
                        				Screen->ComboF[i] = CF_SWORD1;
                    					}
                    				if (Screen->ComboI[i] == flag)
                    				{
                        Screen->ComboI[i] = CF_SWORD1;
                    }
                }
            }
            Waitframe();
        }
    }
}
}  

I imported all the files into the zc folder with everything else.

Here's the error I'm getting:

Pass 1: Parsing
Pass 2: Preprocessing
std_functions.zh, line 1190: Error P35: There is already a constant with name AT_RANDANGULAR defined.
std_functions.zh, line 1189: Error P35: There is already a constant with name AT_RAND8DIR defined.
std_functions.zh, line 1188: Error P35: There is already a constant with name AT_RAND4DIR defined.
std_functions.zh, line 1187: Error P35: There is already a constant with name AT_ANGULAR defined.
std_functions.zh, line 1186: Error P35: There is already a constant with name AT_8DIR defined.
std_functions.zh, line 1185: Error P35: There is already a constant with name AT_4DIR defined.
std_functions.zh, line 1184: Error P35: There is already a constant with name AT_NONE defined.

I'm using 2.50.2 btw


Edited by Smiles the Death Bringer, 06 February 2018 - 11:23 AM.


#11 judasrising

judasrising

    I play guitar

  • Members
  • Location:Sweden but born in Finland

Posted 06 February 2018 - 12:31 PM

This is all of the scripts I'm using.

import "std.zh"
																												import "std.zh"
import "ffcscript.zh"
import "string.zh"
import "stdExtra.zh"
import "ghost.zh"
import "Laser.zh"
import "styles.zh"
import "Tango.zh"


//import "script/pickUp.z"
//import "script/pickUpHCP.z"
//import "script/RealNPC.z"
//import "script/readsign4.z"
//import "script/Titlescreen.z"
//import "script/potscript.z"
//import "script/newshopnew2.z"
//import "script/doorshop2.z"
import "JudasRising_Shop_v0.7.3.zs"



//import "script/slot_2shop.z"
//import "script/slot_3shop.z"





//=============================================================================================
//======================================= *FFC Scripts* =======================================
//=============================================================================================

// 1.- Signpost Script by Joe123

//FUNCTIONALITY: Attach this script to an FFC and edit its Arguments to your needs.

ffc script Signpost{
    void run(int m,int input){
        int loc = ComboAt(this->X,this->Y);
        while(true){
            while(!AgainstComboBase(loc) || !SelectPressInput(input)) Waitframe();
            SetInput(input,false);
            Screen->Message(m);
            Waitframe();
        }
    }
    bool AgainstComboBase(int loc){
        return Link->Z == 0 && (Link->Dir == DIR_UP && Link->Y == ComboY(loc)+8 && Abs(Link->X-ComboX(loc)) < 8);
    }
}

//!!These functions should only be included in your script file once!!
bool SelectPressInput(int input){
    if(input == 0) return Link->PressA;
    else if(input == 1) return Link->PressB;
    else if(input == 2) return Link->PressL;
    else if(input == 3) return Link->PressR;
}
void SetInput(int input, bool state){
    if(input == 0) Link->InputA = state;
    else if(input == 1) Link->InputB = state;
    else if(input == 2) Link->InputL = state;
    else if(input == 3) Link->InputR = state;
}

//----------------------------------------------------------------------------------
//2.- Advanced Grass by Raiu

//FUNCTIONALITY: Attach this script to an FFC and edit the Arguments to your needs.
//               (The suggested arguments are fine by default with DoR Hybrid).

// AdvGrass.z
// A script that correctly displays tall grass combos relationally
// (Searches layer 0 for tall grass combos, and draws new combos over them
// Good for grass combos that have a "border" of sorts around them)
// By Raiu
//
// Arrange tiles like this:
// Lone, DownVertEnd, UpVertEnd, Vertical, RightHorzEnd, DownRight, UpRight, Right, LeftHorzEnd, DownLeft, UpLeft, Left, Horizonal, Down, Up, Middle
// (this script does not support inside corner graphics...)
//
// D0 = Combo Type
//		Tallgrass = 57
//		Tallgrass continuous = 136
//		Tallgrass -> next = 141
// D1 = First Tile of the above (DoR Hybrid Default: 13144)
// D2 = Cset to use (DoR Hybrid Default: 3)
// D3 = Layer to Draw on: 0

ffc script AdvGrass{
	void run(int inType, int inTile, int inCset, int inLayer){
		Waitframe();
		int adj=0;
		while(true){
			for(int x = 0; x<16; x++){
				for(int y = 0; y<11; y++){
					if(Screen->ComboT[CIndex(x,y)]==inType){
						if(Screen->ComboT[CIndex(x,y-1)]==inType) adj+=1;
						if(Screen->ComboT[CIndex(x,y+1)]==inType) adj+=2;
						if(Screen->ComboT[CIndex(x-1,y)]==inType) adj+=4;
						if(Screen->ComboT[CIndex(x+1,y)]==inType) adj+=8;
						if(adj!=15){
							Screen->DrawTile(inLayer, x*16, y*16, inTile+adj, 1, 1, inCset, -1,-1, 0, 0, 0, 0, 1, 128);
						}
					adj=0;
					}
				}	
			}
			Waitframe();
		}
	}
	int CIndex(int x, int y){
		if(x<0||x>15||y<0||y>10) return -1;
		return y*16 + x;
	}
}

// This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
//----------------------------------------------------------------------------------





//==============================================================================================
//======================================= *Item Scripts* =======================================
//==============================================================================================

// 1.- Item Pickup Sting by Joe123

//FUNCTIONALITY: Attach this script to the Action slot of an Item within the Scripts Tab.
//               D0 is the string to display for a certain item. 

item script Message{
	void run(int m){
		Screen->Message(m);
	}
}

//----------------------------------------------------------------------------------
// 2.- Heart Piece Message by Moscowmodder

//FUNCTIONALITY: Attach this to the Pickup script slot of an item within its Scripts Tab.
//               Set the arguments to your needs.

//Old version: supports only 4-piece heart containers
//Messages can be set automatically or manually
//D0 = First message
//D1-3 = Second-fourth messages; default to strings after D0

item script heartPieceMessageOld{
	void run (int m1, int m2, int m3, int m4){
		//Set m2-4 to follow m1 if not set explicitly
		if ( m2 == 0 ) m2 = m1+1;
		if ( m3 == 0 ) m3 = m1+2;
		if ( m4 == 0 ) m4 = m1+3;
		
		//Play the appropriate message
		if ( Game->Generic[GEN_HEARTPIECES] == 0 )
			Screen->Message(m1);
		if ( Game->Generic[GEN_HEARTPIECES] == 1 )
			Screen->Message(m2);
		if ( Game->Generic[GEN_HEARTPIECES] == 2 )
			Screen->Message(m3);
		if ( Game->Generic[GEN_HEARTPIECES] == 3 )
			Screen->Message(m4);
	}
}

//FUNCTIONALITY: Attach this to the Pickup script slot of an item within its Scripts Tab.
//               Set the arguments to your needs.

//New version: supports any number of heart containers
//D0 = String # of first message
//All other messages *MUST* follow the first

item script heartPieceMessage{
	void run ( int message ){
		Screen->Message ( message + Game->Generic[GEN_HEARTPIECES] );
	}
}

//-----------------------------------------------------------------------------
// 3.- Item Bundle Script by Nick

//FUNCTIONALITY: Attach this to the Pickup script slot of an item within its Scripts Tab.
//               Set the arguments to your needs.

// This script is a pickup script that will give some items.
// This was mostly made to bundle the Bow and Arrows into one item,
// but it could have other uses.
// Bundle this with an item that increases a counter to also increase counters.
// 	   D0-D7: Items to give.
//		D0: If D0 is negative, it will display an item pickup message containing the positive version of the number entered...
item script itemBundle{
	void run(int item1, int item2, int item3, int item4, int item5, int item6, int item7, int item8)
	{
		if(item1 > 0)
			Link->Item[item1] = true;
		if(item2 > 0)
			Link->Item[item2] = true;
		if(item3 > 0)
			Link->Item[item3] = true;
		if(item4 > 0)
			Link->Item[item4] = true;
		if(item5 > 0)
			Link->Item[item5] = true;
		if(item6 > 0)
			Link->Item[item6] = true;
		if(item7 > 0)
			Link->Item[item7] = true;
		if(item8 > 0)
			Link->Item[item8] = true;
			
		// Display Item pickup message?
		if(item1 < 0)
		{
			Screen->Message(item1 * -1);
		}
	}//!End void run()
}//!End item script itemBundle
//----------------------------------------------------------------------------

const int CR_SWORDPART = 10; //The 'Script / Custom 4' counter.
int I_HUNDRED_PIECE_SWORD = 123; //Custom item 1
 
const int HUNDRED_PIECE_SWORD_BASE_POWER = 1; //The minimum damage of the sword, before it is upgraded.
 
//A pick-up/collect script. Attach to a sword piece item.
//If you want ZC to display a screen string when the player picks it up, assign the ZQuest String ID
//to the D0 arg.
//If you want a special message when the player collects ten pieces, assign that ZQuest
//string to the D1 arg.
//If you want this to play a special sound if the player picks up ten pieces, assign that Sound Effect
//ID to the D2 arg.
//!Dimentio Edit: Fixed decimal values being passed to sword->Power,
//!Fixed bug where having 10-19 sword pieces is the same as having 0-9.
item script swordpart
{
    void run(int msg_id, int special_msg_id, int special_sfx)
    {
        ++Game->Counter[CR_SWORDPART];
        itemdata sword = Game->LoadItemData(I_HUNDRED_PIECE_SWORD);
        sword->Power = Max((Floor(Game->Counter[CR_SWORDPART] / 10) + 1), HUNDRED_PIECE_SWORD_BASE_POWER);
        
        
        if ( Game->Counter[CR_SWORDPART] % 10 || special_msg_id < 1 )
        {
            Screen->Message(msg_id);
        }
        else
        {
            Screen->Message(special_msg_id);
            if ( Game->Counter[CR_SWORDPART] % 10 == 0 && special_sfx )
            {
                Game->PlaySound(special_sfx);
		++I_HUNDRED_PIECE_SWORD;
		Link->Item[I_HUNDRED_PIECE_SWORD] = true;
            }
        }
        
    }
}
 
//Assign this to global slot 4 ('onContinue')
//This re-applies the power modifications to the sword, every time that the player returns to
//the game, after exiting.
//!Dimentio Edit: Fixed decimal values being passed to sword->Power,
//!Fixed bug where having 10-19 sword pieces is the same as having 0-9.
global script OnContinue
{
    void run()
    {
        itemdata sword = Game->LoadItemData(I_HUNDRED_PIECE_SWORD);
        sword->Power = Max((Floor(Game->Counter[CR_SWORDPART] / 10) + 1), HUNDRED_PIECE_SWORD_BASE_POWER);
    }
}
    
//!Dimentio Edit: This entire ffc script + comments. Sorry Zoria, I don't think your method was the most efficient.
//D0: Number of pieces you need to own to trigger
//D1: Flag to trigger
//The way this works is that it changes all combos with flag D1 to the wooden sword trigger flag.
//Leaving things to the engine is generally a safe way to do thing.
//This also means you only need one script of this running.

const int HUNDRED_PIECE_SWORD_FLAG = 102; //Script 5

ffc script sword_power_triggers
{
    void run(int power, int flag)
    {
        if ( flag < 1 ) flag = HUNDRED_PIECE_SWORD_FLAG;
	{
       			while(true)
        		{
	    			if (Game->Counter[CR_SWORDPART] >= power)
	    			{
					for (int i = 0; i < 176; i++)
                			{
                    				if (Screen->ComboF[i] == flag)
                    				{
                        				Screen->ComboF[i] = CF_SWORD1;
                    					}
                    				if (Screen->ComboI[i] == flag)
                    				{
                        Screen->ComboI[i] = CF_SWORD1;
                    }
                }
            }
            Waitframe();
        }
    }
}
}  

I imported all the files into the zc folder with everything else.

Here's the error I'm getting:

Pass 1: Parsing
Pass 2: Preprocessing
std_functions.zh, line 1190: Error P35: There is already a constant with name AT_RANDANGULAR defined.
std_functions.zh, line 1189: Error P35: There is already a constant with name AT_RAND8DIR defined.
std_functions.zh, line 1188: Error P35: There is already a constant with name AT_RAND4DIR defined.
std_functions.zh, line 1187: Error P35: There is already a constant with name AT_ANGULAR defined.
std_functions.zh, line 1186: Error P35: There is already a constant with name AT_8DIR defined.
std_functions.zh, line 1185: Error P35: There is already a constant with name AT_4DIR defined.
std_functions.zh, line 1184: Error P35: There is already a constant with name AT_NONE defined.

I'm using 2.50.2 btw

Hm those compiler error has nothing to do with the shopscript you have something else that causes that....



#12 Smiles the Death Bringer

Smiles the Death Bringer

    The smiling demon!

  • Members
  • Real Name:William
  • Location:Dream Land

Posted 06 February 2018 - 02:00 PM

So I tested the uber shop by itself and it works, I tested my script without all the uber shop headers and it works.

 

Now, the only problem is figuring out where the conflict is.


Edited by Smiles the Death Bringer, 06 February 2018 - 02:03 PM.


#13 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 11 February 2018 - 01:31 PM

So I tested the uber shop by itself and it works, I tested my script without all the uber shop headers and it works.

 

Now, the only problem is figuring out where the conflict is.

 

What headers are you using?



#14 Smiles the Death Bringer

Smiles the Death Bringer

    The smiling demon!

  • Members
  • Real Name:William
  • Location:Dream Land

Posted 11 February 2018 - 02:30 PM

import "std.zh"
																												import "std.zh"
import "ffcscript.zh"
import "string.zh"
import "stdExtra.zh"
import "ghost.zh"
import "Laser.zh"
import "styles.zh"
import "Tango.zh"

import "JudasRising_Shop_v0.7.3.z"


#15 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 12 February 2018 - 01:49 AM

import "std.zh"
																												import "std.zh"
import "ffcscript.zh"
import "string.zh"
import "stdExtra.zh"
import "ghost.zh"
import "Laser.zh"
import "styles.zh"
import "Tango.zh"

import "JudasRising_Shop_v0.7.3.z"

I need you to be much more specific on what 'conflicts' you have encountered, and on precisely what breaks. I don't see anything there, that would cause a problem. If you didn't merge the global active script functions though, then it wouldn't work.

Post your active script.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users