Scripts / Score doesn't add up, whenever i kill an AI that is Moving

Author
Message
js
9
Years of Service
User Offline
Joined: 24th Sep 2015
Location:
Posted: 4th Oct 2015 14:22
May i please know what's wrong with my code?, i tried setting up the game wherein whenever i killed the rabbit or the hedgehog (their HP is <= 0) the game would give me a score, but it doesn't work..



PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 4th Oct 2015 17:37
add you code inside the exit(e) part, it's purpose is to handle stuff like that

life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
js
9
Years of Service
User Offline
Joined: 24th Sep 2015
Location:
Posted: 4th Oct 2015 17:49
it didn't work >.> ,,, how come ?
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 4th Oct 2015 17:53
ah i didnt see but you actually named your exit part something else,
it should be the same as the main(e) script
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
js
9
Years of Service
User Offline
Joined: 24th Sep 2015
Location:
Posted: 4th Oct 2015 17:56
yea i forgot >_< sorry ,, thanks! again!, bytw how can i end the game ? is there a script or way to show the ending of the game ? and also , why is it that the ai_solder , are stuck in moving after i have added a waypoint to them , the ai_soldier just keep on walking but they don' get anywhere aside from their starting point, the walking animation is there but it doesn't walking throughout it's waypoint, it only stays at the start of it's waypoint showing a walking animation >.> .. why is that? .. my isimmobile setting is set to No >.>
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 4th Oct 2015 18:12
they pretty much only walk on the terrain, if you're using objects as a floor (or buildings with a floor) they need to be very thin and at terrain height and also have
Quote: "forcesimpleobstacle = 3"
in the fpe file

can you define what you mean by show ending of the game? you can add a winzone to trigger the end but basically all you need is the command
Quote: "JumpToLevelIfUsed(e)"
to actually trigger the end though (remember they only work in standalone)
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
js
9
Years of Service
User Offline
Joined: 24th Sep 2015
Location:
Posted: 4th Oct 2015 18:17
i see now, thank you very much!!, everything works now! , ... now the only problem is a database to save the score in which i think there isn't a database for game guru to save the score of the game and check it after the game has ended
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 4th Oct 2015 18:30 Edited at: 4th Oct 2015 18:43
you can use lua to read and write to a text file so you can save local scores easily enough, i suggest taking a look at moshroom's save and load script
https://forum.game-guru.com/thread/213084

saving stuff


loading stuff


for saving online it'll take more work


edit; it looks kinda complicated but its pretty simple as long as you store and read everything in the same order.

just to save your score will look more like this




and then just prompt the highscore somewhere

note, not tested so sorry if there's any errors but that's the general code
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 4th Oct 2015 18:34 Edited at: 4th Oct 2015 18:37
You can save a text file for a highscore in lua and use an array for a highscore table. Not that I've messed about with that type of mechanic in GG. Pretty sure someone has released a script that saves your stats. Same idea. I did something similar awhile back, but when I found most stats were unusable when loading back in, did not continue. A single high score would be fairly simple though, just save the score as a text file and load it as the highscore.

Edit I was beat to the punch lol. That would be the example I mentioned


SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.

Login to post a reply

Server time is: 2024-12-22 06:50:55
Your offset time is: 2024-12-22 06:50:55