SuperRonanCraft
Member
So im currently trying to make a weapon that has default/global values, but then the weapon can also contain other special things such as custom step events and things of that nature. This is all stored in a ds_map with enum values associated as the keys. Now, I want to be able to copy the ENTIRE ds_map of the weapon, and also a seperate copy of the custom weapon map. So the map kinda looks like this.
```
var type = WEAPON.ROCKET;
var r_map = scRocketGetMap(type); //Returns a new map of the weapon
var map = ds_map_create();
map[? WEAPON_MAP.TYPE] = type;
map[? WEAPON_MAP.SPEED] = 5;
map[? WEAPON_MAP.MAP] = r_map;
weapon_map = map;
```
When a weapon spawns, it copies the "r_map" and deletes it. But it also deletes the original map of the player, which is the weapon_map variable.
Any idea how to copy over a map within a map?
```
var type = WEAPON.ROCKET;
var r_map = scRocketGetMap(type); //Returns a new map of the weapon
var map = ds_map_create();
map[? WEAPON_MAP.TYPE] = type;
map[? WEAPON_MAP.SPEED] = 5;
map[? WEAPON_MAP.MAP] = r_map;
weapon_map = map;
```
When a weapon spawns, it copies the "r_map" and deletes it. But it also deletes the original map of the player, which is the weapon_map variable.
Any idea how to copy over a map within a map?