Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
1 registered members (Grant), 999 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
switching actions #66050
03/11/06 13:43
03/11/06 13:43
Joined: Oct 2003
Posts: 246
A
Alberto Offline OP
Member
Alberto  Offline OP
Member
A

Joined: Oct 2003
Posts: 246
Hello

Is it possible to assign more than one action to the same character ?
I mean one only at time but switching to an other one in the gameplay

Re: switching actions [Re: Alberto] #66051
03/11/06 13:55
03/11/06 13:55
Joined: Sep 2003
Posts: 407
inside to my
er_willy Offline
Senior Member
er_willy  Offline
Senior Member

Joined: Sep 2003
Posts: 407
inside to my
not, but the action assigned can switching in gameplay

action starplayer
{
if xxxx shotting()
if xxxx move()
if xxxx jump()
}

Re: switching actions [Re: er_willy] #66052
03/11/06 18:43
03/11/06 18:43
Joined: Jun 2005
Posts: 656
G
Grafton Offline
User
Grafton  Offline
User
G

Joined: Jun 2005
Posts: 656
This is easy, You just replace the character with a new one that has a
different action assigned to it.

Lets say you have a entity called "character" using "char.mdl" and it has an
action attached, then do something like this in one frame;

Code:

vec_set(temp.x, character.x); //store characters' position
ent_remove(character);//remove the character entity
ent_create("char.mdl", temp, new_action); //create a new character and action




Not two, not one.
Re: switching actions [Re: Grafton] #66053
03/11/06 21:52
03/11/06 21:52
Joined: Oct 2003
Posts: 246
A
Alberto Offline OP
Member
Alberto  Offline OP
Member
A

Joined: Oct 2003
Posts: 246
josiah

Thanks it is what I was looking for

Re: switching actions [Re: Alberto] #66054
03/12/06 23:47
03/12/06 23:47
Joined: Sep 2003
Posts: 4,959
US
G
Grimber Offline
Expert
Grimber  Offline
Expert
G

Joined: Sep 2003
Posts: 4,959
US
or. especialy if your storing player data into skills, removing and ent_creating means you also have to back up and copy over all that data you instead use a flag system

action player_act
{
while(1)
{
if (my.flag1 == 0) {player_does_this(); }
if (my.flag1 == 1) {player_does_that(); )
wait(1);
}
}

of course your 2 functions

player_does_this();
player_does_that();

would NOT have any loop operations inside them ( nor call any functions that have loops)

then you just switch the my.flag1 value depending on what ever method you want to. like a panel button or a key press


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