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,643 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
2 questions #96292
10/27/06 23:26
10/27/06 23:26
Joined: May 2005
Posts: 222
T
tek Offline OP
Member
tek  Offline OP
Member
T

Joined: May 2005
Posts: 222
I want to create in my game a model that when I touch it disappear you need to find 5 of these items to go to the next level how would I program this ?
I know how to make the object disappear what I want is that I have a 5 written on top near the score and every time I touch one of the 5 models in the level it disappears then on top it says 4 instead of 5 then 3,2,1 and 0 and I go to the next level.
p.s. it has to be the same model not different models.

Also I don't know if anyone knows but I would like a code of touching an object and it gives me information for instance I touch something and it says the sky is blue, then if I touch it again it says the sky is green.
I know how to code an object that when you touch it it says something but not that if you touch it again it says something completely different.
any help would be appreciated.

Last edited by tek; 10/28/06 00:24.
Re: 2 questions [Re: tek] #96293
10/28/06 03:37
10/28/06 03:37
Joined: Oct 2006
Posts: 72
New York, USA
T
TFitty_Games Offline
Junior Member
TFitty_Games  Offline
Junior Member
T

Joined: Oct 2006
Posts: 72
New York, USA
wish i could help ya..:-) lol

Re: 2 questions [Re: TFitty_Games] #96294
10/28/06 07:17
10/28/06 07:17
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Ok about your first question:
What you need is a variable which represents the number of items you have to collect.
This var is shown by a panel (digits element) and if you touch one of these items the number is decreased, then you do a check if its == 0 and load the next level.
Code:

font arial_16b = "Arial",1,16;

var nro_items = 5; //you have to reset this var after level change

panel item_pan
{
pos_x = 20;
pos_y = 10;
layer = 5;
digits = 0,0,2,arial_16b,1,nro_items;
flags = visible;
}

//this functions checks the nro_items var
function check_nro_items()
{
if(!nro_items) //if nro_items == 0
{
//load your next level here
}
}

function item_events()
{
//if it was hit by an entity + it was the player
if((event_type == event_impact || event_type == event_entity) && you == player)
{
my.event = null; //do not react to events anymore
my.skill99 = 1; //set the "kill" skill99 to 1
}
}

action item_act
{
my.enable_impact = on; //make it sensible for hits
my.enable_entity = on;
my.event = item_events; //item_events is our event function

my.skill99 = 0; //set skill99 to 0
while(!my.skill99) { wait(1); } //wait until skill99 is != 0
my.invisible = on; //set to invisible
my.passable = on; //set to passable
wait(1); //wait a frame (just for safety)
nro_items -= 1; //decrease the item nr the player has to collect
check_nro_items(); //check if he is already done
ent_remove(me); //remove me
}



Ok now about your second problem:
I dunno which version of 3DGS you are using? latest A6 or A5?

Re: 2 questions [Re: Xarthor] #96295
10/28/06 17:39
10/28/06 17:39
Joined: May 2005
Posts: 222
T
tek Offline OP
Member
tek  Offline OP
Member
T

Joined: May 2005
Posts: 222
cool thanks Thunder it worked
I am using the latest A6 extra edition

Last edited by tek; 10/28/06 17:40.
Re: 2 questions [Re: tek] #96296
10/28/06 17:42
10/28/06 17:42
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Ok about your second question then:
- Do you want multiple entities having the same action but saying different things?
- How many different answers do you need for each entity?

Re: 2 questions [Re: Xarthor] #96297
10/28/06 18:09
10/28/06 18:09
Joined: May 2005
Posts: 222
T
tek Offline OP
Member
tek  Offline OP
Member
T

Joined: May 2005
Posts: 222
I would like one entity saying different things, its gonna be like an educational map that when I touch it it says a quote about geographics then in like 8 seconds it dissapears if I go to the map again it will say something different.
I would like maybe 6 different things for it to say.
I aint sure if it could be done I hope it could.

Re: 2 questions [Re: tek] #96298
10/28/06 22:18
10/28/06 22:18
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Yes but if you want more entities to say different things it would be a different approach.

So one entity is not much of a problem.
What we are basicly going to do is to use a string array and save thoses quotes into it.
Then if the entity was touched it chooses are random one and displays it.
However to improve this technique it might be necessary to save the already given quotes to make sure the guy does not always say the same.

I'll work on some example code later on if needed.

Re: 2 questions [Re: Xarthor] #96299
10/29/06 02:42
10/29/06 02:42
Joined: May 2005
Posts: 222
T
tek Offline OP
Member
tek  Offline OP
Member
T

Joined: May 2005
Posts: 222
thxs alot I really appreciate

Re: 2 questions [Re: tek] #96300
11/02/06 16:30
11/02/06 16:30
Joined: May 2005
Posts: 222
T
tek Offline OP
Member
tek  Offline OP
Member
T

Joined: May 2005
Posts: 222
bump


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