GTAMP.com

Grand Theft Auto Multiplayer
It is currently Wed Jun 26, 2019 5:41 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: zone problems
PostPosted: Sat May 26, 2012 4:26 pm 
Offline
Hitman

Joined: Sat May 19, 2012 6:12 pm
Posts: 108
Location: Holland, AKA The Netherlands
Well im stumped on this one... For some reason IS_CHAR_IN_ZONE(char, zonename) almost NEVER works, all it does is if called during an IF statement succesfully crashes the freaking game.
Its a redicuously weird or specific command, it gone and did the following stuff:
Only desired to function in a NOT statement after a non-NOT statement;
^ Failed to work once either of them where alone without eachother...
Was still uncooperative after putting in a intentional never-reached IF statement with this AND having both IF() and IF(NOT()) statements.

From what i gather that was all script specific. Below here's the zone-specific stuff:
It seems to HATE being in another zone and utterly refused to work as a local navigation zone instead of a regular navigation zone.

The only time it actually worked on me was calling IF(NOT(IS_CHAR_IN_ZONE(Player1, Slums))) while the actual zone Slums was navigagion, not sharing any space with other zones and bordering to some other zones.
Anyone care to figure out how the hell this command can be used to actually if people are INSIDE the zones instead of outside of them? Checking for characters by LOCATE is VERY shoddy and unreliable in larger zones...
So yeah, only thing that ever worked script-wise was this, if it helps:

Syntax: [ Download ] [ Hide ]
Using GTA2 Script Syntax Highlighting
IF ( ( As2_Pursuit = 0 ) AND ( As2_Progress = 1 ) )
IF(NOT(IS_CHAR_IN_ZONE (Player1 , Slums)))
As2_PursuitCar1 = CREATE_CAR (148.5, 239.5, 2.0) 21 90 STRATOS END
As2_PursuitGuy1 = CREATE_CHAR_INSIDE_CAR (As2_PursuitCar1) 22 FBI END//FBI likes to agressively pull its victim out of car and shoot
As2_PursuitCar2 = CREATE_CAR (156.5, 125.5, 2.0) 17 0 STRIPETB END
As2_PursuitGuy2 = CREATE_CHAR_INSIDE_CAR (As2_PursuitCar2) 22 FBI END//its victim while stunned. Ideal for a bulletproof car.
SET_FAVOURITE_MODEL(As2_PursuitGuy1, STRATOS)
SET_FAVOURITE_MODEL(As2_PursuitGuy2, STRIPETB)
GIVE_WEAPON(As2_PursuitGuy1, SHOTGUN)
GIVE_WEAPON(As2_PursuitGuy2, MACHINE_GUN)
SET_CHAR_THREAT_SEARCH (As2_PursuitGuy1, AREA_PLAYER_ONLY)
SET_CHAR_THREAT_REACTION (As2_PursuitGuy1, REACT_AS_NORMAL)
SET_CHAR_THREAT_SEARCH (As2_PursuitGuy2, AREA_PLAYER_ONLY)
SET_CHAR_THREAT_REACTION (As2_PursuitGuy2, REACT_AS_NORMAL)
SET_CHAR_DRIVE_AGGRESSION (As2_PursuitGuy1, ON)
SET_CHAR_DRIVE_AGGRESSION (As2_PursuitGuy2, ON)
SET_CHAR_OBJECTIVE (As2_PursuitGuy1, KILL_CHAR_ANY_MEANS, Player1)
DO_NOWT
SET_CHAR_OBJECTIVE (As2_PursuitGuy2, KILL_CHAR_ANY_MEANS, Player1)
SET As2_Pursuit = 1
DISPLAY_BRIEF_NOW (1020)//l!You've got two blokes on your tail trying to kill you, watch out!
ENDIF
ENDIF
Parsed in 0.020 seconds, using GeSHi 1.0.8.10


Top
 Profile  
 
PostPosted: Sat May 26, 2012 4:47 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1348
Location: GTAMP.com
IF ( IS_CHAR_IN_ZONE ( p1 , B22 ) )
DISPLAY_BRIEF_NOW ( 3124 )
ENDIF

That works without crashing on bil.gmp but maybe there is something weird with your zones or the zone doesn't exist.


Top
 Profile  
 
