|
Thread: scrip custom skills | This thread is pages long: 1 2 · NEXT» |
|
NecroSandro
Hired Hero
|
posted March 01, 2019 03:30 PM |
|
|
scrip custom skills
I want to create a script that gives movement points every day if the player answers yes to a question(one time), but my testsi did not work.
Ask question
-I can teach you how to walk much further. Are you interresing?
if yes
- give mouvement point
if no
ask question
- i can teach you how to summon some creature. Are you......
if someone can help me.
Thx you
|
|
iliveinabox05
Honorable
Famous Hero
|
posted March 01, 2019 06:34 PM |
|
|
What kind of event is the "ask" script running on? If it is on a map timed event, then it's not connected to anything to give additional movement to.
The script should be on an army's or hero's timed events. Then you will have the option to add movement to the army / hero.
If you do have the script on and army or hero and they are not receiving a movement bonus, try adding some display scripts for the "yes" and "no" branches to see which one is actually being entered.
"Yes": DISPLAY "Yes I want to learn!"
"No": DISPLAY "No thanks!"
Also, how are you testing? Have you tried adding a LOT of movement points? I can't remember if there is a bug with adding movement or not, but I'm kind of remembering having to multiply by 10. If no one else chimes in by the time I get home, I will take a look at my scripts for increasing movement, which definitely work.
|
|
NecroSandro
Hired Hero
|
posted March 01, 2019 08:11 PM |
|
|
i try on army.
Like this its working
But i want army receive mouvement point each day if anwser question is yes without repeat the question all the time.
|
|
iliveinabox05
Honorable
Famous Hero
|
posted March 01, 2019 08:20 PM |
|
|
NecroSandro said: i try on army.
Like this its working
But i want army receive mouvement point each day if anwser question is yes without repeat the question all the time.
Ah okay. So it is adding movement to the army but you also want the question to only be asked once.
The way I would do it would be to create a boolean variable at the beginning of the script and set it to true.
set askQuestion = true
Then, create a conditional, and if askQuestion is true, put your ask script in the true fork, otherwise, nothing needs to be done.
After the ask script and still inside the true fork, set askQuestion to false. After that, your question won't be asked again.
You will also need to record the answer to your ask script in a boolean variable:
set wantsMovement = true / false
Finally, after the first conditional, you will want a new conditional, which checks the wantsMovement variable. If wantsMovement is true, add the movement, otherwise don't do anything.
Let me know if this helps.
Edit. Also, you will want to save the answers to any other ask scripts so that you can test those variables as well.
|
|
NecroSandro
Hired Hero
|
posted March 01, 2019 08:36 PM |
|
|
Ok i try it.
But its normal i cant do anything in conditional action?
Also
Quote: Then, create a conditional, and if askQuestion is true, put your ask script in the true fork, otherwise, nothing needs to be done.
how to define " if ask question is true "
i dont find it.
|
|
iliveinabox05
Honorable
Famous Hero
|
posted March 01, 2019 08:55 PM |
|
|
NecroSandro said: Ok i try it.
But its normal i cant do anything in conditional action?
Also
how to define " if ask question is true "
i dont find it.
You should be able to click "new" or maybe right click on the "sequence" script and select the new option from there.
If you still can't add a script to the conditional, then you might need to use the game's editor to create some of the scripts.
Also, the H4MG can actually drag and drop scripts into each other, so you could actually drag your "ask" script into the conditional sequence on the true fork, since you already made that script.
As far as setting ask question, you need to define your boolean variable first:
set askQuestion = true
It should just be one of the "Set" script options, similar to how you set a numeric variable.
Edit. It might also be under "variable", I've just been going off the top of my head since I'm at work and can't actually look at the editor.
|
|
NecroSandro
Hired Hero
|
posted March 01, 2019 10:36 PM |
|
|
Ok, tell me if first step are correct please.
Thank you
|
|
iliveinabox05
Honorable
Famous Hero
|
posted March 01, 2019 10:49 PM |
|
|
NecroSandro said: Ok, tell me if first step are correct please.
Thank you
You're getting closer.
Set askQuestion to true is correct.
In the conditional right below that. instead of "if TRUE", it should be "if askQuestion equals true". You'll need to click on the conditional and update the condition.
You will also want the script adding movement to be in a second conditional after the first one, since once you set askQuestion to false, you won't ever get to it again.
|
|
NecroSandro
Hired Hero
|
posted March 01, 2019 11:23 PM |
|
|
I'm not far I think but I can not repeat "increase point of movement" every day
|
|
iliveinabox05
Honorable
Famous Hero
|
posted March 01, 2019 11:29 PM |
|
|
NecroSandro said: I'm not far I think but I can not repeat "increase point of movement" every day
Looking good! The only other thing you'll need to do is go to the map menu, and then create a timed event there for day 1 that doesn't repeat, which will initialize (set) your "wantsTraveler" and other variables to false, just to be safe. I'm pretty sure they are all false by default, but doesn't hurt to make sure
What do you mean by you can't repeat the increasing of movement every day? Try putting a DISPLAY script inside the "wantsTraveler" conditional right before you add the movement points. Then you can test by seeing if you get the DISPLAY message at the beginning of each turn.
|
|
NecroSandro
Hired Hero
|
posted March 01, 2019 11:44 PM |
|
|
Ok, i put Display message and i got the message one time.. but what i want is ask question one time but increase mouvement point repeat each day ( not the ask question).
and, i see display message of all variable.
|
|
iliveinabox05
Honorable
Famous Hero
|
posted March 02, 2019 12:29 AM |
|
|
NecroSandro said: Ok, i put Display message and i got the message one time.. but what i want is ask question one time but increase mouvement point repeat each day ( not the ask question).
and, i see display message of all variable.
Right, only ask the question on first day, and then apply the bonuses the rest. Can you show me the general tab for that event, please? It should be working so that the question is only asked the first day and the bonus should be applied every time.
|
|
NecroSandro
Hired Hero
|
posted March 02, 2019 12:50 AM |
|
|
Yes , its that
|
|
iliveinabox05
Honorable
Famous Hero
|
posted March 02, 2019 05:30 AM |
|
|
Go to the "general" tab. By default, timed events are only run once. To run them repeatedly, make sure you select "Every 1 day" instead of "never" in the "Subsequent occurrences" box.
|
|
NecroSandro
Hired Hero
|
posted March 03, 2019 11:49 AM |
|
|
iliveinabox05 said: Go to the "general" tab. By default, timed events are only run once. To run them repeatedly, make sure you select "Every 1 day" instead of "never" in the "Subsequent occurrences" box.
Hi, sorry for answer time, my baby just born last day .
if i check " repeat each day" , ask question is repeating too
and i got display message for all variable ( you can see it on script i show you before)
sorry for my english im french
[url=https://streamable.com/gbj6o]video of script[/url]
|
|
iliveinabox05
Honorable
Famous Hero
|
posted March 04, 2019 02:47 AM |
|
|
NecroSandro said: Hi, sorry for answer time, my baby just born last day .
if i check " repeat each day" , ask question is repeating too
and i got display message for all variable ( you can see it on script i show you before)
sorry for my english im french
video of script
Congrats on the baby!
You do want the script to run everyday so you need to have that checked.
The reason the question is asked each day is because you set askQuestion to true at the beginning of the script.
You'll want to select "campaign" -> "map properties" from the top menu of the editor. There you will want to click on the "events" tab and switch to "timed." You'll want to make a new timed event which only runs on the first day, where you set askQuestion to true. You'll also want to set your custom skill variables to false in this event.
Give that a try and let me know how if that works.
|
|
NecroSandro
Hired Hero
|
posted March 04, 2019 04:10 PM |
|
|
i dont get it grrrr
[url=https://streamable.com/80hpo]video[/url]
|
|
iliveinabox05
Honorable
Famous Hero
|
posted March 04, 2019 05:43 PM |
|
|
Upload the map somewhere for me and I'll take a look when I get home from work
|
|
NecroSandro
Hired Hero
|
posted March 04, 2019 06:37 PM |
|
|
iliveinabox05 said: Upload the map somewhere for me and I'll take a look when I get home from work
i send you by mp
script on red hero at 63,50 lvl 1. Thank you
|
|
iliveinabox05
Honorable
Famous Hero
|
posted March 04, 2019 07:42 PM |
|
|
Received. I'll download it and open it up when I get home. It will be a little later tonight, but I'll get to it.
Edit. Hate to make excuses, but when I got home, the power went out >.< I'll try to take a look tonight.
|
|
|