• 🏆 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!

[GUI][MPI] Race System (Fixed)

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
  • Like
Reactions: shadowvzs
A Race System.

-Increases Speed while in the high way.
-You become slower and slower when out of the high way.
-You lose when you crash.
-Advanced driving system.
-It's MPI.
-Multiboard that shows how long have you traveled.

Credits

-skrab (Ford Falcon model) <- I used this model as a crashed car in the high way. When you crash on it, you lose.

-Triggers
  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set PlayerRegion[1] = Player 1 <gen>
      • Set PlayerRegion[2] = Player 2 <gen>
      • Set PlayerRegion[3] = Player 3 <gen>
      • Set TP = (Player 1 (Red) start location)
      • Unit - Create 1 Dwarf Car for Player 1 (Red) at TP facing 90.00 degrees
      • Set Player[(Player number of (Owner of (Last created unit)))] = (Last created unit)
      • Custom script: call RemoveLocation(udg_TP)
      • Set TP = (Player 2 (Blue) start location)
      • Unit - Create 1 Orc Car for Player 2 (Blue) at TP facing 90.00 degrees
      • Set Player[(Player number of (Owner of (Last created unit)))] = (Last created unit)
      • Custom script: call RemoveLocation(udg_TP)
      • Set TP = (Player 3 (Teal) start location)
      • Unit - Create 1 Undead Car for Player 3 (Teal) at TP facing 90.00 degrees
      • Set Player[(Player number of (Owner of (Last created unit)))] = (Last created unit)
      • Custom script: call RemoveLocation(udg_TP)
      • Set CrashSound[1] = MetalHeavyBashMetal1 <gen>
      • Set CrashSound[2] = MetalHeavyBashMetal2 <gen>
      • Set CrashSound[3] = MetalHeavyBashMetal3 <gen>
      • Set PlayerCam[1] = Player 1 Cam <gen>
      • Set PlayerCam[2] = Player 2 Cam <gen>
      • Set PlayerCam[3] = Player 3 Cam <gen>
      • Wait 0.01 seconds
      • Trigger - Add to Car 1 <gen> the event (Unit - A unit comes within 180.00 of Player[1])
      • Trigger - Add to Car 2 <gen> the event (Unit - A unit comes within 180.00 of Player[2])
      • Trigger - Add to Car 3 <gen> the event (Unit - A unit comes within 180.00 of Player[3])
      • Trigger - Add to Defeat 1 <gen> the event (Unit - A unit comes within 50.00 of Player[1])
      • Trigger - Add to Defeat 2 <gen> the event (Unit - A unit comes within 50.00 of Player[2])
      • Trigger - Add to Defeat 3 <gen> the event (Unit - A unit comes within 50.00 of Player[3])
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Trigger - Add to Go Left <gen> the event (Player - (Picked player) Presses the Left Arrow key)
          • Trigger - Add to Stop Left <gen> the event (Player - (Picked player) Releases the Left Arrow key)
          • Trigger - Add to Go Right <gen> the event (Player - (Picked player) Presses the Right Arrow key)
          • Trigger - Add to Stop Right <gen> the event (Player - (Picked player) Releases the Right Arrow key)
          • Multiboard - Create a multiboard with 3 columns and 3 rows, titled Car Status
          • Multiboard - Set the display style for (Last created multiboard) item in column 0, row 0 to Show text and Hide icons
          • Multiboard - Set the width for (Last created multiboard) item in column 0, row 0 to 11.00% of the total screen width
          • Multiboard - Set the text for (Last created multiboard) item in column 1, row (Player number of (Picked player)) to (Name of (Picked player))
          • Set SpeedOfCar[(Player number of (Picked player))] = 5.00
          • Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across (Playable map area)
          • Animation - Play Player[(Player number of (Picked player))]'s walk animation
  • Every 003 seconds
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • GoingLeft[(Player number of (Picked player))] Equal to True
              • (Facing of Player[(Player number of (Picked player))]) Less than or equal to 150.00
            • Then - Actions
              • Unit - Make Player[(Player number of (Picked player))] face ((Facing of Player[(Player number of (Picked player))]) + 8.00) over 0.00 seconds
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • GoingRight[(Player number of (Picked player))] Equal to True
              • (Facing of Player[(Player number of (Picked player))]) Greater than or equal to 30.00
            • Then - Actions
              • Unit - Make Player[(Player number of (Picked player))] face ((Facing of Player[(Player number of (Picked player))]) - 8.00) over 0.00 seconds
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • GoingLeft[(Player number of (Picked player))] Equal to False
              • GoingRight[(Player number of (Picked player))] Equal to False
            • Then - Actions
              • Unit - Make Player[(Player number of (Picked player))] face 90.00 over 0.00 seconds
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Facing of Player[(Player number of (Picked player))]) Greater than or equal to 85.00
              • (Facing of Player[(Player number of (Picked player))]) Less than or equal to 95.00
            • Then - Actions
            • Else - Actions
              • Set TP = (Position of Player[(Player number of (Picked player))])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Facing of Player[(Player number of (Picked player))]) Greater than 90.00
                • Then - Actions
                  • Set TP2 = (TP offset by (((Facing of Player[(Player number of (Picked player))]) - 90.00) / 5.00) towards 180.00 degrees)
                  • Unit - Move Player[(Player number of (Picked player))] instantly to TP2
                  • Custom script: call RemoveLocation(udg_TP2)
                • Else - Actions
                  • Set TP2 = (TP offset by (360.00 / (Facing of Player[(Player number of (Picked player))])) towards 0.00 degrees)
                  • Unit - Move Player[(Player number of (Picked player))] instantly to TP2
                  • Custom script: call RemoveLocation(udg_TP2)
              • Custom script: call RemoveLocation(udg_TP)
          • Selection - Select Player[(Player number of (Picked player))] for (Picked player)
          • Camera - Apply PlayerCam[(Player number of (Picked player))] for (Picked player) over 0.00 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Player[(Player number of (Picked player))] Equal to No unit
            • Then - Actions
              • Set SpeedOfCar[(Player number of (Picked player))] = 0.00
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Highway 1 <gen> contains Player[(Player number of (Picked player))]) Equal to True
                      • (Highway 2 <gen> contains Player[(Player number of (Picked player))]) Equal to True
                      • (Highway 3 <gen> contains Player[(Player number of (Picked player))]) Equal to True
                  • SpeedOfCar[(Player number of (Picked player))] Less than or equal to 40.00
                • Then - Actions
                  • Set SpeedOfCar[(Player number of (Picked player))] = (SpeedOfCar[(Player number of (Picked player))] + 0.10)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SpeedOfCar[(Player number of (Picked player))] Less than or equal to 0.20
                    • Then - Actions
                    • Else - Actions
                      • Set SpeedOfCar[(Player number of (Picked player))] = (SpeedOfCar[(Player number of (Picked player))] - 0.18)
          • Set TotalScore[(Player number of (Picked player))] = (TotalScore[(Player number of (Picked player))] + (SpeedOfCar[(Player number of (Picked player))] / 33.00))
          • Multiboard - Set the text for (Last created multiboard) item in column 2, row (Player number of (Picked player)) to (Speed : + ((String(SpeedOfCar[(Player number of (Picked player))], 1, 1)) + m/s))
          • Multiboard - Set the text for (Last created multiboard) item in column 3, row (Player number of (Picked player)) to (Total : + ((String(TotalScore[(Player number of (Picked player))], 1, 1)) + m))
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Set TG = (Units in PlayerRegion[(Integer A)])
          • Unit Group - Pick every unit in TG and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Not equal to Player[1]
                  • (Picked unit) Not equal to Player[2]
                  • (Picked unit) Not equal to Player[3]
                • Then - Actions
                  • Set TP = (Position of (Picked unit))
                  • Set TP2 = (TP offset by SpeedOfCar[(Integer A)] towards 270.00 degrees)
                  • Unit - Move (Picked unit) instantly to TP2
                  • Custom script: call RemoveLocation(udg_TP)
                  • Custom script: call RemoveLocation(udg_TP2)
                • Else - Actions
          • Custom script: call DestroyGroup(udg_TG)
      • Set TG = (Units in Units Remove <gen>)
      • Unit Group - Pick every unit in TG and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Custom script: call DestroyGroup(udg_TG)
  • Every 3 seconds
    • Events
      • Time - Every 3.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 2, do (Actions)
        • Loop - Actions
          • Set TP = (Random point in Broken Car Create 1 <gen>)
          • Unit - Create 1 Broken Car for Neutral Passive at TP facing 0.00 degrees
          • Animation - Change (Last created unit)'s vertex coloring to (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Custom script: call RemoveLocation(udg_TP)
          • Set TP = (Random point in Broken Car Create 2 <gen>)
          • Unit - Create 1 Broken Car for Neutral Passive at TP facing 0.00 degrees
          • Animation - Change (Last created unit)'s vertex coloring to (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Custom script: call RemoveLocation(udg_TP)
          • Set TP = (Random point in Broken Car Create 3 <gen>)
          • Unit - Create 1 Broken Car for Neutral Passive at TP facing 0.00 degrees
          • Animation - Change (Last created unit)'s vertex coloring to (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Custom script: call RemoveLocation(udg_TP)
          • Set TP = (Random point in Grass Create 1 <gen>)
          • Unit - Create 1 Tree for Neutral Passive at TP facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_TP)
          • Set TP = (Random point in Grass Create 2 <gen>)
          • Unit - Create 1 Tree for Neutral Passive at TP facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_TP)
          • Set TP = (Random point in Grass Create 3 <gen>)
          • Unit - Create 1 Tree for Neutral Passive at TP facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_TP)
          • Set TP = (Random point in Grass Create 4 <gen>)
          • Unit - Create 1 Tree for Neutral Passive at TP facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_TP)
      • Wait 1.00 seconds
      • For each (Integer A) from 1 to 2, do (Actions)
        • Loop - Actions
          • Set TP = (Random point in Grass Create 1 <gen>)
          • Unit - Create 1 Tree for Neutral Passive at TP facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_TP)
          • Set TP = (Random point in Grass Create 2 <gen>)
          • Unit - Create 1 Tree for Neutral Passive at TP facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_TP)
          • Set TP = (Random point in Grass Create 3 <gen>)
          • Unit - Create 1 Tree for Neutral Passive at TP facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_TP)
          • Set TP = (Random point in Grass Create 4 <gen>)
          • Unit - Create 1 Tree for Neutral Passive at TP facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_TP)
      • Wait 1.00 seconds
      • For each (Integer A) from 1 to 2, do (Actions)
        • Loop - Actions
          • Set TP = (Random point in Grass Create 1 <gen>)
          • Unit - Create 1 Tree for Neutral Passive at TP facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_TP)
          • Set TP = (Random point in Grass Create 2 <gen>)
          • Unit - Create 1 Tree for Neutral Passive at TP facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_TP)
          • Set TP = (Random point in Grass Create 3 <gen>)
          • Unit - Create 1 Tree for Neutral Passive at TP facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_TP)
          • Set TP = (Random point in Grass Create 4 <gen>)
          • Unit - Create 1 Tree for Neutral Passive at TP facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_TP)
  • Go Left
    • Events
    • Conditions
    • Actions
      • Set GoingLeft[(Player number of (Triggering player))] = True
      • Set GoingRight[(Player number of (Triggering player))] = False
  • Stop Left
    • Events
    • Conditions
    • Actions
      • Set GoingLeft[(Player number of (Triggering player))] = False
  • Go Right
    • Events
    • Conditions
    • Actions
      • Set GoingRight[(Player number of (Triggering player))] = True
      • Set GoingLeft[(Player number of (Triggering player))] = False
  • Stop Right
    • Events
    • Conditions
    • Actions
      • Set GoingRight[(Player number of (Triggering player))] = False
  • Car 1
    • Events
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Broken Car
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SpeedOfCar[1] Greater than 10.00
        • Then - Actions
          • Set SpeedOfCar[1] = (SpeedOfCar[1] - 10.00)
        • Else - Actions
      • Sound - Play CrashSound[(Random integer number between 1 and 3)] at 100.00% volume, attached to Player[1]
  • Car 2
    • Events
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Broken Car
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SpeedOfCar[2] Greater than 10.00
        • Then - Actions
          • Set SpeedOfCar[2] = (SpeedOfCar[1] - 10.00)
        • Else - Actions
      • Sound - Play CrashSound[(Random integer number between 1 and 3)] at 100.00% volume, attached to Player[2]
  • Car 3
    • Events
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Broken Car
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SpeedOfCar[3] Greater than 10.00
        • Then - Actions
          • Set SpeedOfCar[3] = (SpeedOfCar[1] - 10.00)
        • Else - Actions
      • Sound - Play CrashSound[(Random integer number between 1 and 3)] at 100.00% volume, attached to Player[3]
  • Defeat 1
    • Events
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Broken Car
    • Actions
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 1 to Speed : 0 m/s
      • Sound - Play BuildingDeathLargeHuman <gen> at 100.00% volume, attached to Player[1]
      • Game - Display to Player Group - Player 1 (Red) the text: Your car crashed!!!...
      • Set Player[1] = No unit
  • Defeat 2
    • Events
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Broken Car
    • Actions
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 2 to Speed : 0 m/s
      • Sound - Play BuildingDeathLargeHuman <gen> at 100.00% volume, attached to Player[2]
      • Game - Display to Player Group - Player 2 (Blue) the text: Your car crashed!!!...
      • Set Player[2] = No unit
  • Defeat 3
    • Events
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Broken Car
    • Actions
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 3 to Speed : 0 m/s
      • Sound - Play BuildingDeathLargeHuman <gen> at 100.00% volume, attached to Player[3]
      • Game - Display to Player Group - Player 3 (Teal) the text: Your car crashed!!!...
      • Set Player[3] = No unit