PostPosted: Sat May 26, 2012 6:04 pm 
Offline
User avatar

Joined: Sat Dec 26, 2009 11:53 pm
Posts: 1106
zone names can be tricky. they sometimes need a specific lengthj

_________________
yur sa'nok ngeyƤ


Top
 Profile  
 
PostPosted: Sat May 26, 2012 6:06 pm 
Offline
Hitman

Joined: Sat May 19, 2012 6:12 pm
Posts: 108
Location: Holland, AKA The Netherlands
Well i've tried using B01 while setting B01 to the name "Cargo Area" but even then it just refused to work, and crashed whenever loaded.
Used both Navigation Zones and Local Navigation Zones, with and without Information zones cooperaring with them, both covered and uncovered by bigger Navigation zones. It just flat out seems to refuse to work! Meh, maybe im missing something special the official maps use as zone structure...

Oh well i'll throw in the checking script if it helps any bit. Already checked potential causes of crashing but it only did when zone checking was involved.
Syntax: [ Download ] [ Hide ]
Using GTA2 Script Syntax Highlighting
IF(Rn3_SpottedCircle = 5)

CLEAR_ALL_BRIEFS()
//In the circle: Surround intruder.
IF(IS_CHAR_IN_ZONE (Player1, B01))
//IF((LOCATE_CHARACTER_ANY_MEANS(Player1, 227.5, 243.5, 4.0, 4.0, 3.0)) OR (LOCATE_CHARACTER_ANY_MEANS(Player1, 227.5, 243.5, 5.0, 4.0, 3.0)) )
//IF(LOCATE_CHARACTER_ANY_MEANS(Player1, 227.2, 243.2, 4.0, 4.0, 3.0))
SET Rn3_SpottedCircle = 1
DISPLAY_BRIEF_NOW(1081)//n!Intruder at the cargo area! Get into positions and send reinforcements!
SET Rn3_Countdown = 600//20 sec.
SET Rn3_CounterSetting = 1
SET_CHAR_OBJECTIVE(Rn3_Guard5, GOTO_AREA_ON_FOOT, 226.5, 242.5, 4.0)//Top-left
SET_CHAR_OBJECTIVE(Rn3_Guard6, GOTO_AREA_ON_FOOT, 231.5, 243.5, 4.0)//Top-Right
SET_CHAR_OBJECTIVE(Rn3_Guard7, GOTO_AREA_ON_FOOT, 228.5, 246.5, 4.0)//Bottom-Left
SET_CHAR_OBJECTIVE(Rn3_Guard8, GOTO_AREA_ON_FOOT, 231.5, 245.5, 4.0)//Bottom-Right
//ENDIF
ENDIF
//At circle entrance: Block entry.
IF(NOT(Rn3_SpottedCircle = 1))
IF((LOCATE_CHARACTER_ANY_MEANS(Player1, 233.5, 244.5, 3.0, 3.0, 3.0)) OR (LOCATE_CHARACTER_ANY_MEANS(Player1, 233.5, 244.5, 4.0, 3.0, 3.0)))
SET Rn3_SpottedCircle = 2
DISPLAY_BRIEF_NOW(1082)//n!Intruder spotted! Dont let him through!
MAKE_CHAR_DO_NOTHING(Rn3_Guard5)
MAKE_CHAR_DO_NOTHING(Rn3_Guard6)
MAKE_CHAR_DO_NOTHING(Rn3_Guard7)
MAKE_CHAR_DO_NOTHING(Rn3_Guard8)
SET_CHAR_OBJECTIVE(Rn3_Guard5, GOTO_AREA_ON_FOOT, 231.5, 244.5, 4.0)//Entrance
SET_CHAR_OBJECTIVE(Rn3_Guard6, GOTO_AREA_ON_FOOT, 231.5, 245.5, 4.0)//Same
SET_CHAR_OBJECTIVE(Rn3_Guard7, GOTO_AREA_ON_FOOT, 231.5, 246.5, 4.0)//Also
SET_CHAR_OBJECTIVE(Rn3_Guard8, GOTO_AREA_ON_FOOT, 228.5, 242.5, 4.0)//Guarding upper-exit path.
ENDIF
ENDIF
//If at neither location.
IF(NOT(Rn3_SpottedCircle = 1))
IF(NOT(Rn3_SpottedCircle = 2))
IF(NOT(LOCATE_CHARACTER_ANY_MEANS(Player1, 233.5, 244.5, 3.0, 3.0, 3.0)))
IF(NOT(LOCATE_CHARACTER_ANY_MEANS(Player1, 233.5, 244.5, 4.0, 3.0, 3.0)))
IF(NOT(LOCATE_CHARACTER_ANY_MEANS(Player1, 227.5, 243.5, 4.0, 4.0, 3.0)))
IF(NOT(LOCATE_CHARACTER_ANY_MEANS(Player1, 227.5, 243.5, 5.0, 4.0, 3.0)))
SET Rn3_SpottedCircle = 3
DISPLAY_BRIEF_NOW(1083)//n!Intruder in the area! Get him!
SET_CHAR_OBJECTIVE(Rn3_Guard5, KILL_CHAR_ON_FOOT, Player1)
SET_CHAR_OBJECTIVE(Rn3_Guard6, KILL_CHAR_ON_FOOT, Player1)
SET_CHAR_OBJECTIVE(Rn3_Guard7, KILL_CHAR_ON_FOOT, Player1)
SET_CHAR_OBJECTIVE(Rn3_Guard8, KILL_CHAR_ON_FOOT, Player1)
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
//---------------
//ENDIF
ENDIF
Parsed in 0.027 seconds, using GeSHi 1.0.8.10

