Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 16,643 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
ahmm..please help me #250761
02/09/09 16:55
02/09/09 16:55
Joined: Jan 2009
Posts: 33
Philippines, Quezon City
K
Kaizen_31 Offline OP
Newbie
Kaizen_31  Offline OP
Newbie
K

Joined: Jan 2009
Posts: 33
Philippines, Quezon City
ahmm..

i have a question..
what will i do if i have 2 different action on my AI?? and i wanted that each time my character kill an AI my character should have a score,i wanted my action enemy() when the player killed it the points is 50 and my action enemy1() is 10 please help me to construct that kind of function that my add functionality to my game..

Re: ahmm..please help me [Re: Kaizen_31] #250796
02/09/09 20:50
02/09/09 20:50
Joined: May 2008
Posts: 331
Lithuania, Vilnius
Jaxas Offline
Senior Member
Jaxas  Offline
Senior Member

Joined: May 2008
Posts: 331
Lithuania, Vilnius
oject can't have 2 actions at the same time!you can assign only one thru wed or in ent_create wink so, try rewrite in one action wink


The smaller the bug, the harder it is to kill.
_________________________________________
Forklift DEMO (3dgs)
Re: ahmm..please help me [Re: Jaxas] #250819
02/10/09 01:35
02/10/09 01:35
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
you can have an action which targets another action

Code:
#define points skill41

action all_enemy(){
  while(me){
    //do your thing
    wait(1);
  }
}

action enemy10(){
  my.points = 10;
  all_enemy();
}

action enemy50(){
  my.points = 50;
  all_enemy();
}

then simply add the targets.points to the score, and assign these in wed as necessary

hope this helps

btw, try naming your forum topics something similar to the problem

Re: ahmm..please help me [Re: MrGuest] #250837
02/10/09 06:21
02/10/09 06:21
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Another way it can be done (although I advise against it) is to have the first action call the second,
then they will both be running for the entity.
Code:
action Secondary_Action()
{  wait(1);   //optional pause to let primary action finish "setting up"
   while(me)
   {   
      //do score tracking stuff ??
      wait(1);
   }
}

action Primary_Action()
{  
   Secondary_Action();   //This will use the ME pointer, as it is NOW
   //
   while(me)
   {   
      //do entity movement stuff ??
      if(my.LifePoints < 1)   ent_remove(me);
      wait(1);
   }
}

... 
// ent_create in some function OR Primary_Action assigned in WED
ent_create("p1.mdl", nullvector, Primary_Action);  
...



"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: ahmm..please help me [Re: EvilSOB] #250870
02/10/09 12:37
02/10/09 12:37
Joined: Jan 2009
Posts: 33
Philippines, Quezon City
K
Kaizen_31 Offline OP
Newbie
Kaizen_31  Offline OP
Newbie
K

Joined: Jan 2009
Posts: 33
Philippines, Quezon City
guys do understand me??
i said that i have diffrent type of enemy code that is separately coded in WED and in SED..a code that can gave my player a score, for example i named my 1st AI as enemy() and i wanted that when my character kill that AI it will have 50 points to his score, then the second one is name as enemy1() and that will be 10 points when my player kill that one and added to the score of my character..

please help me guys sorry for asking again..

please help me

thanks..

KaiZeN..

Re: ahmm..please help me [Re: Kaizen_31] #250982
02/11/09 02:43
02/11/09 02:43
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Oh, OK. If thats all your oing to do in the enemy actions
its very wasteful, but if theres other stuff in there then its OK.
Enemy actions would be something like this...
Code:
acion enemy_1()
{
   while(me)
   {
      //do AI stuff
      if(my.health<=0)   ent_remove(me);
      wait(1);
   }
   //this gets run when entity is dead...
   player_score = player_score + 50;
}


acion enemy_2()
{
   while(me)
   {
      //do other AI stuff
      if(my.health<=0)   ent_remove(me);
      wait(1);
   }
   //this gets run when entity is dead...
   player_score = player_score + 20;
}



"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: ahmm..please help me [Re: EvilSOB] #251094
02/11/09 15:53
02/11/09 15:53
Joined: Jan 2009
Posts: 33
Philippines, Quezon City
K
Kaizen_31 Offline OP
Newbie
Kaizen_31  Offline OP
Newbie
K

Joined: Jan 2009
Posts: 33
Philippines, Quezon City
okie EvilSOB i try this code of yours thanks alot by the way when problem occurs i just post it okie thanks again


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | 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