Scripts / Character selection option

Author
Message
gilmaxter
8
Years of Service
User Offline
Joined: 9th Feb 2016
Location:
Posted: 7th May 2016 04:10
I know this sounds silly to ask.

In my game i wanna make a zone where you are presented a option to switch between 3 characters I made.

I am not sure how you would switch characters in the LUA scripting. Or if it is even possible.

I am thinking like the read note script shown where it shows you the options as a picture.

and then maybe having a option shown with three options and where you select it the player is turned into the character and then warped.

Is something like this possible ?
PM
Jerry Tremble
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 5th Nov 2012
Location: Sonoran Desert
Posted: 9th May 2016 04:45
I assume you mean changing the player's character in third person? Not possible yet, but would be a nice feature! (Of course, somebody will come up with a script to do it, lol)
MAME Cab PC: i7 4770@3.4Ghz (passmark 9945), 12GB RAM, Win 10/64, GeForce GTX645 (passmark 1898); Shiny new laptop: i7 4800MQ@2.7Ghz (passmark 8586), 16GB RAM, Win 10/64, GeForce GTX870M (passmark 3598); Old laptop: i5@2.3Ghz, 8GB RAM, Win 7/64, Intel 3000 graphics
PM
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 9th May 2016 08:27 Edited at: 10th May 2016 11:26
Quote: "Of course, somebody will come up with a script to do it, lol"


There is one way that would definitely work, you could have your starting level in first person, with a menu selection script that freezes your character, the menu selections would use the winzone feature to send you to another level, each menu option would send you to a different level with a different character in its start marker.

The real drawback here would be you would have to duplicate your whole game for each character you can select, so if you had a choice of three characters then your game would be three times the size it would have been before.

i7, NV960 4GB, 16GB memory, 2x 4TB Hybrid, Win10.
i5 , AMD 6770 1GB, 8GB memory, 512GB Generic SATAIII + 2TB Seagate Baracuda SATAIII, Win7.
i3, Radeon integrated graphics, 4GB memory, 512gB Generic SATAII, Win8.1.
Q6600, Intel integrated graphics, 2GB memory, 180GB Generic SATAII, WinXP.
gilmaxter
8
Years of Service
User Offline
Joined: 9th Feb 2016
Location:
Posted: 10th May 2016 00:51
"a menu selection script"

I like that idea, honestly I was going to keep the game in 1st person until i turn it into 3rd person so this idea is great.

Is there an example of a menu selection screen where when you start the game you are presented with a list of options ?

that was i can use the winzone feature to send the player into the designated levels. Not perfect but it would work great I think.
PM
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 10th May 2016 11:26 Edited at: 10th May 2016 12:03
Well, I have no idea how to script it, but 'm sure something can be done with the menu lua or something, one of the scripters might be able to help you there

One way I thought would be a nice way to do it would be to:

Fix the player movement so they could only turn, place one of each of the characters you would want to be choices spread out in front of the player start, change their names ifused field to level names, so for example three characters with ifused fields character1, character2 and character3, and add some nice scenery around, maybe some walls or something.

Then each of the characters would have a script that would detect if the is looking at them and offer an E to select prompt, when E is pressed the script would then check the ifused field and send you to the correct alternate level.

Not the simplest way, but it would be a nice 3d character menu system ...

... in fact it's given me some ideas for my own game.


With my limited knowledge of LUA, I've tried to knock up a basic script to move you to another level by activating an entity with E.

Theoretically, place an entity, putt the name of the level you want it to link to in the ifused field, then in the game activating the entity with E should send you to the level specified.

I'm not sure if it works at the moment as i'm at work and can't test.



