1 registered members (tomaslolo),
1,542
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Have player pick up coins??
#350549
12/16/10 22:24
12/16/10 22:24
|
Joined: Sep 2010
Posts: 42 NS, Canada
gSet
OP
Newbie
|
OP
Newbie
Joined: Sep 2010
Posts: 42
NS, Canada
|
I know this seems like an absolutely trivial issue, but no matter how much reading I do in the manual or on the boards, or how many different things I try, I can't seem to make this work. All I want to do is make the player able to pick up a coin, such that when the player touches a coin an event is called. I've tried having the coins c_scan for the player, as well as the other way around. I've tried having the coin c_rotate with ENABLE_IMPACT so that the event is called, but the event is called as soon as the coins are created. What could I do to make this work? It should be so simple! If someone can show me what code to use, there won't be any room for stupid mistakes on my part
"If it's true what you say to me, that the whole world will mourn his death - If the whole world will weep, I will give him back his breath."
|
|
|
Re: Have player pick up coins??
[Re: gSet]
#350551
12/16/10 22:40
12/16/10 22:40
|
Joined: Jul 2009
Posts: 1,198 Berlin, Germany
Liamissimo
Serious User
|
Serious User
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
|
action coin()
{
while(me)
{
c_scan(my.x,my.pan,vector(360,360,75),IGNORE_ME);
if(you == player)
{
coins += 1;
ent_remove(me);
}
wait(1);
}
}
Just take this as action an add it to the coin, coins is the variable vor the coins that the player have, c_scan scans for the player, type in the script of your player For further questions ask
"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen." -JCL, 2011
|
|
|
Re: Have player pick up coins??
[Re: Liamissimo]
#350588
12/17/10 11:22
12/17/10 11:22
|
Joined: Jul 2008
Posts: 1,178 England
MrGuest
Serious User
|
Serious User
Joined: Jul 2008
Posts: 1,178
England
|
action coin()
{
while(me)
{
c_scan(my.x,my.pan,vector(360,360,75),IGNORE_ME);
if(you == player)
{
coins += 1;
ent_remove(me);
}
wait(1);
}
}
Just take this as action an add it to the coin, coins is the variable vor the coins that the player have, c_scan scans for the player, type in the script of your player For further questions ask I wouldn't use c_scan for each coin, it'd be better on FPS using vec_dist(my.x, player.x) and also in the action have a while(!player){wait(1);} otherwise you'll be having a few errors along the way
|
|
|
Re: Have player pick up coins??
[Re: Liamissimo]
#350934
12/20/10 14:29
12/20/10 14:29
|
Joined: Sep 2010
Posts: 42 NS, Canada
gSet
OP
Newbie
|
OP
Newbie
Joined: Sep 2010
Posts: 42
NS, Canada
|
Thanks a bunch! It seems so similar to what I'd been doing that I'm not sure what wasn't working, but with a couple of slight modifications this does exactly what I needed it to. The way it's set up, when you grab a coin your pos and the pos of all the coins are randomized (I know it sounds like a crappy game... It's for research lol), and so I had to remove all the coins, randomize the position array, and the player pos, and replace them all. I didn't realize that c_scan modified you, so that's actually extremely useful - I'd been using emask.
"If it's true what you say to me, that the whole world will mourn his death - If the whole world will weep, I will give him back his breath."
|
|
|
|