Please login or register.

Login with username, password and session length
 

News:

Happy Holidays !!!


Author Topic: set state rage  (Read 1161 times)

Offline bearded

  • b?rtinleger
  • Hero Member
  • Posts: 3514
set state rage
« on: August 20, 2010, 04:12:56 PM »
how can i set a state to last an entire mission?
i think i see,
Code: [Select]
Object_SetPrimaryState(char,PCSTATE_ENRAGED,10)and the 10 is for 10 seconds. how would i do infinite?
also is there a way to spawn a hero without it becoming one of the 4 selections? without changing the ai to cop or minion i mean. python wise.
« Last Edit: August 20, 2010, 04:49:28 PM by bearded »

Offline bearded

  • b?rtinleger
  • Hero Member
  • Posts: 3514
Re: set state rage
« Reply #1 on: August 21, 2010, 05:37:14 AM »
i'm stumbling over the call object. seems like a simple thing to do. i spawn a random bad guy from a list, named randPick.
then i
Code: [Select]
Object_SetPrimaryState(randPick,PCSTATE_ENRAGED,10)no good, calls a null on the object as error.
so i change randPick back to char and try char = randPick, which of course gives me the same error. then i try char=event.object and get the same error.
i'm confused.

Offline DrMike2000

  • Hero Member
  • Posts: 3256
    • http://www.fundamentzero.com
Re: set state rage
« Reply #2 on: August 23, 2010, 07:10:06 AM »
Is randPick a variable or his name?

If its his name, it should read 'randPick'

And never ever create a character with a capitalised letter in its name. The game converts all character names to lower case at some point, as I learned the hard way putting together the Horror in Strangers Mission 3.

eg 'randpick' or 'rand_pick' but never 'randPick'
Stranger Than Fiction:
The Strangers, Tales of the Navigator and Freedom Force X
www.fundamentzero.com

Offline bearded

  • b?rtinleger
  • Hero Member
  • Posts: 3514
Re: set state rage
« Reply #3 on: August 23, 2010, 08:01:29 AM »
it's a variable.  e.g. random pick.
what i'm having trouble understanding is how to set up what python needs for it's variables in it's calls.
should i do a def that calls to another def? what exactly is an event.object?
i want to spawn from a list, and then set the state to that spawn to be enraged.
randPick is simply the name of the spawn drawn from a list. i can object spawn randPick, but when i objectsetprimarystate randPick, it calls null on the object as an error.

Offline bearded

  • b?rtinleger
  • Hero Member
  • Posts: 3514
Re: set state rage
« Reply #4 on: August 24, 2010, 01:42:08 PM »
what i'm doing, is i have a level created wherein a number of random good guys are chosen from a list. you have to defeat or hold off the heroes while trying to discover what's gotten them so out of control. the reason is different every time you play the level. (no spoilers!) when you solve the puzzle, you win the mission.
i've managed to get the heroes to spawn, and activated the goals of making them attack the player, but they are still in the controllable 4, and i can't manage to enrage them.