Changing hmpl

O Ilusionista

Captain 100K
I have a code when I will manipulate "hmapl" and "hmapu" by script, to give more palettes to a player.
The code already work (as I can track using drawstings) but I can't find where I should activate it.

C-like:
changeentityproperty(self,"hmapl",mapLow);
    changeentityproperty(self,"hmapu",mapHigh);
(mapLow and mapHigh are variables got in other part of the coding and they are working)

I already tried:
- onspawnscript
- updatescript
- join1.c

and nothing works. Where I should need to apply this code to make it work?

Also, you can "get" and "change" entityproperty "hmap", but you can only "get" playerproperty "hmap" - if you try changing it, you get an exception warning.
Is the playerproperty a read only value?
 
I have a code when I will manipulate "hmapl" and "hmapu" by script, to give more palettes to a player.
The code already work (as I can track using drawstings) but I can't find where I should activate it.

C-like:
changeentityproperty(self,"hmapl",mapLow);
    changeentityproperty(self,"hmapu",mapHigh);
(mapLow and mapHigh are variables got in other part of the coding and they are working)

I already tried:
- onspawnscript
- updatescript
- join1.c

and nothing works. Where I should need to apply this code to make it work?

Also, you can "get" and "change" entityproperty "hmap", but you can only "get" playerproperty "hmap" - if you try changing it, you get an exception warning.
Is the playerproperty a read only value?


The trick is that hmap is not an entity property - let's add that to the reasons I hate the legacy get/changeentityproperty(). It's a model property. By the time you have an entity to reference, you've already picked the colors. What's worse, the get/changentityproperty() just changes the modeldata copied to that entity, not the base model. So it's a double dip issue. IOW, changentityproperty() will never do anything to hmap.

I don't know who added it to playerproperty or why, but all it's doing is getting the player's entity, then finding the model, then returning a value. There's no actual player property for hmap at all.

I think you can see the problem here. I fixed this in 4.0, but I haven't documented it yet because I am working on other model properties and I want them all done just in case I had to change a name or some such. Sorry man, I'll get it up soon as possible.

DC
 
It's a model property. By the time you have an entity to reference, you've already picked the colors.
ohhhhhh, that is bad :(

I think you can see the problem here. I fixed this in 4.0, but I haven't documented it yet because I am working on other model properties and I want them all done just in case I had to change a name or some such. Sorry man, I'll get it up soon as possible.
Not a problem, as I don't want to update to 4.0 now since the release is around the corner. But I will keep that in mind.
 
Back
Top Bottom