dictionary key value issue

  • Thread starter Thread starter elfenliedtopfan2
  • Start date Start date
E

elfenliedtopfan2

Guest
ok so i have made a program that i am genrating a a dict to key value pairs and in this key value pairs they are enclosed in ""


so i used the escape \ but when i adds the key value pair it adds it in like this

oaZ37wh.png


this is the code i have currently


smgwep.Add("\"activate_mode\"", "\"hold\"");
smgwep.Add("\"activate_with_primed_delay\"", "\"0\"");
smgwep.Add("\"activatesSlam\"", "\"0\"");
smgwep.Add("\"activatesSlamAsMelee\"", "\"0\"");
smgwep.Add("\"activatesSlamAsPowerMelee\"", "\"0\"");
smgwep.Add("\"activatesSlamAsPowerMeleeLeft\"", "\"0\"");
smgwep.Add("\"acv_acog\"", "\"\"");
smgwep.Add("\"acv_damage\"", "\"\"");
smgwep.Add("\"acv_dualclip\"", "\"\"");
smgwep.Add("\"acv_dualoptic\"", "\"\"");
smgwep.Add("\"acv_dw\"", "\"\"");
smgwep.Add("\"acv_dynzoom\"", "\"\"");
smgwep.Add("\"acv_extbarrel\"", "\"\"");
smgwep.Add("\"acv_extclip\"", "\"\"");
smgwep.Add("\"acv_fastads\"", "\"\"");
smgwep.Add("\"acv_fastreload\"", "\"\"");
smgwep.Add("\"acv_fmj\"", "\"\"");
smgwep.Add("\"acv_gl\"", "\"\"");
smgwep.Add("\"acv_gmod0\"", "\"\"");
smgwep.Add("\"acv_gmod1\"", "\"\"");
smgwep.Add("\"acv_gmod2\"", "\"\"");
smgwep.Add("\"acv_gmod3\"", "\"\"");
smgwep.Add("\"acv_gmod4\"", "\"\"");
smgwep.Add("\"acv_gmod5\"", "\"\"");
smgwep.Add("\"acv_gmod6\"", "\"\"");
smgwep.Add("\"acv_gmod7\"", "\"\"");
smgwep.Add("\"acv_grip\"", "\"\"");
smgwep.Add("\"acv_holo\"", "\"\"");
smgwep.Add("\"acv_ir\"", "\"\"");
smgwep.Add("\"acv_is\"", "\"\"");
smgwep.Add("\"acv_mk\"", "\"\"");
smgwep.Add("\"acv_mms\"", "\"\"");
smgwep.Add("\"acv_none\"", "\"\"");

it saves out the the file ok puts in the quotes and format and all but the issue is the key names have the

"\"activate_mode\"" "\"hold\""

and i wanted to know is there a way to remove the "\" form the key name so i can search smgwep["activate_mode"]

and on the save out it still save it within the quotes


the save out function

public void saveout()
{
smgwep_class();
using (StreamWriter writer = new StreamWriter(@"C:\Users\elfenliedtopfan5\Desktop\pdw.gdt"))
{
writer.Write("{" + Environment.NewLine);
writer.WriteLine( smgwep["displayName"] + "(\"bulletweapon.gdf\")"); // "\"pdw57\"(\"bulletweapon.gdf\")"
writer.WriteLine( "}"+ Environment.NewLine);

foreach (var entry in smgwep)
writer.WriteLine(" {0} {1}", entry.Key, entry.Value);
}
}


thats how i want it to be but currently it tells me displayName does not exsist in dict witch is because it has all the "/ ect in frount of it

any help would be much appeicated

elfenliedtopfan5

Continue reading...
 
Back
Top