Connection ErrorBad RequestSession ExpiredSign in requiredForbiddenNot FoundToo Many RequestsServer ErrorBad GatewayService UnavailableGateway TimeoutHTTP Version Not Supported
Session Expired
Your session has expired. Please log in to continue.
Sign in required
You need an account to do that. Sign in or create one — it only takes a minute.
Request Failed
We encountered an issue while processing your request.
Please check your internet connection and try again.
I understand that – it's just that for this command (MarkObjectAsVisited) to work, the object must be turned off – that's why other heroes can't interact with it.
Well, I'm saying that the object is turned off. :confused: :smile33:. It's turned off via scripts – otherwise, it doesn't work as it should. Interaction is done through TOUCH_TRIGGER.
Well, what I'm writing is that the object is disabled if needed. :confused: :smile33:. It's disabled using scripts - otherwise, it doesn't work as it should. Interaction is done through TOUCH_TRIGGER.
Try a different method - disable it using region_enter_and_stop_trigger.
try a different method - disabling it using the enter_and_stop_trigger command.
Other methods won't work. I've already tried them. It's just unclear why this function is so problematic :smile48: - it doesn't want to work correctly.
antonag07
14 years ago
Auto-translated
or could it be a trick with the name? (i.e., the game considers 'geroy' to be the entire array of heroes under the player's control)
Could it be a trick with the name? (i.e., the game considers 'geroy' to be the entire array of heroes under the player's control)
Here, look at a part of the script: num_stone=3; --number of demon stones for i=1,num_stone do SetObjectEnabled ('stone_'..i,nil); Trigger (OBJECT_TOUCH_TRIGGER,'stone_'..i,'up_herolider'); end;
function up_herolider(geroi,object) if geroi==Larion then ................ MarkObjectAsVisited (object,geroi); ................. else if geroi==Derin then ................. MarkObjectAsVisited (object,geroi); end;end; end; ..............
Derin and Larion are constants (hero names); there's a lot more, but this is the basis. When any of the heroes 'contacts' the object, when the second hero right-clicks on the 'stone' object, it says 'already visited', but if you approach it, the bonus is given normally. Visually, it's not clear whether one or both heroes were at the object.
antonag07
14 years ago
Auto-translated
I wanted to ask you right away about the message that appears when hovering the cursor; because as it is, it doesn't make the game very playable.
And what if we launch threads to check whether a particular hero has visited a specific object?
I actually wanted to ask you right away about the message that appears when you hover the cursor; because as it is, it doesn't make the game very playable.
What if we launch threads to check whether a particular object is visited by a specific hero?
I don't think it's worth it - there will be at least 50 of these objects, and it will slow down the game too much. Besides, there will be other threads as well. So, you don't know what the problem is?
I don't think it's worth it - there will be at least 50 such objects, which will slow down the game too much. Besides, there will be other processes running. Don't you know what the problem is?
I don't know - I can only guess;
I tried using this value: MarkObjectAsVisited(sObjectID, true); where sObjectID is the script name of the object. ?
KioM
14 years ago
Auto-translated
for i=1,num_stone do SetObjectEnabled ('stone_'..i,nil); Trigger (OBJECT_TOUCH_TRIGGER,'stone_'..i,'up_herolider'); end;
There seems to be an issue with the loops. Try disabling the object in a different way, for example, by naming all three stones differently: stone01, stone02, stone03, and then selecting them in the script:
stone = {'stone01', 'stone02', 'stone03'}; stone.n = length(stone); ... for i=1, stone.n do SetObjectEnabled (stone,nil); Trigger (OBJECT_TOUCH_TRIGGER,stone,'up_herolider'); end; ...
I tried recording this value: MarkObjectAsVisited(sObjectID, true); where sObjectID is the script name of the object.
Yes, it gives an error that there is no hero '1' on the map. And I also tried setting the third parameter to true – I thought maybe there was an error in the manual. The effect is achieved anyway, but not for a specific hero.
Added 2 minutes later KioM
There's something wrong with the loops; try disabling the object in a different way, for example, by naming all three stones differently: stone01, stone02, stone03, and then selecting them in the script:
stone = {'stone01', 'stone02', 'stone03'}; stone.n = length(stone); ... for i=1, stone.n do SetObjectEnabled (stone,nil); Trigger (OBJECT_TOUCH_TRIGGER,stone,'up_herolider'); end; ...
This loop works perfectly fine – it has been tested many times. You are suggesting doing the same thing, but in a more verbose way. (And what if I have 1000 'stone' objects? ;) )
KioM
14 years ago
Auto-translated
I might have misunderstood. Does `MarkObjectAsVisited` work, but not for a specific hero, but for all heroes?
yes - accordingly, it gives an error that there is no hero '1' on the map. And I also set the third parameter to true - I thought maybe there was an error in the manual. The effect is achieved in principle even without it, but not for a specific hero.
)
Did the error with the hero's name always occur, or only after MarkObjectAsVisited(sObjectID,true);?
(because in message 379 I also made such a suggestion)
Did the error with the hero's name always occur, or only after MarkObjectAsVisited(sObjectID,true); ?
(because in message 379, I also made such a suggestion)
Of course, it happens after you change the function's parameters. All errors can be easily caught with print statements. :) Yeah, it will be a bad problem for players - not knowing which obelisk has been visited :smile13:
KioM
14 years ago
Auto-translated
Sorry, I misunderstood earlier (I'm already tired), here's how you should do it:
function up_herolider(geroi,object) if geroi ==Larion then ................ -MarkObjectAsVisited (object,geroi); +MarkObjectAsVisited (object,Larion); ................. and so on, i.e., directly reference the specific hero.