nedal 0 Posted February 14, 2004 hi have a random script wich shoses onestart point (startpoints are gamelogic markers) now i want a message wich says wich marker is shoosen. i want the name of the marker (name filed) in the message. have no idiea how to make it is there something like getname <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> StartingLocation = startingLocations Select Random _totalLocations; PublicVariable "StartingLocation" #Placepos _destination = GetPos StartingLocation _ort = name StartingLocation S1 SetPos _destination S2 SetPos _destination #messages player sidechat(format["%1",_ort]) but instead if getting in the message the text in the name field of the marker, il get "Milos Bratrunek" and that just does not exists in any of my scripts lol i am confused Share this post Link to post Share on other sites
BraTTy 0 Posted February 14, 2004 From the comref: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> name object Operand types: object: Object Type of returned value: String Description: Name of variable assigned to object in mission editor. In used on vehicle, name of first crew member (in order commander, driver, gunner). Example: name vehicle player Share this post Link to post Share on other sites
nedal 0 Posted February 14, 2004 i have a few start position markers (gamelogic flags) here is one of them in the name field: Morton in the init field : [this] exec "initstartinglocation.sqs" then i have the initstartinglocation.sqs script this script counts the total numbers of starting markers (startingLocations) <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ? !(Local LocalServerObject):Exit _location = _this Select 0 ;The first town to be set should call this so the arrays are declared. ? !(startedLocationsInit):goto "InitStartingLocations" #AddLocation startingLocations = startingLocations + [_location] Exit #InitStartingLocations startedLocationsInit = true startingLocations = [_location] then i have a second script PlaceSides.sqs in wich is first randomly selectet one of the starting location and then moved the soldiers S1+S2 to the location <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ? !(Local LocalServerObject):Exit _totalLocations = Count startingLocations StartingLocation = startingLocations Select Random _totalLocations;PublicVariable "StartingLocation" #soldier move _destination = GetPos StartingLocation S1 SetPos _destination S2 SetPos _destination #town message _ort = name _location player sidechat(format["start in","_ort"]) everything works except the town message the message should bring up morton or wich ever name from the choosen marker i am confused Share this post Link to post Share on other sites
nedal 0 Posted February 16, 2004 no one knows the answer? Is there a posibility to refere or better get the name of a gamelogic in a script? the position of the gamelogic i can get with the getpos/setpos command, but is there a way to get the name (name Field) of a gamelogic? Share this post Link to post Share on other sites
vektorboson 8 Posted February 16, 2004 If you have a Logic that is called "Morton" (in the name field), then you have to check: ? _logic == Morton : hint "Logic is Morton"; You have to manually check every Object and Logic, there is no other way. Share this post Link to post Share on other sites
nedal 0 Posted February 16, 2004 i have tried this: in PlaceSides.sqs ? _location == SaintPierre : ortmsg =  SaintPierre; PublicVariable "ortmsg"; (i tried also _Startinglocation instead of _location) trigger: Funkcall Beta: (0-0-2) hint format ["start in",ortmsg] It does not work, the Variable ortmsg stays empty  here is my mission file Share this post Link to post Share on other sites
Bart.Jan 0 Posted February 16, 2004 There is one way. You can give identity to each gamelogic unit. Then you do not need to name these but you must set their identities. Init line of GL: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this setIdentity "morton"; [this] exec "initstartinglocation.sqs" the other one: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this setIdentity "pierre"; [this] exec "initstartinglocation.sqs" and declaration in description.ext: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgIdentities { class morton {name = "Morton"; face = "";glasses = ""; speaker = ""; pitch = 0;}; class pierre {name = "Saint Pierre"; face = "";glasses = ""; speaker = ""; pitch = 0;}; };tested And you can use your original script. --- ? _location == SaintPierre : ortmsg = Â SaintPierre; PublicVariable "ortmsg";hint format ["start in",ortmsg] It should be <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">? _location == SaintPierre : ortmsg = Â "Saint Pierre"; PublicVariable "ortmsg"; hint format ["start in %1",ortmsg] Share this post Link to post Share on other sites
nedal 0 Posted February 16, 2004 you mean i can leave all like it is and just use hint format ["start in %1",ortmsg] ?? but then i  get scalar bol......error what does %1 exactly mean? or do you mean i must use this setIdentity "pierre"; [this] exec "initstartinglocation.sqs" and mod. description.ext  ? i made all you said, including the description.ext modifactions but i stil get scalar bol....aray string error here is the new mission file Share this post Link to post Share on other sites
Bart.Jan 0 Posted February 17, 2004 i made all you said, including the description.ext modifactionsbut i stil get scalar bol....aray string  error here is the new mission file There are only two mistakes: - you have no condition in radio Bravo trigger (it must be this) - the important one in placesides.sqs inside message section: you have <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">? _location == ... and it must be <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">? StartingLocation == ... and then it works. You have two choices now: 1) delete <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this setIdentity "..." from gamelogic init lines and delete CfgIdentities class from description.ext. Then you can even change message section of placesides.sqs into: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#message ? StartingLocation == SaintPierre : ortmsg =  "SaintPierre" ... ? StartingLocation == SaintPhillippe : ortmsg =  "SaintPhillippe" PublicVariable "ortmsg" or 2) let description.ext and gamelogic init lines be as they are now and change message section of placesides.sqs to: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#message ortmsg=name StartingLocation publicVariable "ortmsg" And than you can unname gamelogics in editor. --- Quote[/b] ]hint format ["start in %1",ortmsg]what does %1 exactly mean? It's substitution for content of ortmsg exaple: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_a="you" _b="I" hint format["%2 see %1.",_a,_b]and the result is "I see you." <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">hint format["%1 see %2.",_b,_a]returns the same result. Share this post Link to post Share on other sites
nedal 0 Posted February 17, 2004 Thank you 2450982457 times Bart.Jan you Did solve my problem perfect m8 now i just have to place: hint format ["start in %1",ortmsg] in to the intro instead of the Funk B Trigger and the random System is basicly finished ))))))) Share this post Link to post Share on other sites
nedal 0 Posted February 17, 2004 i was to fast with being happy i testet it now on server, and there it does not work i tried 2 versions ? StartingLocation == SaintPhillippe : ortmsg = "SaintPhillippe" PublicVariable "ortmsg" in PlaceSides.sqs and place sides is just running on server Does not work and i tried it also in Placespawn.sqs wich is running local Does not work to i am confused it does work with both versions if i start the game from the editor but not on server new mission File Share this post Link to post Share on other sites
nedal 0 Posted February 19, 2004 anyone got an idea why it does not work on server if it does work when the map is startet from the editor? hint format ["start in %1",ortmsg] Share this post Link to post Share on other sites
Harkonin 0 Posted February 20, 2004 Try the CTI forum since thats where the scripts from. Share this post Link to post Share on other sites
nedal 0 Posted February 20, 2004 the script with the message does not exist in cti and i am not making a cti map Share this post Link to post Share on other sites
Bart.Jan 0 Posted February 21, 2004 anyone got an idea why it does not work on server if it does work when the map is startet from the editor?hint format ["start in %1",ortmsg] publicVariable command can transfer only these variable types: Number, Boolean, Object, Group. This topic can help you too: Server and client, Understanding their relationship So 1) You must use my way with identities 2) change placesides.sqs: at the begining change <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">? !(Local LocalServerObject):exit ~1to<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">~1 ortmsg=objNull ? !(Local LocalServerObject):goto "wait" and message section to: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#message ortmsg=StartingLocation publicVariable "ortmsg" #wait @!isNull ortmsg cutText [format["Starting location: %1",name ortmsg],"plain down"]tested Edit: Well there is another way without identities: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">~1 ortmsg=-1 ? !(Local LocalServerObject):goto "wait" <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#message ? StartingLocation == SaintPierre : ortmsg = 0 ? StartingLocation == B... Â Â Â Â Â : ortmsg = 1 ? ... Â Â Â Â Â Â Â Â Â Â Â Â Â C... Â Â Â Â Â : ortmsg = 2 ... ? StartingLocation == SaintPhillippe : ortmsg = X PublicVariable "ortmsg" #wait @ortmsg>-1 ortmsg=["Saint Pierre","B...","C...", ... ,"Saint Phillippe"] select ortmsg cutText [format["Starting location: %1",ortmsg],"plain down"]tested Share this post Link to post Share on other sites
nedal 0 Posted February 21, 2004 it seems the thing i want is impossible lol at least for a noob like me @isNull>-1 makes me an error, unvalid number null[#] new mission file here i am confused Share this post Link to post Share on other sites
Bart.Jan 0 Posted February 21, 2004 @isNull>-1 Â makes me an error, unvalid number null[#] Oops. It must be <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">@ortmsg>-1 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#wait @ortmsg>-1 ortmsg=["Saint Pierre","Morton","Provins","Lamentin","Monignac","Gravette","Meaux","Saint Phillippe"] select ortmsg cutText [format["Starting location: %1",ortmsg],"plain down"] ~2 safezonemsg1 = true;PublicVariable "safezonemsg1"tested Share this post Link to post Share on other sites
nedal 0 Posted February 21, 2004 ( Â Â i m stil getting an error (div / 0) and if i remove the the ortmsg=-1 and the @ortmsg>-1 it works in editor, but i get an scalar bol error in dedicatet server new mission file Share this post Link to post Share on other sites
Bart.Jan 0 Posted February 22, 2004 ( Â Â i m stil getting an error (div / 0)and if i remove the the ortmsg=-1 Â and the @ortmsg>-1 it works in editor, but i get an scalar bol error in dedicatet server new mission file You have: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#wait ortmsg=["SaintPierre",...] @ortmsg>-1 ...It must be:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#wait @ortmsg>-1 ortmsg=["Saint Pierre",...] ... Share this post Link to post Share on other sites
nedal 0 Posted February 22, 2004 last night i have tried both, #wait ortmsg=["SaintPierre",...] @ortmsg>-1 and #wait @ortmsg>-1 ortmsg=["Saint Pierre",...] but on both versions i got error (div / 0) then i removed @ortsmsg like i said, and got error just on server perhaps i was just to tired, worked 12,5 hours yesterday, and today i have to work again 12,5 hours (got up at 05:40 and wil be back home at 19:40 uhhhrrff horror lol) i hate weekend shift Share this post Link to post Share on other sites
nedal 0 Posted February 23, 2004    Problem solved !!!! Youre just great Mister Script Good Bart.Jan!!!! Thank you sooooo much   I will make a spezial remark for You in the script !!!!! And if i ever play with you a CTI il give you all my money (this Map template will be used for czl 1v1 DM maps)  Share this post Link to post Share on other sites