# Requesting Assistance from any/all Experienced Coders

Status
Not open for further replies.

#### MightyBobBarker

Level 3
I'll try to keep this as short and simple as possible because I realize you guys have better things to do than help me with this.

A while back, I posted an unfinished Mario Kart map here at the hive. I've forgotten about it until recently and decided that I would like help making it more playable.

Here's the problem--

I know very little jass and what jass I do know helps me very little, and I am positive that continuing to code in the gui will only hinder map further.

My biggest issues are with my usage of the

• Time - Every X.XX seconds of the game
and

• Wait X.XX seconds
• Run This Trigger
Where X.XX in most cases is 0.01

So here's what I would like help on. I need a way to move the karts that doesn't leak as much as this:

• Events
• Time - Every 0.01 seconds of the game.
• Actions
• Unit - Move UNITMOVE1 instantly to ((Center of (Region centered at (Position of UNITMOVE1 with size (5.00, 5.00))) offset by (X1, Y1))
• Unit - Make UNITMOVE1 face ((Center of (Region centered at (Position of UNITMOVE1) with size (5.00, 5.00))) offset by (X1, Y1)) over 0.00 seconds
---

And as far as turning goes, when a player presses and holds left, it turns on the following trigger:

• Events
• Time - Every 0.01 seconds of game time
• Actions
• If ((X1 Greater than 0.00) and (Y1 Equal to 0.00)) then do (Set X1 = 19.75) else do (Do nothing)
• If ((X1 Greater than 0.00) and (Y1 Equal to 0.00)) then do (Set Y1 = 0.25) else do (Do nothing)
• If ((X1 Less than 0.00) and (Y1 Equal to 0.00)) then do (Set X1 = -19.75) else do (Do nothing)
• If ((X1 Less than 0.00) and (Y1 Equal to 0.00)) then do (Set Y1 = -0.25) else do (Do nothing)
• If ((Y1 Greater than 0.00) and (X1 Equal to 0.00)) then do (Set Y1 = 19.75) else do (Do nothing)
• If ((Y1 Greater than 0.00) and (X1 Equal to 0.00)) then do (Set X1 = -0.25) else do (Do nothing)
• If ((Y1 Less than 0.00) and (X1 Equal to 0.00)) then do (Set Y1 = -19.75) else do (Do nothing)
• If ((Y1 Less than 0.00) and (X1 Equal to 0.00)) then do (Set X1 = 0.25) else do (Do nothing)
• If ((X1 Greater than 0.00) and ((X1 Less than 20.00) and (Y1 Greater than 0.00))) then do (Set X1 = (X1 - 0.25)) else do (Do nothing)
• If ((X1 Greater than -20.00) and ((X1 Less than 0.00) and (Y1 Greater than 0.00))) then do (Set X1 = (X1 - 0.25)) else do (Do nothing)
• If ((X1 Greater than 0.00) and ((X1 Less than 20.00) and (Y1 Less than 0.00))) then do (Set X1 = (X1 + 0.25)) else do (Do nothing)
• If ((X1 Greater than -20.00) and ((X1 Less than 0.00) and (Y1 Less than 0.00))) then do (Set X1 = (X1 + 0.25)) else do (Do nothing)
• If ((Y1 Greater than 0.00) and ((Y1 Less than 20.00) and (X1 Greater than 0.00))) then do (Set Y1 = (Y1 + 0.25)) else do (Do nothing)
• If ((Y1 Greater than -20.00) and ((Y1 Less than 0.00) and (X1 Greater than 0.00))) then do (Set Y1 = (Y1 + 0.25)) else do (Do nothing)
• If ((Y1 Greater than 0.00) and ((Y1 Less than 20.00) and (X1 Less than 0.00))) then do (Set Y1 = (Y1 - 0.25)) else do (Do nothing)
• If ((Y1 Greater than -20.00) and ((Y1 Less than 0.00) and (X1 Less than 0.00))) then do (Set Y1 = (Y1 - 0.25)) else do (Do nothing)
This seemingly complicated trigger is actually really simple. It just turns the kart 0.25 polar degrees to the left for every 0.01 second that the left arrow key is held down. It turns them the opposite way when the right arrow key is held down.

The green shells move in a similar fashion, so the movement will need to move a variable unit and not a specific unit.

I guess, if I've somehow muddled you in my crazed rantings above, I'll sum it up for you--

I need some way to remove the leaks from my map that cause slowdown and eventual inconsistencies between players. I'm not sure if the triggers above are entirely leak proof and as such, I posted them for you guys to look at.

If you see anything in the triggers of my map (the download is available below) that will make it leak, than please bring it to my attention and, if you can, provide me with a way to remedy it.

All help that is given will go in the map credits, no matter how small the help is. If there is nothing that anyone can do, I'm more than willing to drop this project to work on something productive.

Thanks for taking the time to read the pleadings of this poor, helpless sap.

http://www.hiveworkshop.com/resources_new/maps/4961/

Last edited:

#### Eleandor

Level 21
Wow... Hope you don't take any offence of this, but stuff's really screwed up in your triggers

I don't have heaps of time now, but I guess I could help you out (step by step), and I'm sure some others will help you as well.
1) Should I just make a list of stuff that goes wrong / could be improved and make you do it or
2) Fix the stuff myself? (well... I might do a little bit, but I'm not planning to redo the map )

To answer the most basic concerns: There's a sticky thread (on this forum I believe) called "Things that leak".
One of the things that leak are POINTs. A point is basically a location, for instance: Position of (UnitMove2).

In one of your triggers you have this:
• Unit - Move UnitKart1 instantly to (Position of UnitMove1), facing (Facing of UnitMove1) degrees
This leaks a point, namely Position of UnitMove1.
To fix it: create a Point variable in the variable editor (cntr + B)
then change the trigger into:
• Mytrigger
• Set MyPointVariable = Position of UnitMove1
• Unit - Move UnitKart1 instantly to MyPointVariable, facing (Facing of UnitMove1) degrees
• Custom script: call RemoveLocation(udg_MyPointVariable)
Then another thing: Many of your triggers are very inefficient. For instance: you have 8 triggers for the 8 karts. You could make this into 1 trigger using arrays and loops.

#### MightyBobBarker

Level 3
No offense taken, I appreciate the comments.

As for the helping, if you would, just fix one of each type of trigger that is obviously gui newb material, as each type of trigger has numerous clones, and I can fix the rest based on the one you give me.

For those that you don't have time or can't fix, I'd appreciate a list of what could be fixed--but if that's not possible, I fully understand.

As for the arrays and loops, I completely agree. I didn't discover what arrays actually were until halfway through making the map.

Again, I really appreciate the constructive criticism and was expecting the comments to be much more harsh. If you want to edit the map, I'll wait to fix the point leak until you upload an edited version. If you don't want to edit it anymore, I'll get to work on that and upload an updated version here.

Anyone else's comments are still appreciated--I want to make this map as amazing as possible, and the more input I get, the better grasp I can get on the severity of my newbacity.

#### Eleandor

Level 21
Is it bad if the map turns out expansion-only?

#### MightyBobBarker

Level 3
Not anymore.

Originally I had wanted to make it RoC compatible, but I realize that in order to fully optimize it, using TFT would be easier.

#### Eleandor

Level 21
Well... I'd like to help you, but saving the map as it is now takes AGES because of the insane amount of triggers... So I think it's better if I remove all triggers and do whatever you need to be done...

#### MightyBobBarker

Level 3
That sounds like a good plan.

Status
Not open for further replies.

Replies
25
Views
1K
Replies
20
Views
3K
Replies
48
Views
2K
Replies
5
Views
759
Replies
1
Views
636