Page 18 of 50

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Posted: 02 Aug 2010, 14:09
by T.M.
The script editor is fully functional now, i only need to add some buttons etc. to add/delete objects, and select multiple objects and move multiple objects properly. This will take a while. Also i am adding support for cranes etc.

Once i have consulted JernejL, i should be able to integrate the compiler directly in the editor.

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Posted: 02 Aug 2010, 15:03
by elypter
2) Avoid GTA2 crash:
(CRASH) Using not existing/wrong type zones in script

updating this if i find more

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Posted: 02 Aug 2010, 15:05
by elypter
general suggestion:
-allow restart zones only to be 1x1 since bigger zones don't have an effect.
-include the map name in the screenshot file name

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Posted: 02 Aug 2010, 16:12
by T.M.
Thanks for info. Also, I would like to see examples of those invalid script lines!
elypter wrote:general suggestion:
-allow restart zones only to be 1x1 since bigger zones don't have an effect.
-include the map name in the screenshot file name
1) Original maps have big restart zones, so i think they have some purpose. I dont know for sure, so i rather not touch this yet since it doesnt have any impact on the result since you can see where the player will spawn from that small dot it adds in middle of the zone.

2) Ah, yeah i guess the screenshot filename could be using the map name, but there is a bit problem when you havent loaded any maps yet. I will make it use the map name if its available, Also adds the random string in end of the mapname by default.

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Posted: 02 Aug 2010, 22:30
by Pyro
Larger restart zones means the player can respawn in any cube in the zone area. Example would be a 2x2 size zone the player could restart in any of the 4 cubes.

The main issues I have scripting is remembering to have enough brackets (an equal number of open brackets and close brackets must be present otherwise it throws a fit!), making sure I have all the parameters (some examples would be checking a player in an area, the game checks the initial location with its first X-Y-Z co-ords and then another X and Y for the width and height) and generally making sure things are in the right place.

An example of similar commands but different structure:

Code: Select all

CAR_DATA car01 = ( 123.5 , 123.5 , 2.0 ) 14 180 BUICK
The above creates a car at runtime.

Code: Select all

CAR_DATA car02
...
car02 = CREATE_CAR ( 123.5 , 123.5 , 2.0 ) 14 180 BUICK END
The above has a reserved slot for a car but only created when called for and must include the END at the end of it.

