• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Random Encounter System help

Status
Not open for further replies.
Level 12
Joined
Jan 30, 2009
Messages
1,067
EDIT: SOLVED.

http://www.hiveworkshop.com/forums/...dom-encounter-system-help-182071/#post1748580 For solution.
http://www.hiveworkshop.com/forums/...dom-encounter-system-help-182071/#post1748590 For a quick hint for anyone else who may wish to utilize something like this.

Hello.

So, one more issue for me. Yes. Another. Again. ;)

THIS IS FOR A SINGLE-PLAYER CAMPAIGN. DON'T WORRY ABOUT PLAYERS OTHER THAN PLAYER 1 (RED). IT DOES NOTHING FOR ME IF IT IS USABLE BY ANOTHER PLAYER.

Anyway, so, now that I've got the battle system for my map fixed, I tried to test it out with my random encounter system. Problem is, it didn't work.

I use the Arrow Keys for movement. So, I thought maybe the "Player Pressed the Up/Down Arrow Key" Events would work, but it turns out that didn't do as I had planned.

What I'm trying to get out of this is a system where, when you're moving (With the arrow keys, ofc.), it has a random chance of turning on a trigger. The first value I'd like to test is 30%.

The only way I could think of gaining this result is when moving (Outside of battle, ofc.) to turn on a periodic event. But I'm not sure how to do this (I tried a couple times, couldn't get it to work).

In simple terms, here's what I'm trying to achieve:

  • While the player is holding the Up or Down button (They are moving the unit) it will roll every (0.5 sec) 1-100 and check the result >=30 and if it is, it'll turn on the "Battle" trigger.
  • If the player releases the Up/Down arrow key (and they're NOT moving, in other words, neither is being pressed), it turns off the periodic event trigger.
Just as an FYI, the "Battle" trigger, doesn't contain any Event Responses in it, it just sets some variables, and turns on another trigger. In case that makes a difference.

If you need further information, please ask. Of course, I abide by my signature!
 
Last edited:
Level 6
Joined
Jan 29, 2010
Messages
213
Do you mean something to look like this?
  • inistalization
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Set Dice = 0
  • player pushes Up arrow
    • Events
      • Player - Player 1 (Red) Presses the Up Arrow key
    • Conditions
    • Actions
      • Set Dice = (Random integer number between 1 and 100)
  • player releases Up arrow
    • Events
      • Player - Player 1 (Red) Releases the Up Arrow key
    • Conditions
    • Actions
      • Set Dice = 0
  • more or equal to 30
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • Dice Greater than or equal to 30
    • Actions
      • Game - Display to (All players) the text: Your actions!
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
Not quite, D0W3R. That will use the same result until I release the button, which does the exact same thing as it would without the timer.

Thanks for trying though.
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
I have a movement system. I don't need another one.

I just need the rolls to happen periodically WHILE I'm moving, and stop when I'm not.
 
Level 6
Joined
May 11, 2010
Messages
236
Something like that maybe? Eh don't worry about the "Set Dice" dont think you need that.
  • Movement
    • Events
      • Player - Player 1 (Red) Presses the Up Arrow key
    • Conditions
    • Actions
      • Set Dice = (Random integer number between 1 and 100)
      • Trigger - Turn on Movementchance <gen>
  • Movementchance
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to 30
        • Then - Actions
          • Quest - Display to (All players) the Quest Update message: Actions
        • Else - Actions
  • Releasemovement
    • Events
      • Player - Player 1 (Red) Releases the Up Arrow key
    • Conditions
    • Actions
      • Trigger - Turn off Movementchance <gen>
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
Thanks, Drazhar.

Actually ended up with that exact set up about 20 mins ago after an epiphany from talking with my roommate (And no, he doesn't know anything about mapmaking).

And now I've found a way to inject it into my movement and battle systems flawlessly.

Furthermore, for anyone else who'd like to use a system such as this, 30% is TOO HIGH!!!!! Happens just about every (by using .5s instead of 1s like Drazhar has) 1-2.5s of movement time.

15 seems a bit too low, I'm currently experimenting, but it looks like 20-ish is going to be about right.
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
Might be too high.

I'm not gonna test it now, I'm going to relax a bit before I go to bed, :)
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
EDIT: Totally posted in the wrong thread.

Sounds like it's time for bed. Lol.

Anyway, this is solved, so, I ain't gonna post here anymore, :p
 
Last edited:
Level 12
Joined
Jan 30, 2009
Messages
1,067
Who is he ?
His presence... challenges my skill =D haha

Ignoring my previous statement of not posting again...this makes no sense to any other poor sap reading this as I deleted my dumbass mistake, xD

And Def, clicky the link in my sig, ;)
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
Tsk, tsk, that's a question for the project thread. :)

Although, that's a concept introduced to me by my old partner. It's simply an idea at this time. However, the idea spawned from Chocobos, :D How you could (In some of the FF Games) ride them around as "mounts" at some points. In FF12 you can "rent" a chocobo even, and it allows you to go places you otherwise would be unable to go via special "Chocobo paths".

Which I kinda like the idea of. But, that's an idea for another day. It will not be included in the demo.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
I can make you the Mount System, I've tried it =D
With a correct Attachments name, you can look a unit riding a mount unit =D
I've tried Peasant riding a riderless horse, IT WORKS !
About pathing system of the Mount Unit, I can do it too =D
I'll create special trigger to detect if the unit has Mount Unit or not, if he has, he can pass the path =D
 
Status
Not open for further replies.
Top