Keywords:
race, car, highway, fast, speed
Contents

[GUI][MPI] Race System (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. Moderator: Pharaoh_ Date: 04:01, 31st Mar 2012 This resource is heavily map-specific, uses waits and contains an inefficient production of loops under a timed event. It also...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.

160036-albums4747-picture55861.png

Moderator: Pharaoh_
Date: 04:01, 31st Mar 2012

Review
This resource is heavily map-specific, uses waits and contains an inefficient production of loops under a timed event. It also affects only Single Player mode.

Needs fix.

edit
17th Jul 2012
Magtheridon96:


This is still way too map specific because you're using regions
in the test map. Currently, it only functions for 3 players. You
need to make it MPI so that it can work for any number of players.

You should use arrays to achieve this.
Car[1] -> player 1, Car[2] -> player 2, etc...

Also, that wait is totally unneeded.

This system should allow the user to register a 'car' for a player.
The user should also be able to enable and disable the system at will
(Use a boolean for that). It has to be something you can plug in to
your map and work with easily.
 
1) There are waits /everywhere/ in this system
2) Your car automatically drifts right
3) Can cause major lag if you stay offroad for too long (which can cause you to have to Alt+F4 out)
4) Isn't really a system, it's more of a map as it's not (really) applicable to any other map other than this one.
5) Crashed cars can overlap
6) Can generate "unavoidable" crashes thus meaning it's not really fair
7) You can die twice if cars are overlapping at the same time
8) Requires lots of pre-defined regions
9) The only real use is if somebody wants to have a "driving" section to their map, and even then it'd require quite a few modifications so that that'd be possible, such as a current distance counter
10) The "crash" area does not match the size/area of the cars
11) It is /Not/ really configurable other than a few sounds
12) Is /Not/ MPI
13) Is unit-specific
14) The multiboard would display to everyone if there were multiple people in the game
15) Trigger names are not really appropriate

All I can come up with for now, plus I'm a bit too lazy to find more
 
Level 14
Joined
Jul 25, 2011
Messages
1,065
1) There are waits /everywhere/ in this system
2) Your car automatically drifts right
3) Can cause major lag if you stay offroad for too long (which can cause you to have to Alt+F4 out)
4) Isn't really a system, it's more of a map as it's not (really) applicable to any other map other than this one.
5) Crashed cars can overlap
6) Can generate "unavoidable" crashes thus meaning it's not really fair
7) You can die twice if cars are overlapping at the same time
8) Requires lots of pre-defined regions
9) The only real use is if somebody wants to have a "driving" section to their map, and even then it'd require quite a few modifications so that that'd be possible, such as a current distance counter
10) The "crash" area does not match the size/area of the cars
11) It is /Not/ really configurable other than a few sounds
12) Is /Not/ MPI
13) Is unit-specific
14) The multiboard would display to everyone if there were multiple people in the game
15) Trigger names are not really appropriate

All I can come up with for now, plus I'm a bit too lazy to find more

Ok... I'll try using vairables so it can be used for other maps. And what's MPI? I know MUI. Is it something like that?
 
Top