Gamestudio Links
Zorro Links
Newest Posts
zorro license, IB connection
by AndrewAMD. 12/06/23 17:16
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
5 registered members (AndrewAMD, miwok, TipmyPip, 3run, 1 invisible), 631 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Pickup item in 3rd person view #267481
05/24/09 09:47
05/24/09 09:47
Joined: Apr 2005
Posts: 9
Vienna
Master_Jiuro Offline OP
Newbie
Master_Jiuro  Offline OP
Newbie

Joined: Apr 2005
Posts: 9
Vienna
Hello! I tried and tried, but could not figure it out. I have an item and when I click it with my mouse, the player model should play a pickup animation and the clicked item should be removed. Here is what I have:

Quote:
function play_pickup_anim //Animation for the player model

{
player.skill23 = 0;
while (player.skill23 < 90)
{
ent_cycle("Pickup", player.skill23);
player.skill23 += 3 * time;
wait (1);
}
}


action sword //Action assigned to the item
{
my.shadow = on;
c_setminmax(me);
if(mouse_ent == me && mouse_left)
{
if(!sword)
{
sword = 1;
}
else
{
sword_count += 1;
}
}
wait(1);
}
play_pickup_anim();
ent_remove(me);
}


The result of that code is:
-) Item is removed
-) nothing else frown

So please, help my model to be animated smirk
Thanks in advance!!!!


http://www.bytestream.at.tt <-- Down at the moment...
Re: Pickup item in 3rd person view [Re: Master_Jiuro] #267484
05/24/09 11:06
05/24/09 11:06
Joined: Apr 2009
Posts: 298
Southern Oceans
KiwiBoy Offline
Member
KiwiBoy  Offline
Member

Joined: Apr 2009
Posts: 298
Southern Oceans
Shouldnt it be more like this or are you using c-script?
ent_animate(my, "Pickup", player.skill23, ANM_CYCLE);


Use the 'manual' Luke, the manual is your friend. 'Self reminder' smile

My WebPage
Re: Pickup item in 3rd person view [Re: KiwiBoy] #267487
05/24/09 11:43
05/24/09 11:43
Joined: Apr 2005
Posts: 9
Vienna
Master_Jiuro Offline OP
Newbie
Master_Jiuro  Offline OP
Newbie

Joined: Apr 2005
Posts: 9
Vienna
I am still using c-script, it is too hard for me to convert everything to lite-c, maybe I will do this when I have finished my whole project. (Which will still take a long time wink )


http://www.bytestream.at.tt <-- Down at the moment...
Re: Pickup item in 3rd person view [Re: Master_Jiuro] #267585
05/25/09 08:15
05/25/09 08:15
Joined: Nov 2008
Posts: 946
T
the_clown Offline
User
the_clown  Offline
User
T

Joined: Nov 2008
Posts: 946
Converting the whole project to c-script is a very bad idea.
Let me tell you that it's a real pain in the ass to convert only a few hundred lines; Depending on how clean your code is, it can take many hours. The whole project would take a few weeks, I guess. So, better do this in c-script, and use lite-c
for your next project.

Re: Pickup item in 3rd person view [Re: the_clown] #267815
05/26/09 11:44
05/26/09 11:44
Joined: Apr 2005
Posts: 9
Vienna
Master_Jiuro Offline OP
Newbie
Master_Jiuro  Offline OP
Newbie

Joined: Apr 2005
Posts: 9
Vienna
Ok, thanks for this advice, but how can I now get my problem solved? Please help, I am really stuck to this (maybe) simple thing.


http://www.bytestream.at.tt <-- Down at the moment...
Re: Pickup item in 3rd person view [Re: Master_Jiuro] #267837
05/26/09 12:52
05/26/09 12:52
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
You have to set all code from the action in a loop.
while(1)
{
...your code
}

If you don`t do that, the action starts, goes thru the code and finished at the end in the first frame...

Re: Pickup item in 3rd person view [Re: Widi] #268064
05/27/09 11:32
05/27/09 11:32
Joined: Apr 2005
Posts: 9
Vienna
Master_Jiuro Offline OP
Newbie
Master_Jiuro  Offline OP
Newbie

Joined: Apr 2005
Posts: 9
Vienna
Thank you, but somehow it does not work. Either the animation is played in a loop, but the item is not picked up, or the player picks up the item, but does not play his animation.


http://www.bytestream.at.tt <-- Down at the moment...
Re: Pickup item in 3rd person view [Re: Master_Jiuro] #268082
05/27/09 12:31
05/27/09 12:31
Joined: Apr 2009
Posts: 298
Southern Oceans
KiwiBoy Offline
Member
KiwiBoy  Offline
Member

Joined: Apr 2009
Posts: 298
Southern Oceans
Something to loop the animation may be;
my.skill23 %= 100;
...to finish it


Use the 'manual' Luke, the manual is your friend. 'Self reminder' smile

My WebPage

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1