Can the player choose the hero's walking speed

Started by dikla, Wed 21/07/2004 07:23:14

Previous topic - Next topic

dikla

hi all.

I thing that it is better my hero to walk on speed 0 (jump from place to place. it is quicker). but is there a
possible for the player to choose if the hero will go slow or quick? I mean to ask him at the begging of the game to choose - do you want  the speed of the hero will be slow or something and let him choose?
tnx dikla

Raider

yes u can
on the characters screen there is a box where it says:
uniform movement speed so tick that box
Below is a box that says:
Speed. it has a number next to it. the higher the number the faster you character.
hope it helps

-Raider

Raider

or did you mean the player, playing the game choose?

- Raider

Mr Jake

You can create a slider on a GUI and in the script for the slide set the walking speed of the  character to the value of the slider. This would mean that when the slider is dragged the walking speed is changed (once the slider is release)

I cant look up the commands right now but try searching for
'GetSliderValue' and 'Player Variables'

dikla

Raider - yes I mean THE PLAYER not my main character
will be able to choose the speed of walking.
Hotspot - did your answer can solve this problem?
how can the one who play the game (not me who created it)  choose the speed. I mean the surfer.
tx dikla

Mr Jake

make a slider on a GUI and code it so that the player can change the slider value which changes the speed of the walk.

dikla

Quote from: Hotspot on Wed 21/07/2004 15:09:27
make a slider on a GUI and code it so that the player can change the slider value which changes the speed of the walk.
sorry my dear. i have no idea what is a slider and how to make it in GUI and how to code it.
what i understand is that i have do to some box list with possibilities (actually only 2 - "0" and "1"). can you be a big help to me and tell me exectly what and how i have to do? the manual did not explained it very well, and i have finished the game so i afraid to mess it up.
if it is not too much, pls write to me step by step.
thank you very much
dikla

dikla

I was a little hasty in my post. I prepared a nice gui
but i dont know where to put the code and how. can you tell me exectly the script?
dikla

monkey0506

In the GUI editing menu, there's a button that looks like

-@-----

Kind of like that... You click that button, then drag a box and it will make a slider. You can then change the min and max values with the properties window, set a background image for the slider, and set an image for the handle. Then you would have to find the variable to change the character's walking speed, and set that equal to the slider value. Here it is:

SetCharacterSpeed(CHARID, GetSliderValue(SLIDERGUI, OBJECT));

You would have to replace CHARID with your character's ID, SLIDERGUI with the slider gui's name or number, and OBJECT with the object number of the slider. IE, if you have character EGO, and the slider is on a gui named CHARSPEED, and the slider is the only object, your script would look like this:

SetCharacterSpeed(EGO, GetSliderValue(CHARSPEED, 0));

you could set the CHARSPEED gui to Popup Modal in the Properties window, and then in on_key_press put something like:

if ((keycode==363) && (IsGUIOn(CHARSPEED)==0)){ //F5
  GUIOn(CHARSPEED);
  }
else if ((keycode==363) && (IsGUIOn(CHARSPEED)==1)){ //F5
  GUIOff(CHARSPEED);
  }

I haven't tested this, so I'm not sure if it works, or if it helps, but I think that's it. Also, if you're afraid of messing up your game, here's a tip:

Open the Global Script, select the entire thing, right click, Copy, then open Notepad (or other text editing program) and click on paste. Then save it somewhere as a backup of your Global Script. That way if you mess something up, you can just revert back to that. :)

dikla

Thanks. i try it tomorrow and let you know how it worked.
dikla

SMF spam blocked by CleanTalk