Any of you scriptheads out there able to tell me if this would work as specified? (a work at the moment so can't test)

If NO, can you tell me what's wrong with it and how to make it work?

If YES, could you tell me what I would need to add and where to make it so it only prompts to use when you're looking at it instead of when in range?

Also, how would display the name of the entity in a prompt? for example if I named the entity Peter, how would I make the "Press E to Select" prompt say "Press E to Select Peter"?

i7, NV960 4GB, 16GB memory, 2x 4TB Hybrid, Win10.
i5 , AMD 6770 1GB, 8GB memory, 512GB Generic SATAIII + 2TB Seagate Baracuda SATAIII, Win7.
i3, Radeon integrated graphics, 4GB memory, 512gB Generic SATAII, Win8.1.
Q6600, Intel integrated graphics, 2GB memory, 180GB Generic SATAII, WinXP.
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 10th May 2016 17:23
Hey guys, not time to test it, make standalones and so on; my wc broken and my house full of water, and so on.

-I've done 3 levels .
This script work if you respect the name convention: level1/level2/level3; of course you can modify to fit yours needs.
- I tried with all 3 wizards.
- No save standalone often, so are not familiar with, and it keep jumping me to the same level, do know why, and not time to looking for. So please test it you.



About...

Quote: "Also, how would display the name of the entity in a prompt? for example if I named the entity Peter, how would I make the "Press E to Select" prompt say "Press E to Select Peter"?"


In smallg library you can found something similiar.

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

PM
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 10th May 2016 17:31 Edited at: 10th May 2016 17:32
Nice script 3com.

One other thing I just thought of on the subject of scripting jumps to levels.

When you have multiple levels and create a standalone it checks for winzones referencing other levels to tell it to create standalones of those other levels, when you jump to level via another script GameGuru doesn't know about those levels and doesn't put them in the standalone.

So I would recommend that you also add a winzone for each of the levels somewhere else on the first map so that it knows to create them as standalones.

That may be why it kept sending you back tot he first level when you tried it.

i7, NV960 4GB, 16GB memory, 2x 4TB Hybrid, Win10.
i5 , AMD 6770 1GB, 8GB memory, 512GB Generic SATAIII + 2TB Seagate Baracuda SATAIII, Win7.
i3, Radeon integrated graphics, 4GB memory, 512gB Generic SATAII, Win8.1.
Q6600, Intel integrated graphics, 2GB memory, 180GB Generic SATAII, WinXP.
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 10th May 2016 17:41 Edited at: 10th May 2016 18:58
Quote: "Also, how would display the name of the entity in a prompt? for example if I named the entity Peter, how would I make the "Press E to Select" prompt say "Press E to Select Peter"?""

Quote: "In smallg library you can found something similiar."


I've had a look in SG's thread for something about prompting the name of an item, but I can't see anything in there.

As to the looking at thing, I think I found what i'm looking for on his thread.

For my code to detect if you're looking at it and prompt press E, then use the ifused field to jump to the next level when E is pressed is the below right?


i7, NV960 4GB, 16GB memory, 2x 4TB Hybrid, Win10.
i5 , AMD 6770 1GB, 8GB memory, 512GB Generic SATAIII + 2TB Seagate Baracuda SATAIII, Win7.
i3, Radeon integrated graphics, 4GB memory, 512gB Generic SATAII, Win8.1.
Q6600, Intel integrated graphics, 2GB memory, 180GB Generic SATAII, WinXP.
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 10th May 2016 19:50
Yay my script worked!



Just need to work out how to make it so the first person character in the character select map can only turn and not move forward or backward.

i7, NV960 4GB, 16GB memory, 2x 4TB Hybrid, Win10.
i5 , AMD 6770 1GB, 8GB memory, 512GB Generic SATAIII + 2TB Seagate Baracuda SATAIII, Win7.
i3, Radeon integrated graphics, 4GB memory, 512gB Generic SATAII, Win8.1.
Q6600, Intel integrated graphics, 2GB memory, 180GB Generic SATAII, WinXP.
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 10th May 2016 21:07
Quote: "I've had a look in SG's thread for something about prompting the name of an item, but I can't see anything in there."

I've wrote this one, perhaps might help.




About the levels, If I understand fine he want to choose between differents players/levels, and the problem with " JumpToLevelIfUsed(e)" is than you are force to work with "IfUsed" field, and there you just can to set 1 level name.

with my code you can choose what level you want to load.
Next weekend I'll try my code, I want to know if it works, plus your suggestions.

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

PM
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 10th May 2016 21:29 Edited at: 10th May 2016 21:30
Thanks for the name code, i'll take a look

Quote: "with my code you can choose what level you want to load."


You can choose your level with my code too, as it shows in the video, note different third person character in each level

i7, NV960 4GB, 16GB memory, 2x 4TB Hybrid, Win10.
i5 , AMD 6770 1GB, 8GB memory, 512GB Generic SATAIII + 2TB Seagate Baracuda SATAIII, Win7.
i3, Radeon integrated graphics, 4GB memory, 512gB Generic SATAII, Win8.1.
Q6600, Intel integrated graphics, 2GB memory, 180GB Generic SATAII, WinXP.
gilmaxter
8
Years of Service
User Offline
Joined: 9th Feb 2016
Location:
Posted: 11th May 2016 02:19
Belidos


I am trying your script but have a question do I just add the scripts to one of the characters or to all three ?

I must be doing a mistake because when I press E when I face the characters it just says

Jumping to level4 or jumping to level5

without it doing anything. is it because it doesn't do that while I am testing the level and only when I set it to standalone ?

Thanks,

Gil
PM
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 11th May 2016 07:44 Edited at: 11th May 2016 07:46
Quote: "I am trying your script but have a question do I just add the scripts to one of the characters or to all three ?"


You add it to each character, then in the characters properties you put the name of the level you want to jump to for that character.

Quote: "I must be doing a mistake because when I press E when I face the characters it just says

Jumping to level4 or jumping to level5

without it doing anything. is it because it doesn't do that while I am testing the level and only when I set it to standalone ?"


If you get the "Jumping to ..." prompt then you have done it right. It's because the test engine only tests the level you are working on, it won't move you to a new map, that's why it shows that message. When you make it standalone it will jump to the level it states in that message.


Just to let you know. When you make a standalone game the way it decides which levels to add to the standalone is by detecting a winzone on the level then copying over the files for the level pointed to in the winzone. With this script there's no winzone so if you don't add a winzone it won't make the levels those character point to standalone. What you will have to do is just add a winzone for each level with the name of the each level in the ifused field somewhere out of sight on the map pointing to those levels. You can still use the characters to jump levels, but the winzones need to be somewhere on the map to force gameguru to save the other levels as standalone.

If that confuses you at all give me a shout and i'll knock up a quick video on how to use one evening this week or at the weekend.

i7, NV960 4GB, 16GB memory, 2x 4TB Hybrid, Win10.
i5 , AMD 6770 1GB, 8GB memory, 512GB Generic SATAIII + 2TB Seagate Baracuda SATAIII, Win7.
i3, Radeon integrated graphics, 4GB memory, 512gB Generic SATAII, Win8.1.
Q6600, Intel integrated graphics, 2GB memory, 180GB Generic SATAII, WinXP.
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 11th May 2016 09:09
I've added the detect name feature to the scripts (thanks to 3Coms advice) and now when you look at it the prompt says "Press E to select Wizard Royal as a character", "Press E to select Wizard Evil as a character", and so on. I'll edit the change to the script into this post when I get home tonight.

i7, NV960 4GB, 16GB memory, 2x 4TB Hybrid, Win10.
i5 , AMD 6770 1GB, 8GB memory, 512GB Generic SATAIII + 2TB Seagate Baracuda SATAIII, Win7.
i3, Radeon integrated graphics, 4GB memory, 512gB Generic SATAII, Win8.1.
Q6600, Intel integrated graphics, 2GB memory, 180GB Generic SATAII, WinXP.
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 12th May 2016 14:17
@ Belidos

Glad you got it mate!

I've some question about standalone:
If you do some change in let's say "level1" via editor + save, does this change also being update in standalone one?
Or you has to do manually? (I am affraid about)

In another words, does the map (level1) in editor act like instance, or just a simple copy?

After some change in "level1" via editor, does you've to re-save as standalone map?

Thanks in advance.

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

PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 12th May 2016 14:29
no, you need to edit the script in the standalone files or edit the one in your GG files and remake the standalone.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 12th May 2016 14:52
Nice smallg, thanks a lot.

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

PM
Mr Xela
8
Years of Service
User Offline
Joined: 27th Dec 2015
Location:
Posted: 16th May 2016 00:00
Pretty neat thing that should be added :p
PM

Login to post a reply

Server time is: 2024-04-27 11:11:46
Your offset time is: 2024-04-27 11:11:46