If that doesnt work i wonder whats the secret to more accurate large-scale LOCATE_CHARACTER checking... Might as well mess with that some more in the meanwhile.

Edit: I've tried various names, Cargo_Area, cargoarea, Cargo. And Cargo uses the same amount of letters as Slums, the only working zone check i have in the whole damn map! Though that zone doesnt use a gtx file for name referencing.


Top
 Profile  
 
PostPosted: Sat May 26, 2012 6:37 pm 
Offline
User avatar

Joined: Wed Mar 17, 2010 4:07 am
Posts: 414
Location: Wales, UK
When using MAP_ZONE names you can't have a space in the name of it, and I don't think it will even compile. As you've probably seen, the script needs to have the same name as what is used in map editor zone itself.

_________________


Top
 Profile  
 
PostPosted: Sat May 26, 2012 7:25 pm 
Offline
Hitman

Joined: Sat May 19, 2012 6:12 pm
Posts: 108
Location: Holland, AKA The Netherlands
Well i know spaces in zone names dont work out too well, not if they're needed by script atleast. Stuff like bus stops or stoplights dont seem to care.
Speaking of the subject i think i found a way for it to work: I named it Cargobay using Elypter's suggestion of 8 characters (though less seems to work as well), messed around a bit and made it a normal Navigation Zone, gave it its own personal equally-sized Information zone with the exact same name and at the very least it takes it on IF(NOT()) statements. I have my doubts if it still works within a larger Navigation Zone, though.

Now just to fix a few (hopefully) non-zone-based scripting errors and the mission is compete...

Edit: Still works! This may be usefull to note on this list after some extensive testing, as its otherwise very tedious to find out on your own.
As far as i can gather, it needs a reasonable name without spaces, no idea if it cares about underscores (_'s) and needs an information zone with the exact same name as it covering it or being the exact same size. It worked for me as a Navigation Zone though it may also work as a Local Navigation Zone.

Hm, too bad the AI runs right through the middle section of the supposed 'circle' area instead of staying and waiting outside to flank around the corners while bad guys enter the area from a door below. Ah well GTA2's AI isnt perfect...


Top
 Profile  
 
PostPosted: Sat May 26, 2012 11:37 pm 
Offline

Joined: Sat May 16, 2009 6:14 am
Posts: 889
Location: London, UK
Please split support requests and general "WTF?" moments to a separate thread. This one is specifically for short, well-proven, definite cases of GTA2 doing something wrong or extremely weird.

A command not working the way you expect the first time you use it is totally normal. We'd have to get all your map files to analyse the situation in detail before this could even be considered GTA2 scripting weirdness.

_________________
GTA5 Race, DM & Capture | GTA2 Levels & Coding | GTA2 YouTube Videos
Gran Turismo 6 custom track club(Sign in with PSN details, then follow link again.)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group