Hi,
I am making a basic imitation of Oregon Trail's hunting mini-game. I know basic JavaScript recently, am new at using Galv's Map Projectiles and can call events remotely using Visustella's Event Core.
I need to, based on the animal shot and killed, store a variable temporarily and then use that variable to assign/increase the loot from the specific animal/event type killed into the player's inventory.
I am trying to modify the common event above to instead call the event ID, to in turn perform the following script call:
This might be a simple matter of needing to understand the code for the VZ script better:
But the concept should be pretty simple and only one-or-two lines, if I understand the situation correctly there could be a few ways to skin this cat, none of them too terribly complex:
METHOD A:
Store a self-variable value in a given event and then, using Galv's projectile variable Galv.PROJ.ceTargetId(), feed the resulting event ID into Visustella Remove Event Script Call to assign the self-variable value as a global variable to then assign the loot based on the type of animal killed.
METHOD B:
Modify the following Galv Map Projectiles Script Plugin Premade Projectile configuration for shooting projectiles forward from the player:
to enable a specific self-switch on the target ('|s(A😮n)' for example)
, which can then pass the appropriate value for the type of animal killed to the global variable, then call a common event to use that variable's value to assign the loot, and then erase the animal. (which can continue to be respawned during the minigame duration by the Visustella event spawner functions)
There could be ways to do this using Event Touch instead of the <projEffect> comment Galv's Map Projectiles requires to call a common event when an event is shot.
I'm just having trouble wrapping my head around a few steps in the middle of this but I think I understand enough information to answer this quickly... might even have answered my own question but am unsure how to write the code after staring at the examples for several hours. The hunting minigame mechanics only impacts a single map that is otherwise not core to the rest of the game, so this may not even require common events other than the fact that Galv's Map Projectiles requires calling one as an Event Action. Then the entire minigame can be shut off permanently with a separate switch.
I'm almost positive hunting has already been done using this plugin in MV or MZ where I might be able to learn the exact code for declaring and finding the variable IDs to do this. Apologies if this is confusing or simple to answer. This might also belong in another sub-forum.
I am making a basic imitation of Oregon Trail's hunting mini-game. I know basic JavaScript recently, am new at using Galv's Map Projectiles and can call events remotely using Visustella's Event Core.
I need to, based on the animal shot and killed, store a variable temporarily and then use that variable to assign/increase the loot from the specific animal/event type killed into the player's inventory.
I am trying to modify the common event above to instead call the event ID, to in turn perform the following script call:
This might be a simple matter of needing to understand the code for the VZ script better:
JavaScript:
Get Self Variable Values:
getSelfVariableValue(mapID, eventID, variableID)
- Replace 'mapID' with the map ID the target event is located on.
- Replace 'eventID' with the ID of the target event.
- Replace 'variableID' with the ID number of the Self Variable.
- This will return whatever stored value is found in the Self Variable.
- Example: getSelfVariableValue(12, 34, 56)
But the concept should be pretty simple and only one-or-two lines, if I understand the situation correctly there could be a few ways to skin this cat, none of them too terribly complex:
METHOD A:
Store a self-variable value in a given event and then, using Galv's projectile variable Galv.PROJ.ceTargetId(), feed the resulting event ID into Visustella Remove Event Script Call to assign the self-variable value as a global variable to then assign the loot based on the type of animal killed.
METHOD B:
Modify the following Galv Map Projectiles Script Plugin Premade Projectile configuration for shooting projectiles forward from the player:
JavaScript:
{"name":"Shoot forward from player","sid":"-1","tid":"d0","speed":"10","dist":"7","graphic":"pebble","anim":"121","eAction":"","pAction":"","regions":"5,6","terrains":"6","z":"3","pid":"1","size":""}
to enable a specific self-switch on the target ('|s(A😮n)' for example)
, which can then pass the appropriate value for the type of animal killed to the global variable, then call a common event to use that variable's value to assign the loot, and then erase the animal. (which can continue to be respawned during the minigame duration by the Visustella event spawner functions)
There could be ways to do this using Event Touch instead of the <projEffect> comment Galv's Map Projectiles requires to call a common event when an event is shot.
I'm just having trouble wrapping my head around a few steps in the middle of this but I think I understand enough information to answer this quickly... might even have answered my own question but am unsure how to write the code after staring at the examples for several hours. The hunting minigame mechanics only impacts a single map that is otherwise not core to the rest of the game, so this may not even require common events other than the fact that Galv's Map Projectiles requires calling one as an Event Action. Then the entire minigame can be shut off permanently with a separate switch.
I'm almost positive hunting has already been done using this plugin in MV or MZ where I might be able to learn the exact code for declaring and finding the variable IDs to do this. Apologies if this is confusing or simple to answer. This might also belong in another sub-forum.