Forums WoW Modding Support Archives WoWModding Threads [DiscordArchive] Is it possible to schedule an event to happen f...

[DiscordArchive] Is it possible to schedule an event to happen f...

[DiscordArchive] Is it possible to schedule an event to happen f...

Pages (10): Previous 1 5 6 7 8 9 10 Next  
rektbyfaith
Administrator
0
12-18-2024, 11:18 PM
#61
Archived author: Drikish • Posted: 2024-12-18T23:18:50.141000+00:00
Original source

If you already replied to this then sorry, I was assuming it would just be doing quick check and return vs letting the logic run perma
rektbyfaith
12-18-2024, 11:18 PM #61

Archived author: Drikish • Posted: 2024-12-18T23:18:50.141000+00:00
Original source

If you already replied to this then sorry, I was assuming it would just be doing quick check and return vs letting the logic run perma

rektbyfaith
Administrator
0
12-18-2024, 11:30 PM
#62
Archived author: stoneharry • Posted: 2024-12-18T23:30:03.396000+00:00
Original source

```c++

class spell_my_custom_map_script : public WorldMapScript
{
public:
spell_my_custom_map_script(const char* name, uint32 mapId) : WorldMapScript(name, mapId)
{

}

void OnUpdate(Map* map, uint32 diff)
{
// Ensure we don't tick more than once a second
_elapsedTime += diff;
if (_elapsedTime < 1000)
return;
_elapsedTime = 0;

// More expensive logic
}

private:
uint32 _elapsedTime = 0;
};

void AddCustomScripts()
{
new spell_my_custom_map_script("spell_my_custom_map_script", 1u);
}
```
rektbyfaith
12-18-2024, 11:30 PM #62

Archived author: stoneharry • Posted: 2024-12-18T23:30:03.396000+00:00
Original source

```c++

class spell_my_custom_map_script : public WorldMapScript
{
public:
spell_my_custom_map_script(const char* name, uint32 mapId) : WorldMapScript(name, mapId)
{

}

void OnUpdate(Map* map, uint32 diff)
{
// Ensure we don't tick more than once a second
_elapsedTime += diff;
if (_elapsedTime < 1000)
return;
_elapsedTime = 0;

// More expensive logic
}

private:
uint32 _elapsedTime = 0;
};

void AddCustomScripts()
{
new spell_my_custom_map_script("spell_my_custom_map_script", 1u);
}
```

rektbyfaith
Administrator
0
12-18-2024, 11:33 PM
#63
Archived author: Drikish • Posted: 2024-12-18T23:33:24.120000+00:00
Original source

Ty for sharing and all your help
rektbyfaith
12-18-2024, 11:33 PM #63

Archived author: Drikish • Posted: 2024-12-18T23:33:24.120000+00:00
Original source

Ty for sharing and all your help

rektbyfaith
Administrator
0
12-18-2024, 11:34 PM
#64
Archived author: Drikish • Posted: 2024-12-18T23:34:29.717000+00:00
Original source

The big thing I am going to have to do is keep track of the time on this map somehow
rektbyfaith
12-18-2024, 11:34 PM #64

Archived author: Drikish • Posted: 2024-12-18T23:34:29.717000+00:00
Original source

The big thing I am going to have to do is keep track of the time on this map somehow

rektbyfaith
Administrator
0
12-18-2024, 11:35 PM
#65
Archived author: Drikish • Posted: 2024-12-18T23:35:01.222000+00:00
Original source

This map has its own time logic so i'll need to have that stored and ready to send to players when they hit this map
rektbyfaith
12-18-2024, 11:35 PM #65

Archived author: Drikish • Posted: 2024-12-18T23:35:01.222000+00:00
Original source

This map has its own time logic so i'll need to have that stored and ready to send to players when they hit this map

rektbyfaith
Administrator
0
12-18-2024, 11:39 PM
#66
Archived author: Drikish • Posted: 2024-12-18T23:39:07.718000+00:00
Original source

I think I can handle that, <@271350028985958408> I only have one more question if you get a second:
How would I go about interacting with this? Lets say for example someone clicks on an object in game and I want to call a function on this map - something like "ProgressToMidnight()" if that was a public function available on this map.
rektbyfaith
12-18-2024, 11:39 PM #66

Archived author: Drikish • Posted: 2024-12-18T23:39:07.718000+00:00
Original source

I think I can handle that, <@271350028985958408> I only have one more question if you get a second:
How would I go about interacting with this? Lets say for example someone clicks on an object in game and I want to call a function on this map - something like "ProgressToMidnight()" if that was a public function available on this map.

rektbyfaith
Administrator
0
12-18-2024, 11:45 PM
#67
Archived author: stoneharry • Posted: 2024-12-18T23:45:36.172000+00:00
Original source

Add it as a function on Map.h and Map.cpp. You have that object available in the update method
rektbyfaith
12-18-2024, 11:45 PM #67

Archived author: stoneharry • Posted: 2024-12-18T23:45:36.172000+00:00
Original source

Add it as a function on Map.h and Map.cpp. You have that object available in the update method

rektbyfaith
Administrator
0
12-18-2024, 11:45 PM
#68
Archived author: stoneharry • Posted: 2024-12-18T23:45:51.533000+00:00
Original source

and your script can set it, as it can access the map object easily
rektbyfaith
12-18-2024, 11:45 PM #68

Archived author: stoneharry • Posted: 2024-12-18T23:45:51.533000+00:00
Original source

and your script can set it, as it can access the map object easily

rektbyfaith
Administrator
0
12-18-2024, 11:45 PM
#69
Archived author: stoneharry • Posted: 2024-12-18T23:45:55.574000+00:00
Original source

WorldObject::GetMap
rektbyfaith
12-18-2024, 11:45 PM #69

Archived author: stoneharry • Posted: 2024-12-18T23:45:55.574000+00:00
Original source

WorldObject::GetMap

rektbyfaith
Administrator
0
12-18-2024, 11:46 PM
#70
Archived author: stoneharry • Posted: 2024-12-18T23:46:20.967000+00:00
Original source

you would set a variable that the OnUpdate reads on next tick and reacts to it
rektbyfaith
12-18-2024, 11:46 PM #70

Archived author: stoneharry • Posted: 2024-12-18T23:46:20.967000+00:00
Original source

you would set a variable that the OnUpdate reads on next tick and reacts to it

Pages (10): Previous 1 5 6 7 8 9 10 Next  
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)