Home   Help Search Login Register  

Author Topic: Createunit & grpnull  (Read 682 times)

0 Members and 2 Guests are viewing this topic.

Offline RujiK

  • Members
  • *
  • KoKo Puh-Fizzles!
Createunit & grpnull
« on: 26 Feb 2005, 02:33:15 »
This is my script:
Code: [Select]
_pos = [(getpos resppos select 0),(getpos resppos select 1),0]
_grp = grpnull
_man = "Civilian" createunit [_pos,_grp]

However, for some reason or another this unit will not be constructed.
When I change the text of _grp = grpnull to _grp = player the unit will be constructed, but for some reason when it is grpnull he will not come into being.

Any help would be greatly appreciated.
« Last Edit: 26 Feb 2005, 02:33:33 by RujiK »
I like your approach, lets see your departure.
Download the New Flashlight Script!

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Createunit & grpnull
« Reply #1 on: 26 Feb 2005, 04:19:24 »
2 things:
1)give him a group then make him switch through his init

2) AFAIK you can't do _man = "blah" blah blah with createunit

try this:
"civilian" createunit [_pos,(group player),"_man = this;[this] join grpnull "]

« Last Edit: 26 Feb 2005, 04:22:15 by Triggerhappy »

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:Createunit & grpnull
« Reply #2 on: 26 Feb 2005, 04:22:13 »
Im not sure, but i dont think you can create into grpnull. But i may be wrong.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Createunit & grpnull
« Reply #3 on: 26 Feb 2005, 04:22:59 »
hehe, i messed up the post, didn't read. you musta posted while i was editing

Offline Blanco

  • Former Staff
  • ****
Re:Createunit & grpnull
« Reply #4 on: 26 Feb 2005, 04:29:49 »
grpnull is a non existing group, so I guess it's not a group...
Search or search or search before you ask.

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:Createunit & grpnull
« Reply #5 on: 26 Feb 2005, 05:12:37 »
@ Triggerhappy.
Yes!  :D

Offline RujiK

  • Members
  • *
  • KoKo Puh-Fizzles!
Re:Createunit & grpnull
« Reply #6 on: 26 Feb 2005, 17:55:06 »
"civilian" createunit [_pos,(group player),"_man = this;[this] join grpnull "]
Your scripting is fine, however I think I have found a bug in the game...
With this exzact same scripting, I can do "civilian" createunit [_pos,(group player),"man = this;man setdammage 1"] and it works, however with grpnull, the unit refuses to leave his group. This seems to be a bug.
« Last Edit: 26 Feb 2005, 17:55:37 by RujiK »
I like your approach, lets see your departure.
Download the New Flashlight Script!

Offline RujiK

  • Members
  • *
  • KoKo Puh-Fizzles!
Re:Createunit & grpnull
« Reply #7 on: 26 Feb 2005, 17:58:14 »
Ok, I found a Loop around the problem, and yes it is indeed a bug (Possible only with my version?)

Instead I used the good old _x command for removing the dope from his group  ;D
I like your approach, lets see your departure.
Download the New Flashlight Script!

Offline DrStrangelove

  • Members
  • *
  • Mr.Creative
Re:Createunit & grpnull
« Reply #8 on: 27 Feb 2005, 16:26:23 »
When you create a unit into grpNull, OpF makes a new group, so that person is the leader of the new group.

It's true that grpNull is not a group, but since every living unit in OpF must belong to a group, Opf takes care of that for you. Isn't that nice ?  ;D


The last command you posted can also be scripted like this:

Code: [Select]
"civilian" createunit [_pos,(group player),""]
man = (units group player) select ((count units group player)-1);
[man] join grpNull;
_newgroup = group man;
man setdammage 1;

Now you have the new group saved into _newgroup, so it can be of further use.
« Last Edit: 27 Feb 2005, 16:27:36 by DrStrangelove »