Sounds pretty simple I know, but there is also the use of using a Z level of 255.0 for the game to determine the height (puts it at the highest cube that is set to road/field/pavement), while other commands just need integers (and some even don't need a Z level at all).

If there's one suggestion/feature I'd like to see is colour-coded brackets (I think programs like Dreamweaver and Visual Studio do this). Different people code differently and so brackets might appear a little strange, like this:

Code: Select all

IF ( ( CHECK_CHAR_HEALTH ( p1 , 0 ) ) AND ( counter = 0 ) )
Above is one example...

Code: Select all

IF ( ( CHECK_CHAR_HEALTH ( p1 , 0 ) )
AND ( counter = 0 ) )
And that is the way I like doing it. Either way I'm sure folks would like something like that in it 8-)

Anything else for coding let me know and I'll try and help you.

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Posted: 03 Aug 2010, 11:27
by T.M.
Pyro wrote:Larger restart zones means the player can respawn in any cube in the zone area. Example would be a 2x2 size zone the player could restart in any of the 4 cubes.
Oh? How does it work, ive never seen it doing that myself.
Pyro wrote:Anything else for coding let me know and I'll try and help you.
Well, i would like to know how you have managed to make the compiler/gta2 crash with your scripts. And what kind of undocumented rules & odd behaviours the scripts have which you have encountered in your scripting history. Anything that you have had problems to make your scripts working as you intended.

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Posted: 03 Aug 2010, 14:41
by T.M.
While looking at some maps mis files, i found what you mean:

Code: Select all

IF ( ( ( ( ( NOT ( CHECK_CHARACTER_HEALTH ( player2 , 0 ) ) ) AND ( NOT ( CHECK_CHARACTER_HEALTH ( player3 , 0 ) ) ) ) AND ( NOT ( CHECK_CHARACTER_HEALTH ( player4 , 0 ) ) ) ) AND ( NOT ( CHECK_CHARACTER_HEALTH ( player5 , 0 ) ) ) ) AND ( NOT ( CHECK_CHARACTER_HEALTH ( player6 , 0 ) ) ) )
That is just crazy. Making multiple AND checks you have to nest them in pairs :?

What if we make our own syntax and a program that converts our syntax into .mis syntax before compiling? I've been thinking about it a long time now, we could even use arrays and for loops to reduce the script size (not compiled script size), which should make it much easier to read too.

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Posted: 03 Aug 2010, 15:55
by Pyro
TradeMark wrote:Oh? How does it work, ive never seen it doing that myself.
If the cube is occupied (car, another player, anything) it'll use the nearest cube that is empty. It's also quite useful for multiplayer too. Even with multiple restart points it can be useful!
TradeMark wrote:Well, i would like to know how you have managed to make the compiler/gta2 crash with your scripts. And what kind of undocumented rules & odd behaviours the scripts have which you have encountered in your scripting history. Anything that you have had problems to make your scripts working as you intended.
I've mentioned how most of my scripts cause errors etc - mainly due to missing brackets, bad spelling and things like that. Another one is, for example, telling the game to create a car that hasn't been declared before hand (script compiler error). Some actual game crashing scripts would include using illegal weapons (namely the 'microwave'), blowing up scripted wrecks (as you mentioned earlier - a wreck doesn't like being turned into a another wreck!), having a car type set to train (or any of its carriages), some things, like characters, will crash the game if they are spawned in odd places or on top of other characters/cars etc. Also, if I remember, when the game starts you can't have an object and a player in the same spot or it'll also crash the game.

Those are just a few things that come to mind for breaking the compiler or game!
TradeMark wrote:What if we make our own syntax and a program that converts our syntax into .mis syntax before compiling?
While that would be interesting, a lot of people are used to the original syntax (with slight variations on doing it, such as above with my example code) and I think adding a different syntax method and then converting it back seems a bit pointless and adds unnecessary complexity . As I mentioned in my last post, colour coded brackets for example will be beneficial to everyone (with an on/off toggle?). Also, like Delfi's compiler having the colour coded omitted lines (using // or /*....*/and then some note like most people do) is extremely useful!

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Posted: 03 Aug 2010, 16:18
by T.M.
Pyro wrote:If the cube is occupied (car, another player, anything) it'll use the nearest cube that is empty. It's also quite useful for multiplayer too. Even with multiple restart points it can be useful!
Ah, thanks!
Pyro wrote:I've mentioned how most of my scripts cause errors etc - mainly due to missing brackets, bad spelling and things like that. Another one is, for example, telling the game to create a car that hasn't been declared before hand (script compiler error). Some actual game crashing scripts would include using illegal weapons (namely the 'microwave'), blowing up scripted wrecks (as you mentioned earlier - a wreck doesn't like being turned into a another wreck!), having a car type set to train (or any of its carriages), some things, like characters, will crash the game if they are spawned in odd places or on top of other characters/cars etc. Also, if I remember, when the game starts you can't have an object and a player in the same spot or it'll also crash the game.
Nice, i added few more things in my list!
Pyro wrote:
TradeMark wrote:What if we make our own syntax and a program that converts our syntax into .mis syntax before compiling?
While that would be interesting, a lot of people are used to the original syntax (with slight variations on doing it, such as above with my example code) and I think adding a different syntax method and then converting it back seems a bit pointless and adds unnecessary complexity.
Um, i dont understand how the simplicity of a C syntax can add more complexity. And how would it make it harder to write code when you dont need to repeat the same code for each player by copy pasting? :roll: Also it will become much less prone to errors when you dont need to repeat the code yourself. Not to mention it will become faster to write scripts too, and easier to read them afterwards.

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Posted: 03 Aug 2010, 17:14
by elypter
The alternative syntax i definitely a good idea. I also think it is a great help.
personally i like the python syntax but i don't know how much can be implemented due to limitations of the script"interpreter" in gta (maybe there is more possible when going this way: alternative syntax -> compiled script than with alternative syntax -> .mis syntax -> compiled script).

But if the original syntax is preferred i suggest placeholders to avoid repetition

eg:

instead of:

while (WAHR = 1)

WHILE ( loop = 1 )
IF (CHECK_CHARACTER_HEALTH(p1, 0))
SET_CHAR_INVINCIBLE (p1, ON)
GIVE_WEAPON ( p1 , rocket_launcher, 99 )
GIVE_WEAPON ( p1 , molotov, 99 )
GIVE_WEAPON ( p1 , grenade, 99 )
ENDIF

IF (CHECK_CHARACTER_HEALTH(p2, 0))
SET_CHAR_INVINCIBLE (p2, ON)
GIVE_WEAPON ( p2 , rocket_launcher, 99 )
GIVE_WEAPON ( p2 , molotov, 99 )
GIVE_WEAPON ( p2 , grenade, 99 )
ENDIF

IF (CHECK_CHARACTER_HEALTH(p3, 0))
SET_CHAR_INVINCIBLE (p3, ON)
GIVE_WEAPON ( p3 , rocket_launcher, 99 )
GIVE_WEAPON ( p3 , molotov, 99 )
GIVE_WEAPON ( p3 , grenade, 99 )
ENDIF

IF (CHECK_CHARACTER_HEALTH(p4, 0))
SET_CHAR_INVINCIBLE (p4, ON)
GIVE_WEAPON ( p4 , rocket_launcher, 99 )
GIVE_WEAPON ( p4 , molotov, 99 )
GIVE_WEAPON ( p4 , grenade, 99 )
ENDIF

IF (CHECK_CHARACTER_HEALTH(p5, 0))
SET_CHAR_INVINCIBLE (p5, ON)
GIVE_WEAPON ( p5 , rocket_launcher, 99 )
GIVE_WEAPON ( p5 , molotov, 99 )
GIVE_WEAPON ( p5 , grenade, 99 )
ENDIF

IF (CHECK_CHARACTER_HEALTH(p6, 0))
SET_CHAR_INVINCIBLE (p6, ON)
GIVE_WEAPON ( p6 , rocket_launcher, 99 )
GIVE_WEAPON ( p6 , molotov, 99 )
GIVE_WEAPON ( p6 , grenade, 99 )
ENDIF

ENDWHILE
use:

while (WAHR = 1)

px:=p1,p2,p3,p4,p5,p6{
IF (CHECK_CHARACTER_HEALTH(px, 0))
SET_CHAR_INVINCIBLE (px, ON)
weapon:=rocket_launcher,molotov,grenade{
GIVE_WEAPON ( px , weapon, 99)
}
ENDIF
}
ENDWHILE
applying same things on coordinates in a row could be handled similar:

eg: to remove an area
//placeholder:=start-step-end
posx:=54.0-1.0-67.0{
posy:=59.0-1.0-63.0{
REMOVE_BLOCK ( posx , posy , 2.0 , DO_DROP )
}}

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Posted: 03 Aug 2010, 18:29
by T.M.
elypter wrote:while (WAHR = 1)

px:=p1,p2,p3,p4,p5,p6{
IF (CHECK_CHARACTER_HEALTH(px, 0))
SET_CHAR_INVINCIBLE (px, ON)
weapon:=rocket_launcher,molotov,grenade{
GIVE_WEAPON ( px , weapon, 99)
}
ENDIF
}
ENDWHILE
Clever, i like it, no need for arrays; they already are there! 8-)
Although the second loop is useless when it takes as many code lines as it would take to write three times GIVE_WEAPON. Anyways, i like it!

With proper code syntax coloring it will be easy to see the repetition parts.

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Posted: 03 Aug 2010, 20:51
by Pyro
Normal MIS code is extremely easy to read anyway. If people suddenly start typing in this new syntax and it saves to a MIS like that and someone else opens it without your zone editor they would be like "wtf is this code?". I have no issues with making life easier but GTA2 coding is pretty simple anyway - the only tricky things is correct usage of IF statements and what they contain to make more complex script functions work.

In short, a new syntax might be more useful for brand new people who are just starting to code with GTA2. For old-schooler's like myself the old way is just fine and also works fine. I probably have about 6+ years of experience of working with GTA2 code (from a few years back and now over the months I've remembered most of it and experimented with new code etc - just take a look at my Bootcamp map and the code I'm working on with Ben in Jailbreak are very good examples) and never really has an issue with the way the coding works. As they say, "if it aint broke, don't fix it", a rather appropriate phrase here. In fact, the only thing I'd like added is new commands for the script to affect the game but that's not possible (yet - maybe in future Vike might use his magic for this!).

In fact, instead of doing things like making new syntax for an in-built compiler maybe get a map editor working first :P

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Posted: 03 Aug 2010, 21:55
by T.M.
Pyro wrote:Normal MIS code is extremely easy to read anyway.
I wouldnt say 'extremely' :lol: Compared to any other coding language, MISS is a MESS! Hell, even QuickBasic can handle AND statements without need to nest them into pairs. it even supports FOR loops and arrays! Whereas MISS doesnt.
Pyro wrote:If people suddenly start typing in this new syntax and it saves to a MIS like that and someone else opens it without your zone editor they would be like "wtf is this code?".
Theres simple fix for that: not using .mis extension, could be .mi2 etc.
Pyro wrote:In short, a new syntax might be more useful for brand new people who are just starting to code with GTA2.
Yes, i am making the editor for brand new people. I have no intention to get stuck in the old (bad) methods you guys have got used to ;)
Pyro wrote:In fact, instead of doing things like making new syntax for an in-built compiler maybe get a map editor working first :P
Yeah, making new syntax is in the bottom of my priority list, of course!


--

Also, consider this extremely easy to read?

Code: Select all

IF (CHECK_CHARACTER_HEALTH(p1, 0))
SET_CHAR_INVINCIBLE (p1, ON)
GIVE_WEAPON ( p1 , rocket_launcher, 99 )
GIVE_WEAPON ( p1 , molotov, 99 )
GIVE_WEAPON ( p1 , grenade, 99 )
ENDIF

IF (CHECK_CHARACTER_HEALTH(p2, 0)) 
SET_CHAR_INVINCIBLE (p2, ON)
GIVE_WEAPON ( p2 , rocket_launcher, 99 )
GIVE_WEAPON ( p2 , molotov, 99 )
GIVE_WEAPON ( p2 , grenade, 99 )
ENDIF

IF (CHECK_CHARACTER_HEALTH(p3, 0)) 
SET_CHAR_INVINCIBLE (p3, ON)
GIVE_WEAPON ( p3 , rocket_launcher, 99 )
GIVE_WEAPON ( p3 , pistol, 99 )
GIVE_WEAPON ( p3 , grenade, 99 )
ENDIF

IF (CHECK_CHARACTER_HEALTH(p4, 0)) 
SET_CHAR_INVINCIBLE (p4, ON)
GIVE_WEAPON ( p4 , rocket_launcher, 99 )
GIVE_WEAPON ( p4 , molotov, 99 )
GIVE_WEAPON ( p4 , grenade, 99 )
ENDIF

IF (CHECK_CHARACTER_HEALTH(p5, 0)) 
SET_CHAR_INVINCIBLE (p5, ON)
GIVE_WEAPON ( p5 , rocket_launcher, 99 )
GIVE_WEAPON ( p5 , molotov, 99 )
GIVE_WEAPON ( p5 , grenade, 99 )
ENDIF

IF (CHECK_CHARACTER_HEALTH(p6, 0)) 
SET_CHAR_INVINCIBLE (p6, ON)
GIVE_WEAPON ( p6 , rocket_launcher, 99 )
GIVE_WEAPON ( p6 , molotov, 99 )
GIVE_WEAPON ( p6 , grenade, 99 )
ENDIF
That gives rocket_launcher, molotov and grenade to all alive players? WRONG! One player gets pistol instead! :lol:

I've seen such codes actually, theres just one difference in one of the repetitive blocks of codes. And that is really hard to keep track & understand what your code is doing when the size of the simple functions is over 100 lines long.

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Posted: 04 Aug 2010, 10:51
by Pyro
TradeMark wrote:I wouldnt say 'extremely' :lol: Compared to any other coding language, MISS is a MESS! Hell, even QuickBasic can handle AND statements without need to nest them into pairs. it even supports FOR loops and arrays! Whereas MISS doesnt.
The coding language of MIS IS simple though, and since when is it a mess? If the person can't be bothered to try and arrange it in some order then it's there problem. The fact is it was designed for in-house (and god knows how old it is - fairly old) and we, the public/modders were lucky to get our hands on it anyway! I agree at times the coding can be annoying but compared to things like Java, C++, some PHP (which I've done) it is still very easy to type and read.
TradeMark wrote:Theres simple fix for that: not using .mis extension, could be .mi2 etc.
Again this goes back to viewing two different MIS types. A person who doesn't know the new one will wonder what it is and how the hell it even compiles. Then you could say it would save as both MIS and MI2 which is even more pointless.
TradeMark wrote:Yes, i am making the editor for brand new people. I have no intention to get stuck in the old (bad) methods you guys have got used to ;)
Why is the original syntax "bad"? Just because it doesn't have the functionality of newer programming languages doesn't make it bad. As I've said above, it was designed in-house for a specific reason. And again, like above, better for brand new people and bad for existing users.
TradeMark wrote:Yeah, making new syntax is in the bottom of my priority list, of course!
Good to know.
TradeMark wrote:Also, consider this extremely easy to read?
...
That gives rocket_launcher, molotov and grenade to all alive players? WRONG! One player gets pistol instead! :lol:
I'm not sure what point you are trying to make here. If the person coding something like this had put PISTOL in then it would seem it was on purpose? In this case that would have been a deliberate mistake.
TradeMark wrote:I've seen such codes actually, theres just one difference in one of the repetitive blocks of codes. And that is really hard to keep track & understand what your code is doing when the size of the simple functions is over 100 lines long.
I have yet to see a function scripted that is over 100 lines long. If you're on about same code for six players then it is split six times. Then if you're going on about checking for a player to do something and the result is massive changes to the game/map (such as spawning new cars, new characters, giving characters weapons etc, modifying map in game etc) which results in a lot of lines of codeand then done between six players you wouldn't put the same, massive code for each player. You'd use a GOSUB for each player to refer to it. The code itself is powerful enough for what it was designed to do and, depending on the scripter, is completely modular.

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Posted: 04 Aug 2010, 11:16
by T.M.
108 lines:

Code: Select all

   nudebomber1 = CREATE_CHAR ( 95.5, 89.5 , 6.0 ) 26 180 CRIMINAL_TYPE2 END  //  SPAWN FOUNTAINBOT
   SET_CHAR_GRAPHIC_TYPE ( nudebomber1 , DUMMY_GRAPHIC , 26 )  //  CHANGE GRAPHIC TYPES OF REMAP FROM GANGLIKE TO PEDLIKE - TRUE NUDES WITHOUT GEAR
   GIVE_WEAPON ( nudebomber1 , ROCKET_LAUNCHER )  //  ARM WITH WEAPON
   SET_CHAR_BRAVERY_LEVEL ( nudebomber1 , LOONY )  //  SET BRAVERY LEVEL
   SET_CHAR_SHOOTING_SKILL ( nudebomber1 , CRACK_SHOT )  //  SET SKILL LEVEL
   SET_CHAR_THREAT_REACTION ( nudebomber1 , NO_REACTION )  // SET REACT LEVEL
   SET_CHAR_INVINCIBLE ( nudebomber1 , ON )  // SET INVINCIBLE
   SET_FAVOURITE_MODEL  ( nudebomber1 , GUNJEEP )  // SET FAVOURITE CAR
   SET_CHAR_TO_USE_CAR_WEAPON  ( nudebomber1 , ON )  //  USE CAR WEAPON
   
   nudebomber2 = CREATE_CHAR ( 118.5 , 89.5 , 6.0 ) 26 180 CRIMINAL_TYPE2 END
   SET_CHAR_GRAPHIC_TYPE ( nudebomber2 , DUMMY_GRAPHIC , 26 )
   GIVE_WEAPON ( nudebomber2 , ROCKET_LAUNCHER )
   SET_CHAR_BRAVERY_LEVEL ( nudebomber2 , LOONY )
   SET_CHAR_SHOOTING_SKILL ( nudebomber2 , CRACK_SHOT )
   SET_CHAR_THREAT_REACTION ( nudebomber2 , NO_REACTION )   
   SET_CHAR_INVINCIBLE ( nudebomber2 , ON )
   SET_FAVOURITE_MODEL  ( nudebomber2 , GUNJEEP )
   SET_CHAR_TO_USE_CAR_WEAPON  ( nudebomber2 , ON )

   nudebomber3 = CREATE_CHAR ( 144.5 , 89.5 , 6.0 ) 26 180 CRIMINAL_TYPE2 END
   SET_CHAR_GRAPHIC_TYPE ( nudebomber3 , DUMMY_GRAPHIC , 26 )
   GIVE_WEAPON ( nudebomber3 , ROCKET_LAUNCHER )
   SET_CHAR_BRAVERY_LEVEL ( nudebomber3 , LOONY )
   SET_CHAR_SHOOTING_SKILL ( nudebomber3 , CRACK_SHOT )
   SET_CHAR_THREAT_REACTION ( nudebomber3 , NO_REACTION )   
   SET_CHAR_INVINCIBLE ( nudebomber3 , ON )
   SET_FAVOURITE_MODEL  ( nudebomber3 , GUNJEEP )
   SET_CHAR_TO_USE_CAR_WEAPON  ( nudebomber3 , ON )

   nudebomber4 = CREATE_CHAR ( 167.5 , 89.5 , 6.0 ) 26 180 CRIMINAL_TYPE2 END
   SET_CHAR_GRAPHIC_TYPE ( nudebomber4 , DUMMY_GRAPHIC , 26 )
   GIVE_WEAPON ( nudebomber4 , ROCKET_LAUNCHER )
   SET_CHAR_BRAVERY_LEVEL ( nudebomber4 , LOONY )
   SET_CHAR_SHOOTING_SKILL ( nudebomber4 , CRACK_SHOT )
   SET_CHAR_THREAT_REACTION ( nudebomber4 , NO_REACTION )   
   SET_CHAR_INVINCIBLE ( nudebomber4 , ON )
   SET_FAVOURITE_MODEL  ( nudebomber4 , GUNJEEP )
   SET_CHAR_TO_USE_CAR_WEAPON  ( nudebomber4 , ON )

   nudebomber5 = CREATE_CHAR ( 167.5 , 116.5 , 3.0 ) 26 180 CRIMINAL_TYPE2 END
   SET_CHAR_GRAPHIC_TYPE ( nudebomber5 , DUMMY_GRAPHIC , 26 )
   GIVE_WEAPON ( nudebomber5 , ROCKET_LAUNCHER )
   SET_CHAR_BRAVERY_LEVEL ( nudebomber5 , LOONY )
   SET_CHAR_SHOOTING_SKILL ( nudebomber5 , CRACK_SHOT )
   SET_CHAR_THREAT_REACTION ( nudebomber5 , NO_REACTION )   
   SET_CHAR_INVINCIBLE ( nudebomber5 , ON )
   SET_FAVOURITE_MODEL  ( nudebomber5 , GUNJEEP )
   SET_CHAR_TO_USE_CAR_WEAPON  ( nudebomber5 , ON )

   nudebomber6 = CREATE_CHAR ( 167.5 , 146.5 , 3.0 ) 26 180 CRIMINAL_TYPE2 END
   SET_CHAR_GRAPHIC_TYPE ( nudebomber6 , DUMMY_GRAPHIC , 26 )
   GIVE_WEAPON ( nudebomber6 , ROCKET_LAUNCHER )
   SET_CHAR_BRAVERY_LEVEL ( nudebomber6 , LOONY )
   SET_CHAR_SHOOTING_SKILL ( nudebomber6 , CRACK_SHOT )
   SET_CHAR_THREAT_REACTION ( nudebomber6 , NO_REACTION )   
   SET_CHAR_INVINCIBLE ( nudebomber6 , ON )
   SET_FAVOURITE_MODEL  ( nudebomber6 , GUNJEEP )
   SET_CHAR_TO_USE_CAR_WEAPON  ( nudebomber6 , ON )

   nudebomber7 = CREATE_CHAR ( 167.5 , 173.5 , 6.0 ) 26 180 CRIMINAL_TYPE2 END
   SET_CHAR_GRAPHIC_TYPE ( nudebomber7 , DUMMY_GRAPHIC , 26 )
   GIVE_WEAPON ( nudebomber7 , ROCKET_LAUNCHER )
   SET_CHAR_BRAVERY_LEVEL ( nudebomber7 , LOONY )
   SET_CHAR_SHOOTING_SKILL ( nudebomber7 , CRACK_SHOT )
   SET_CHAR_THREAT_REACTION ( nudebomber7 , NO_REACTION )   
   SET_CHAR_INVINCIBLE ( nudebomber7 , ON )
   SET_FAVOURITE_MODEL  ( nudebomber7 , GUNJEEP )
   SET_CHAR_TO_USE_CAR_WEAPON  ( nudebomber7 , ON )

   nudebomber8 = CREATE_CHAR ( 144.5 , 173.5 , 6.0 ) 26 180 CRIMINAL_TYPE2 END
   SET_CHAR_GRAPHIC_TYPE ( nudebomber8 , DUMMY_GRAPHIC , 26 )
   GIVE_WEAPON ( nudebomber8 , ROCKET_LAUNCHER )
   SET_CHAR_BRAVERY_LEVEL ( nudebomber8 , LOONY )
   SET_CHAR_SHOOTING_SKILL ( nudebomber8 , CRACK_SHOT )
   SET_CHAR_THREAT_REACTION ( nudebomber8 , NO_REACTION )   
   SET_CHAR_INVINCIBLE ( nudebomber8 , ON )
   SET_FAVOURITE_MODEL  ( nudebomber8 , GUNJEEP )
   SET_CHAR_TO_USE_CAR_WEAPON  ( nudebomber8 , ON )

   nudebomber9 = CREATE_CHAR ( 118.5 , 173.5 , 6.0 ) 26 180 CRIMINAL_TYPE2 END
   SET_CHAR_GRAPHIC_TYPE ( nudebomber9 , DUMMY_GRAPHIC , 26 )
   GIVE_WEAPON ( nudebomber9 , ROCKET_LAUNCHER )
   SET_CHAR_BRAVERY_LEVEL ( nudebomber9 , LOONY )
   SET_CHAR_SHOOTING_SKILL ( nudebomber9 , CRACK_SHOT )
   SET_CHAR_THREAT_REACTION ( nudebomber9 , NO_REACTION )   
   SET_CHAR_INVINCIBLE ( nudebomber9 , ON )
   SET_FAVOURITE_MODEL  ( nudebomber9 , GUNJEEP )
   SET_CHAR_TO_USE_CAR_WEAPON  ( nudebomber9 , ON )

   nudebomber10 = CREATE_CHAR ( 95.5 , 173.5 , 6.0 ) 26 180 CRIMINAL_TYPE2 END
   SET_CHAR_GRAPHIC_TYPE ( nudebomber10 , DUMMY_GRAPHIC , 26 )
   GIVE_WEAPON ( nudebomber10 , ROCKET_LAUNCHER )
   SET_CHAR_BRAVERY_LEVEL ( nudebomber10 , LOONY )
   SET_CHAR_SHOOTING_SKILL ( nudebomber10 , CRACK_SHOT )
   SET_CHAR_THREAT_REACTION ( nudebomber10 , NO_REACTION )   
   SET_CHAR_INVINCIBLE ( nudebomber10 , ON )
   SET_FAVOURITE_MODEL  ( nudebomber10 , GUNJEEP )
   SET_CHAR_TO_USE_CAR_WEAPON  ( nudebomber10 , ON )

   nudebomber11 = CREATE_CHAR ( 95.5 , 146.5 , 3.0 ) 26 180 CRIMINAL_TYPE2 END
   SET_CHAR_GRAPHIC_TYPE ( nudebomber11 , DUMMY_GRAPHIC , 26 )
   GIVE_WEAPON ( nudebomber11 , ROCKET_LAUNCHER )
   SET_CHAR_BRAVERY_LEVEL ( nudebomber11 , LOONY )
   SET_CHAR_SHOOTING_SKILL ( nudebomber11 , CRACK_SHOT )
   SET_CHAR_THREAT_REACTION ( nudebomber11 , NO_REACTION )   
   SET_CHAR_INVINCIBLE ( nudebomber11 , ON )
   SET_FAVOURITE_MODEL  ( nudebomber11 , GUNJEEP )
   SET_CHAR_TO_USE_CAR_WEAPON  ( nudebomber11 , ON )

   nudebomber12 = CREATE_CHAR ( 95.5 , 116.5 , 3.0 ) 26 180 CRIMINAL_TYPE2 END
   SET_CHAR_GRAPHIC_TYPE ( nudebomber12 , DUMMY_GRAPHIC , 26 )
   GIVE_WEAPON ( nudebomber12 , ROCKET_LAUNCHER )
   SET_CHAR_BRAVERY_LEVEL ( nudebomber12 , LOONY )
   SET_CHAR_SHOOTING_SKILL ( nudebomber12 , CRACK_SHOT )
   SET_CHAR_THREAT_REACTION ( nudebomber12 , NO_REACTION )   
   SET_CHAR_INVINCIBLE ( nudebomber12 , ON )
   SET_FAVOURITE_MODEL  ( nudebomber12 , GUNJEEP )
   SET_CHAR_TO_USE_CAR_WEAPON  ( nudebomber12 , ON )
How will you do that any shorter?

How do you know what does it do? You simply have to read through 108 lines of the code and comparing each line to 11 other lines to see if they differ.

Just look at DAFE's death valley, its full of that kind of nasty repetition.

If you want to modify the code, you have to repeat your modifications 6-12 times! And be super sure that you wont make mistake.

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Posted: 04 Aug 2010, 11:30
by Sektor
You can have many bots with much less code but there are some limitations. They need to start in the same location (unless you add 1 line for each bot to change location based on bot count) and you can't do checks on each of them such as seeing if only one of them died. It might still be suitable for DDV.

Create 16 bots using a counter in a loop.

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Posted: 04 Aug 2010, 12:31
by T.M.
Clever! I forgot such things can be done at all in MIS files! But still it doesnt solve all the problems here. :(

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Posted: 04 Aug 2010, 13:12
by Pyro
Sektor beat me to it!

Not only can you do it that way you can also use a DO... WHILE loop, but then things start to get a bit mad with characters using the same name. Having them separate gives good control over each of them though. Mistakes are inevitable though, but a good person testing it will pick it up right away, and besides, people usually put annotations above code for what it does.

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Posted: 05 Aug 2010, 22:16
by elypter
I don't know if you already read the thread about the .mmp file standard:
http://gtamp.com/forum/viewtopic.php?f=4&t=188
I think it is essential that the standard will be adjusted to the needs of your editor. So if you are planning some features that might require entries in the .mmp it would be best if to suggest them now, even if some features aren't implemented later on.

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Posted: 05 Aug 2010, 22:46
by T.M.
Looks good, i cant think of anything more to add.

Except the MMP files cant have commented lines? and IMO theres no need for it.

How does GTA2 go with those extended MMP files? Does it read it ok? (i dont mean reading the extra data, but not crash or etc: i wouldnt be surprised if there is some line size limits like 256 bytes each line etc.)

I will implement those playable/visible regions in my editor next version: it will not render any blocks outside of that region, and will make the default map image rectangle to that visible area.