|
7 registered members (3run, miwok, AndrewAMD, Quad, TipmyPip, fairtrader, 1 invisible),
637
guests, and 2
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: enemy personal variables
[Re: Saturnus]
#306809
01/25/10 04:09
01/25/10 04:09
|
Joined: Jun 2004
Posts: 2,234 Wisconsin USA
FoxHound
Expert
|
Expert
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
|
Every time you make an entity that have all those skills already, no need to declare extra vars that are not needed.
--------------------- There is no signature here.
QUIT LOOKING FOR ONE!
|
|
|
Re: enemy personal variables
[Re: FoxHound]
#306810
01/25/10 04:24
01/25/10 04:24
|
Joined: Nov 2007
Posts: 1,143 United Kingdom
DJBMASTER
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,143
United Kingdom
|
BTW, if you use 'function prototypes' then it doesn't matter which action is first because the engine will know what you mean...
action act_player();
action act_shootme();
Prototypes just make the engine aware that there is an action with a certain name, it has no idea what it does, until you provide a defintion for it later.
|
|
|
Re: enemy personal variables
[Re: DJBMASTER]
#307624
01/30/10 15:55
01/30/10 15:55
|
Joined: Dec 2009
Posts: 361
rtsgamer706
OP
Senior Member
|
OP
Senior Member
Joined: Dec 2009
Posts: 361
|
thanks but I still have a problem, when it reads
hp -= 15;
it still says hp undeclared identifier even though
action scabbard_stuff() { var hp = 15; scabbard = me; c_setminmax(me); while (1) { c_move (my, vector(-28*time_step, 0, 0), nullvector, GLIDE); // move the fragment left wait (1); my.emask = (ENABLE_IMPACT); // make entity sensitive for block and entity collision my.event = remove_scab; } }
is before it! I don't understand why I have that problem please help rtgamer
Last edited by rtsgamer706; 01/30/10 15:55.
|
|
|
Re: enemy personal variables
[Re: rtsgamer706]
#307633
01/30/10 16:31
01/30/10 16:31
|
Joined: Nov 2007
Posts: 1,143 United Kingdom
DJBMASTER
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,143
United Kingdom
|
Well this is only a small part of your code and it's hard to see where the problem is. Also note that when you declare 'var hp=15' inside an action/function, you can't access it from another function/action.
Last edited by DJBMASTER; 01/30/10 16:31.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|