MODULE: Properties v3.12 - Updated 06 October 2008

Started by monkey0506, Tue 11/07/2006 06:14:30

Previous topic - Next topic

Khris

The fact that you left MaxProperties set to 1 filled me with unfathomable rage.

Calin Leafshade

I bet it's because no one appreciates him and because he hates CJ.

HandsFree

I'm afraid I need help with this too.
In global script I have
Code: ags

function game_start() {   
  Properties.Create("testproperty", 1);
}


Then in a room script
Code: ags

function hCurtain_Look()
{
  int i = hCurtain.GetCustomProperty("testproperty");
  Display("The testproperty is %d.", i);
  cEgo.Say("Strange place for a curtain.");
  hCurtain.SetCustomProperty("testproperty", 2);
}  


When I look at the curtain it says "The testproperty is 1". But when I look a second time I expect the property to be 2, but it's still 1.
What am I doing wrong?

The maxproperties was still 1 BTW but I set it to 10. 

monkey0506

Seeing as it's been 5 years since I wrote this code, it wouldn't surprise me if none of it even worked. I'm a terrible coder. (laugh) You don't appear to be doing anything wrong. If I get a chance I'll see if I can look through the source and make any sense of it.

HandsFree

Thanks, I hope you/we/I can get it working cause this is one module that's really very useful to me. I'm using 3.2.1. btw.
Are there plans to incorporate this in a future AGS version?

monkey0506

There have been some builds that allow editable runtime properties that would deprecate this module. I'm not certain if that's been incorporated into the 3.3.0 betas or not.

Crimson Wizard

#26
Quote from: monkey_05_06 on Sun 06/10/2013 21:07:05
There have been some builds that allow editable runtime properties that would deprecate this module. I'm not certain if that's been incorporated into the 3.3.0 betas or not.
No, it was in 3.4.0 alpha only. That required changing savedgame format, and back then I was trying to keep format compatible with 3.2.1 in 3.3.0 branch... Now I am not sure it was so wise actually. Well, I seem to fail at planning.

HandsFree

Got a bit further with this.
The eProperties_MaxRooms was set to 2, so I set it to 100 and now the testproperty displays as 1 the first time and 2 the second time.
BUT the third time it's 1 again and the 4th time it's 2 etc.

I added some displays and I see that this line in the SetCustomProperty function gives a different value every time I click on the curtains:
Properties_Hotspots[pID] = Properties_Hotspots[pID].SetVectorValue(Properties_HotspotFormat, this.ID, String.Format("%d", value));

Maybe there's something wrong in this function?

SMF spam blocked by CleanTalk