Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
4 registered members (AndrewAMD, Quad, soulman3, Ayumi), 675 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
why my healt no work in next level? #222571
08/19/08 23:28
08/19/08 23:28
Joined: Aug 2008
Posts: 7
C
chetumal Offline OP
Newbie
chetumal  Offline OP
Newbie
C

Joined: Aug 2008
Posts: 7
hi
i have this problem:
i have 2 level (for now) and i use 3 script:
one script for next level with 5 box, one for take health with objects and one for damage with objects
i have set var _health = 100; so i go in level2 (with function next level) with 160 of healt, i take damage for -60 i have 100 of health but when i take other -60 of damage my player dies...i dont know why this when i have 40 of healt yet...
someone know the answer?
thx and sorry for my poor english blush
i have A6 comm and i use old script template

Re: why my healt no work in next level? [Re: chetumal] #222575
08/19/08 23:47
08/19/08 23:47
Joined: Aug 2008
Posts: 7
C
chetumal Offline OP
Newbie
chetumal  Offline OP
Newbie
C

Joined: Aug 2008
Posts: 7
maybe i have found the problem:
action prendi_danno_fx
{
while (player == null) {wait (1);}
my.passable = on;
entity_rotate2();
while (vec_dist (player.x, my.x) > 30) {wait (1);}
my.invisible = on;
play_sound danneggio,60;
_HEALTH -= 60;
//player._HEALTH -= 60;

FXa();
remove(me);
}
the red line i think is the problem, i have cancelled this and i dont have the death of the player...because the script add the -60 and -60 damage?

Re: why my healt no work in next level? [Re: chetumal] #222576
08/19/08 23:47
08/19/08 23:47
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
if you're using level_load it clears all entity data, you need to store all of it and then reapply it
var model_a_skills[100];
model_a_skills[0] = my.skill1;
model_a_skills[1] = my.skill2;
...
model_a_skills[99] = my.skill100;

you can use vec_set to store these in 3's

the game will also only run with 1 level script, if you have a script on another level you're loading this is ignored, only the game script is called

place the new script functions into your (1st level)game script and then call the function after loading the level

level_load(...);
wait(2);
do_my_funky_function();

also see level_load in the manual

Hope this helps smile

Re: why my healt no work in next level? [Re: MrGuest] #222578
08/19/08 23:59
08/19/08 23:59
Joined: Aug 2008
Posts: 7
C
chetumal Offline OP
Newbie
chetumal  Offline OP
Newbie
C

Joined: Aug 2008
Posts: 7
thx MrGuest...i'm not a programmer and your script is difficult for me smile
i know that my scripts are very bad, because i use and change the scripts that the very scripters publish on line...and I am grateful of this.
thx very much

Re: why my healt no work in next level? [Re: chetumal] #222580
08/20/08 00:13
08/20/08 00:13
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
post your current scripts, say what levels the're attached to, and we'll go from there laugh


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