|
Re: do not pick up when ammo is full?
[Re: fp]
#154191
09/14/07 22:16
09/14/07 22:16
|
Joined: Aug 2006
Posts: 152 vector(200,45,338)
Marwan
Member
|
Member
Joined: Aug 2006
Posts: 152
vector(200,45,338)
|
\\I have changed it mostly only to make it easier, I did not try it , but it could work \\replace it with the old one var maximum_ammo=180; var myammo; action ammo_pack {
my.passable = on; while (player == null) {wait (1);}
while(1) { my.pan+=3*time_step; current_ammoreserve=myammo; if(current_ammoreserve>maximum_ammo) {current_ammoreserve-=(myammo -maximum_ammo;}
if (vec_dist(player.x,my.x)<50 && current_ammoreserve<180) { snd_play (gotammo_wav, 80, 0); ent_remove (my); current_ammoreserve += 18; } wait(1); } }
Last edited by Marwan; 09/14/07 22:41.
|
|
|
Re: do not pick up when ammo is full?
[Re: fp]
#154193
09/15/07 08:41
09/15/07 08:41
|
Joined: Jul 2007
Posts: 959 nl
flits
User
|
User
Joined: Jul 2007
Posts: 959
nl
|
do you have a player ?
action player { player = me;
"empty"
|
|
|
Re: do not pick up when ammo is full?
[Re: fp]
#154195
09/15/07 10:31
09/15/07 10:31
|
Joined: Aug 2006
Posts: 152 vector(200,45,338)
Marwan
Member
|
Member
Joined: Aug 2006
Posts: 152
vector(200,45,338)
|
Okay ,1- go to the player script file and do this entity* player1;//I changed it from (player) to (player1) 2-go inside the player action and change (player=me;)to (player1=me;) 3-go to the ammo pack action and change ( vec_dist(player.x,my.x)) to (vec_dist(player1.x,my.x)) //that should do it
age:16
game design and
programming
experience:2 years
|
|
|
Re: do not pick up when ammo is full?
[Re: Marwan]
#154196
09/15/07 13:32
09/15/07 13:32
|
Joined: Jul 2007
Posts: 959 nl
flits
User
|
User
Joined: Jul 2007
Posts: 959
nl
|
{current_ammoreserve-=(myammo -maximum_ammo);}
Last edited by flits; 09/15/07 13:36.
"empty"
|
|
|
Re: do not pick up when ammo is full?
[Re: Marwan]
#154198
09/15/07 13:42
09/15/07 13:42
|
Joined: Jul 2007
Posts: 959 nl
flits
User
|
User
Joined: Jul 2007
Posts: 959
nl
|
srry i dont get thate ubb coding yet so i need to idet it like 20 times lol
"empty"
|
|
|
Re: do not pick up when ammo is full?
[Re: fp]
#154199
09/15/07 14:26
09/15/07 14:26
|
Joined: Nov 2002
Posts: 792 Berne, Switzerland
elsewood
User
|
User
Joined: Nov 2002
Posts: 792
Berne, Switzerland
|
Why not just changing in your original Code:
while (vec_dist (player.x, my.x) > 50)
with Code:
while (vec_dist (player.x, my.x) > 50 || current_ammoreserve >= 180)
??
Last edited by elsewood; 09/15/07 14:29.
A bus station is where the bus stops. A train station is where the train stops. On my desk I have a workstation...
|
|
|
|