Scripts / Collect 10 specific items to win - script

Author
Message
Duchenkuke
GameGuru VBOTB Developer
8
Years of Service
User Offline
Joined: 7th Jun 2016
Location: Germany
Posted: 19th Feb 2017 13:15
I need a script where the player needs to collect 10 items to win the game.
Can somebody please write this for me?
That would be very cool

Kind Regards
Windows 10 64bit - Intel Core i7-2600 CPU @ 3.40GHz, 8,0 GB Ram, AMD Radeon R9 270X

Youtube:
The German Music Dude: https://www.youtube.com/user/DeutscherVolker
DK Productions: https://www.youtube.com/channel/UCIqwvScXnJL_zNYqSsfTCqA
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 19th Feb 2017 13:24 Edited at: 19th Feb 2017 13:25
Here is one I had a while back, it's useful.



Just make sure all 10 objects have the same name, ie: collectme and that the objects are not static. doorkey is the variable that adds up the 10 objects. Just use another script to check this variable.
Aftershock Quad Core AMD FM2+ 3.5 GHz 8GB Motherboard and Processor, A7700k apu, Asus GT970 STRIX 4gb Nvidia gfx card.
King Korg Synth, Alesis SR18 Drum Machine, Akai MPX8 sample player, Roland Fantom XA Synth, Axus Digital AXK2 Digital Drum Kit, Novation Ultranova Synth, Waldorf Blofeld Synth.
Duchenkuke
GameGuru VBOTB Developer
8
Years of Service
User Offline
Joined: 7th Jun 2016
Location: Germany
Posted: 19th Feb 2017 13:31
Thank you very much !!

Will try right away!
Windows 10 64bit - Intel Core i7-2600 CPU @ 3.40GHz, 8,0 GB Ram, AMD Radeon R9 270X

Youtube:
The German Music Dude: https://www.youtube.com/user/DeutscherVolker
DK Productions: https://www.youtube.com/channel/UCIqwvScXnJL_zNYqSsfTCqA
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 19th Feb 2017 13:34
hope it works ok for you, ive used it many many times
Aftershock Quad Core AMD FM2+ 3.5 GHz 8GB Motherboard and Processor, A7700k apu, Asus GT970 STRIX 4gb Nvidia gfx card.
King Korg Synth, Alesis SR18 Drum Machine, Akai MPX8 sample player, Roland Fantom XA Synth, Axus Digital AXK2 Digital Drum Kit, Novation Ultranova Synth, Waldorf Blofeld Synth.
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 19th Feb 2017 17:50
Moving this thread to the script board.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

Duchenkuke
GameGuru VBOTB Developer
8
Years of Service
User Offline
Joined: 7th Jun 2016
Location: Germany
Posted: 19th Feb 2017 18:05
Quote: "Just use another script to check this variable"


How can I do this?
Windows 10 64bit - Intel Core i7-2600 CPU @ 3.40GHz, 8,0 GB Ram, AMD Radeon R9 270X

Youtube:
The German Music Dude: https://www.youtube.com/user/DeutscherVolker
DK Productions: https://www.youtube.com/channel/UCIqwvScXnJL_zNYqSsfTCqA
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 19th Feb 2017 20:29 Edited at: 19th Feb 2017 20:33
@ Duchenkuke

Attach script below to each object you want collect to.




in action



hth

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
Duchenkuke
GameGuru VBOTB Developer
8
Years of Service
User Offline
Joined: 7th Jun 2016
Location: Germany
Posted: 20th Feb 2017 09:06
awesome. Thank you very much 3com
Windows 10 64bit - Intel Core i7-2600 CPU @ 3.40GHz, 8,0 GB Ram, AMD Radeon R9 270X

Youtube:
The German Music Dude: https://www.youtube.com/user/DeutscherVolker
DK Productions: https://www.youtube.com/channel/UCIqwvScXnJL_zNYqSsfTCqA
Duchenkuke
GameGuru VBOTB Developer
8
Years of Service
User Offline
Joined: 7th Jun 2016
Location: Germany
Posted: 21st Feb 2017 10:11
Works perfectly!

I thougth about a another possibility:

How about collect 10 items and escape?

The player needs to collect 10 items. After that, a door opens.

Is that possible? So, that it works like a key maybe?
Windows 10 64bit - Intel Core i7-2600 CPU @ 3.40GHz, 8,0 GB Ram, AMD Radeon R9 270X

