Is it possible to make a custom inventory using hotspots?

Started by alphadalekben, Tue 22/07/2014 11:38:00

Previous topic - Next topic

alphadalekben

Is it possible to create a custom inventory where, if the player character has a stick of dynamite in his hand, the player can click on it, select a rock (for example) and the character will detonate the dynamite in front of the rock?

Slasher

if you mean clicking on the player whose view is of holding dynamite (assuming it's got that view) then yes it can be done that way. You could detonate the rock with the dynamite in a number of ways: like using a hotspot / object etc.

It depends how you want the events to happen.

In short: Yes, it can be done...





alphadalekben

I want it so that when the player gets the dynamite, the view changes to a variation of the walking animation with the character holding the dynamite. When the player needs to use the dynamite, they simply click the dynamite and then click the rock. The character would then place and detonate the dynamite.

Is that any clearer?

Slasher

When the player picks up the stick of dynamite the player's view changes to that of his dynamite view.

If you then click on the rock with the player in dynamite view the player will move to the rock he has clicked on then change view back to normal as the rock explodes...

A very basic way:
Code: ags

//After clicking on dynamite object 
player.Walk(x,y,eBlock, eWalkableAreas); // Walk to Dynamite x y
odynamite.Visible=false; //Dynamite disappears
player.ChangeView(View number); // Dynamite view

// Player clicks on rock. You will need an 'if' condition that player is in dynamite view for events to happen.
player.Walk(x,y,eBlock, eWalkableAreas); // Walk to position x y in Dynamite View
player.ChangeView(View number); // Back to Normal view
Wait(6); // To give a very slight delay
// Dynamite detonates


I use various methods for doing this and it can be much added to: Like extra player animations.




alphadalekben

#4
Cheers man. Now I just need create both walking animations and implement the code in.

SMF spam blocked by CleanTalk