Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,089 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Can't we use skills with "you" / "your" ? #423218
05/25/13 16:17
05/25/13 16:17
Joined: Oct 2009
Posts: 90
WickWoody Offline OP
Junior Member
WickWoody  Offline OP
Junior Member

Joined: Oct 2009
Posts: 90
I'm working with events. For understanding the entity which triggers an event, I'm using skills. Like that;

Code:
#define WHO_AM_I my.skill1
#define WHO_ARE_YOU your.skill1

#define I_AM_PLAYER 0
#define I_AM_NPC 1



But when I tried to use them the event function is crashing.

Re: Can't we use skills with "you" / "your" ? [Re: WickWoody] #423220
05/25/13 16:40
05/25/13 16:40
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
How do you use them? Have you checked you is non-null before using the macros?


Always learn from history, to be sure you make the same mistakes again...
Re: Can't we use skills with "you" / "your" ? [Re: Uhrwerk] #423222
05/25/13 16:48
05/25/13 16:48
Joined: Oct 2009
Posts: 90
WickWoody Offline OP
Junior Member
WickWoody  Offline OP
Junior Member

Joined: Oct 2009
Posts: 90
Here is my action;

Code:
#define T_BEN_NEYIM my.skill1
#define T_SEN_KIMSIN your.skill1

#define T_OYUNCU 0
#define T_BUTON 1
#define T_NPC 	2

function fOyuncu_dugmeye_basti()
{
	switch(event_type) // bana ne yaptilar?
	{
		case EVENT_SCAN: // beni taradilar
			if(T_SEN_KIMSIN == T_OYUNCU)
                        {
                             beep();
                        }
		break;
	}
}

action buton_makinesi()
{
	wait(1);
	c_setminmax(me);
	my.max_z -= 10;
	my.z = my.z - 10;
	
	T_BEN_NEYIM = T_BUTON;
	
	my.emask |= ENABLE_SCAN;
	my.event = fOyuncu_dugmeye_basti;
}


Re: Can't we use skills with "you" / "your" ? [Re: WickWoody] #423223
05/25/13 16:56
05/25/13 16:56
Joined: Oct 2009
Posts: 90
WickWoody Offline OP
Junior Member
WickWoody  Offline OP
Junior Member

Joined: Oct 2009
Posts: 90
Oh, the skill 1 is using already .. Thank you anyway.

Re: Can't we use skills with "you" / "your" ? [Re: WickWoody] #423226
05/25/13 18:55
05/25/13 18:55
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
You're doing this a bit unusual by the way. The following form is more common:
Code:
#define enemy skill1
[...]
my->enenmy = you;



Always learn from history, to be sure you make the same mistakes again...
Re: Can't we use skills with "you" / "your" ? [Re: Uhrwerk] #423229
05/25/13 21:00
05/25/13 21:00

M
Malice
Unregistered
Malice
Unregistered
M



Yeah if you could set it to "you" or "my" at that point in the script you'd have no idea what ent "you" or "my" refer to. Presumably they hold the pointer from their last use. Now not sure about this statement.

And you can #define skill1 - a bunch if different things
Code:
#define TREE skill[0] 
 #define BUSH skill[0]  
#define FUR 333
#define PINE 666

void fun()
{
 my.TREE=FUR // my.skill1 = 333
my.BUSH = FUR // my.skill1 = 333


Last edited by Malice; 05/25/13 21:08.
Re: Can't we use skills with "you" / "your" ? [Re: ] #423234
05/25/13 22:10
05/25/13 22:10
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
That's a pretty bad thing you shouldn't be doing and exactly the part that caused WickyWoody the trouble.


Always learn from history, to be sure you make the same mistakes again...
Re: Can't we use skills with "you" / "your" ? [Re: Uhrwerk] #423238
05/25/13 23:06
05/25/13 23:06

M
Malice
Unregistered
Malice
Unregistered
M



Quote:
That's a pretty bad thing you shouldn't be doing and exactly the part that caused WickyWoody the trouble.


Are you referring to using more then one #define for skill? If so I agree that it is poor design but I often have a set for entity mega-types (player[s], monsters, world objects) because all can use the same skill number for globe things like HEALTH but then you get mega-type unique ones and you only have 100(?) skills. No reason that the monster mega-type can't use skill21 for PEOPLE_EATEN just because I used it already in the player mega-type as SPELL_FAILED.

In the dics. of the action for each ent it helps to list all #define (globe and unique) used by the ent in comments also grouping the in the header file helps you from confusing or misusing them,

Last edited by Malice; 05/25/13 23:09.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1