Scripts / i need help with "collecting items" script

Author
Message
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 16th Feb 2016 21:07
hi there! i have an urgent problem. i need a script to complete my game.
i have a script that is for the "collected object" and now it is from the "blow up the ant eggs" script. i does the following:

i get near the object and a text appears (press e to activate)
when i press e the killcount is +1 and the object explodes.



i would like to change it, i want the player to collect the item it must disappear but it shall NOT explode. i found out that disappearing is "destroy(e)" but i can't take away the explodion. the killcount will go +1 up that is good, this must stay. i want the player to collect 6 engine parts f.e. and when he has 6 he is allowed to pass a door. this all works but the items explode and kill the player.

can you help me with this script?

thanks!
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 16th Feb 2016 21:11
remove SetEntityHealth(e,0)
or change the explodeable = yes to no in the properties
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 16th Feb 2016 21:51
i removed the line but it doesn't work. the item does not disappear and the counter seems to be wrong
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 16th Feb 2016 22:02
okay i will try another one, it doesn't work at all.

@smallg: this is a script that you wrote. it's the "disarm the bomb" script. i would like to remove the ticking counter and insert that the item disappers. i tried "destroy(e)" but i did it wrong and it caused an error.

http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 16th Feb 2016 22:06
ok so replace it with something to hide the object

life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 16th Feb 2016 22:24
yes! this is working now! thank you very much! i will update the script and put it in here for all of you here!
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 16th Feb 2016 22:30


i did some little changes i set the timer to 0 because i don't need it anymore. how can i remove the timer without causing errors? when i delete the timer i get an error while loading. i'm trying to change the display of the text.
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 16th Feb 2016 22:54
okay, here it is!
mission: you are only allowed to go through the door (missiondoor.lua) when you have collected 6 engine parts (collectable.lua). you also need a starter (collstarter.lua)
i just tried it and it works. the number of collectables and what you have to collect can all be changed to match your needs. have fun with it @ all
if you have questions i can help you make it work

thanks to smallg now it works! some of this is also based on a script by wizard of id

http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-12-22 13:33:36
Your offset time is: 2024-12-22 13:33:36