Youtube:
The German Music Dude: https://www.youtube.com/user/DeutscherVolker
DK Productions: https://www.youtube.com/channel/UCIqwvScXnJL_zNYqSsfTCqA
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 21st Feb 2017 15:26
Quote: "Is that possible? So, that it works like a key maybe?"


YES, Just has to change this part:



Instead of "FinishLevel() " out your door animations.


and instead of attach the script to a barrel like I did, attach the script to your door.

Take at look for the stock doors LUA scripts, see how it does, and do the same. (door.lua) works with key, and key can to be items collected qty.

Try and improve and try, and improve and try again, learn is the key than can open many doors.

Do some copy of the script and try new ways, if you are stuck so post here your script and anyone here can help you, even me.

3com


Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 3rd Nov 2017 12:53
unlocked by request
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
Duchenkuke
GameGuru VBOTB Developer
8
Years of Service
User Offline
Joined: 7th Jun 2016
Location: Germany
Posted: 3rd Nov 2017 14:48
Thanks synchromesh!

I wanted to get back to this thread because for my project, I want a similar script that does this:

The Player needs to collect 10 items. After that, the "winzone" spawns, and the character can leave the area.
Is that possible? Can a winzone get spawned?

Any help would be much appreciated !


You know you watched too many of Lee's Live Brodcasts when you're at work and have an earwig from his twitch intro music....

By the way, I am a Modder, Soundtrack Composer and now Game Developer. Well, sort of.

Windows 10 64bit - Intel Core i7-2600 CPU @ 3.40GHz, 8,0 GB Ram, Geforce GTX 1050ti
Find some my work onYoutube:
(Music Channel) The German Music Dude: https://www.youtube.com/user/DeutscherVolker
(Games and Mods Channel ) DK Productions: https://www.youtube.com/channel/UCIqwvScXnJL_zNYqSsfTCqA



Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 3rd Nov 2017 15:57
Not sure if it can be spawned but why not just set a variable, such as g_w_zone_active and add it to a script so that if the player enters winzone and that variable = 1 he can win, but if still at 0 he cannot leave.

if g_w_zone_active == 1 then
--- the finish level lua here ---
end

You need to add that variable to the collect 10 script, just set it as 0 in the INIT part of the script.

Aftershock Quad Core AMD FM2+ 3.5 GHz 8GB Motherboard and Processor, A7700k apu, Asus GT970 STRIX 4gb Nvidia gfx card.
King Korg Synth, Alesis SR18 Drum Machine, Akai MPX8 sample player, Roland Fantom XA Synth, Axus Digital AXK2 Digital Drum Kit, Novation Ultranova Synth, Waldorf Blofeld Synth, Bluedio Vicotry V Headphones, AKG K141 Studio Headphones, Lenovo Ideapad, with Windows 10 64bit, 8Gb Ram and AMD A10 7th Gen Graphics.
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 3rd Nov 2017 16:50 Edited at: 3rd Nov 2017 16:51
Zones cannot be spawned, as you cannot change the spawn at start option.

However you can make a custom winzone script that uses a variable around the winzone script, so that it only uses the winzone part of the script when the variable is toggled.

So basically:

if g_winobjects = 10 then

... winzone script

end

then each of the objects you collect will have g_winobjects = g_winobjects+1 when you collect them

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
Duchenkuke
GameGuru VBOTB Developer
8
Years of Service
User Offline
Joined: 7th Jun 2016
Location: Germany
Posted: 3rd Nov 2017 16:55
okay that should work, yes. Thank you !
You know you watched too many of Lee's Live Brodcasts when you're at work and have an earwig from his twitch intro music....

By the way, I am a Modder, Soundtrack Composer and now Game Developer. Well, sort of.

Windows 10 64bit - Intel Core i7-2600 CPU @ 3.40GHz, 8,0 GB Ram, Geforce GTX 1050ti
Find some my work onYoutube:
(Music Channel) The German Music Dude: https://www.youtube.com/user/DeutscherVolker
(Games and Mods Channel ) DK Productions: https://www.youtube.com/channel/UCIqwvScXnJL_zNYqSsfTCqA



Login to post a reply

Server time is: 2024-12-23 00:29:56
Your offset time is: 2024-12-23 00:29:56